davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=8ad08e8ef862bd0696e8d221e473b7860ee9e619

commit 8ad08e8ef862bd0696e8d221e473b7860ee9e619
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Sat Nov 14 17:27:49 2015 +0100

    New 1.16 API: various next_item_get/set
---
 efl/elementary/object.pxi           | 38 +++++++++++++++++++
 efl/elementary/object_cdef.pxi      |  2 +
 efl/elementary/object_item.pxi      | 74 +++++++++++++++++++++++++++++++++++++
 efl/elementary/object_item_cdef.pxi |  5 +++
 4 files changed, 119 insertions(+)

diff --git a/efl/elementary/object.pxi b/efl/elementary/object.pxi
index 3ed8cef..68dc40f 100644
--- a/efl/elementary/object.pxi
+++ b/efl/elementary/object.pxi
@@ -858,6 +858,44 @@ cdef class Object(SmartObject):
     def focused_object_get(self):
         return object_from_instance(elm_object_focused_object_get(self.obj))
 
+    def focus_next_item_get(self, Elm_Focus_Direction direction):
+        """Get next object item which was set with specific focus direction.
+
+        Get next object item which was set by :func:`focus_next_item_set`
+        with specific focus direction.
+
+        :return: Focus next object item or ``None``, if there is no focus next
+                 object item.
+        :rtype: :class:`ObjectItem`
+
+        .. versionadded:: 1.16
+
+        """
+        return _object_item_to_python(
+                        elm_object_focus_next_item_get(self.obj, direction))
+
+    def focus_next_item_set(self, ObjectItem next,
+                            Elm_Focus_Direction direction):
+        """ Set next object item with specific focus direction.
+
+        When focus next object item is set with specific focus direction, this
+        object item will be the first candidate when finding next focusable
+        object or item. If the focus next object item is set, it is preference
+        to focus next object. Focus next object item can be registered with six
+        directions that are previous, next, up, down, right, and left.
+
+        :param next: Focus next object item
+        :type next: :class:`ObjectItem`
+        :param dir: Focus direction
+        :type dir: :ref:`Elm_Focus_Direction`
+
+        :see: :py:func:`focus_next_item_get`
+
+        .. versionadded:: 1.16
+
+        """
+        elm_object_focus_next_item_set(self.obj, next.item, direction)
+        
     property focused_item:
         """The focused object item in an object tree.
 
diff --git a/efl/elementary/object_cdef.pxi b/efl/elementary/object_cdef.pxi
index 877c954..7de9b10 100644
--- a/efl/elementary/object_cdef.pxi
+++ b/efl/elementary/object_cdef.pxi
@@ -176,6 +176,8 @@ cdef extern from "Elementary.h":
     Eina_Bool               elm_object_tree_focus_allow_get(const Evas_Object 
*obj)
     Eina_Bool               elm_object_focus_highlight_style_set(Evas_Object 
*obj, const char *style)
     const char *            elm_object_focus_highlight_style_get(const 
Evas_Object *obj)
+    Elm_Object_Item *       elm_object_focus_next_item_get(const Evas_Object 
*obj, Elm_Focus_Direction dir)
+    void                    elm_object_focus_next_item_set(Evas_Object *obj, 
Elm_Object_Item *next_item, Elm_Focus_Direction dir)
     Elm_Object_Item *       elm_object_focused_item_get(const Evas_Object *obj)
     void                    elm_object_focus_move_policy_set(Evas_Object *obj, 
Elm_Focus_Move_Policy policy)
     Elm_Focus_Move_Policy   elm_object_focus_move_policy_get(Evas_Object *obj)
diff --git a/efl/elementary/object_item.pxi b/efl/elementary/object_item.pxi
index 4eec972..a824015 100644
--- a/efl/elementary/object_item.pxi
+++ b/efl/elementary/object_item.pxi
@@ -641,6 +641,80 @@ cdef class ObjectItem(object):
     def focus_get(self):
         return elm_object_item_focus_get(self.item)
 
+    def focus_next_object_get(self, Elm_Focus_Direction direction):
+        """Get next object which was set with specific focus direction.
+
+        :param dir: Focus direction
+        :type dir: :ref:`Elm_Focus_Direction`
+        :return: Focus next object or None, if there is no focus next object.
+        :rtype: :class:`Object`
+
+        :see: :func:`focus_next_object_set`
+
+        .. versionadded:: 1.16
+
+        """
+        return object_from_instance(
+            elm_object_item_focus_next_object_get(self.item, direction)
+            )
+
+    def focus_next_object_set(self, evasObject next,
+                               Elm_Focus_Direction direction):
+        """Set next object with specific focus direction.
+
+        When focus next object is set with specific focus direction, this 
object
+        will be the first candidate when finding next focusable object. Focus
+        next object can be registered with six directions that are previous,
+        next, up, down, right, and left.
+
+        :param next: Focus next object
+        :type next: :class:`Object`
+        :param dir: Focus direction
+        :type dir: :ref:`Elm_Focus_Direction`
+
+        :see: :py:func:`focus_next_object_get`
+
+        .. versionadded:: 1.16
+
+        """
+        elm_object_item_focus_next_object_set(self.item, next.obj, direction)
+
+    def focus_next_item_get(self, Elm_Focus_Direction direction):
+        """Get next object item which was set with specific focus direction.
+
+        :return: Focus next object item or ``None``, if there is no focus next
+                 object item.
+        :rtype: :class:`ObjectItem`
+
+        .. versionadded:: 1.16
+
+        """
+        return _object_item_to_python(
+                    elm_object_item_focus_next_item_get(self.item, direction))
+
+    def focus_next_item_set(self, ObjectItem next,
+                            Elm_Focus_Direction direction):
+        """ Set next object item with specific focus direction.
+
+        When focus next object item is set with specific focus direction, this
+        object item will be the first candidate when finding next focusable
+        object or item. If the focus next object item is set, it is preference
+        to focus next object. Focus next object item can be registered with six
+        directions that are previous, next, up, down, right, and left.
+
+        :param next: Focus next object item
+        :type next: :class:`ObjectItem`
+        :param dir: Focus direction
+        :type dir: :ref:`Elm_Focus_Direction`
+
+        :see: :py:func:`focus_next_item_get`
+
+        .. versionadded:: 1.16
+
+        """
+        elm_object_item_focus_next_item_set(self.item, next.item, direction)
+        
+
 
     # TODO: Accessibility
     # def access_unregister(self):
diff --git a/efl/elementary/object_item_cdef.pxi 
b/efl/elementary/object_item_cdef.pxi
index 70dce68..490f40d 100644
--- a/efl/elementary/object_item_cdef.pxi
+++ b/efl/elementary/object_item_cdef.pxi
@@ -44,6 +44,11 @@ cdef extern from "Elementary.h":
     Eina_Bool       elm_object_item_cursor_engine_only_get(const 
Elm_Object_Item *it)
     void            elm_object_item_focus_set(Elm_Object_Item *it, Eina_Bool 
focused)
     Eina_Bool       elm_object_item_focus_get(const Elm_Object_Item *it)
+    Evas_Object *     elm_object_item_focus_next_object_get(Elm_Object_Item 
*it, Elm_Focus_Direction dir)
+    void              elm_object_item_focus_next_object_set(Elm_Object_Item 
*it, Evas_Object *next, Elm_Focus_Direction dir)
+    Elm_Object_Item * elm_object_item_focus_next_item_get(Elm_Object_Item *it, 
Elm_Focus_Direction dir)
+    void              elm_object_item_focus_next_item_set(Elm_Object_Item *it, 
Elm_Object_Item *next_item, Elm_Focus_Direction dir)
+
 
 
     #TODO: Evas_Object *   elm_object_item_access_register(Elm_Object_Item 
*item)

-- 


Reply via email to