kuuko pushed a commit to branch master.
commit 2f7030d5bb1be27ede1376368b09466f75a9ddee
Author: Kai Huuhko <[email protected]>
Date: Tue Apr 16 19:03:18 2013 +0000
Elementary: Complete LayoutClass API, add some missing API to Object.
---
efl/elementary/layout_class.pxd | 90 +++++++++---------
efl/elementary/layout_class.pyx | 115 +++++++++++++++++++++--
efl/elementary/object.pxd | 19 +++-
efl/elementary/object.pyx | 197 ++++++++++++++++++++++++++++++++++++++--
4 files changed, 362 insertions(+), 59 deletions(-)
diff --git a/efl/elementary/layout_class.pxd b/efl/elementary/layout_class.pxd
index a9f7f19..c78314c 100644
--- a/efl/elementary/layout_class.pxd
+++ b/efl/elementary/layout_class.pxd
@@ -1,22 +1,21 @@
-# Copyright 2012 Kai Huuhko <[email protected]>
+# Copyright (C) 2007-2013 various contributors (see AUTHORS)
#
-# This file is part of python-elementary.
+# This file is part of Python-EFL.
#
-# python-elementary is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# Python-EFL is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
#
-# python-elementary is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
+# Python-EFL is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with python-elementary. If not, see <http://www.gnu.org/licenses/>.
-#
+# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
-from efl.evas cimport Evas_Object, Eina_Bool
+from efl.evas cimport Evas_Object, const_Evas_Object, Eina_Bool
from object cimport Object
from libc.string cimport const_char
@@ -24,37 +23,44 @@ cdef extern from "Edje.h":
ctypedef void (*Edje_Signal_Cb)(void *data, Evas_Object *obj, const_char
*emission, const_char *source)
cdef extern from "Elementary.h":
+ Eina_Bool elm_layout_file_set(Evas_Object *obj, const_char
*file, const_char *group)
+ int elm_layout_freeze(Evas_Object *obj)
+ int elm_layout_thaw(Evas_Object *obj)
+ Eina_Bool elm_layout_theme_set(Evas_Object *obj, const_char
*clas, const_char *group, const_char *style)
+ void elm_layout_signal_emit(Evas_Object *obj, const_char
*emission, const_char *source)
+ void elm_layout_signal_callback_add(Evas_Object *obj,
const_char *emission, const_char *source, Edje_Signal_Cb func, void *data)
+ void * elm_layout_signal_callback_del(Evas_Object *obj,
const_char *emission, const_char *source, Edje_Signal_Cb func)
+ Eina_Bool elm_layout_box_append(Evas_Object *obj, const_char
*part, Evas_Object *child)
+ Eina_Bool elm_layout_box_prepend(Evas_Object *obj, const_char
*part, Evas_Object *child)
+ Eina_Bool elm_layout_box_insert_before(Evas_Object *obj,
const_char *part, Evas_Object *child, Evas_Object *reference)
+ Eina_Bool elm_layout_box_insert_at(Evas_Object *obj, const_char
*part, Evas_Object *child, unsigned int pos)
+ Evas_Object * elm_layout_box_remove(Evas_Object *obj, const_char
*part, Evas_Object *child)
+ Eina_Bool elm_layout_box_remove_all(Evas_Object *obj, const_char
*part, Eina_Bool clear)
+ Eina_Bool elm_layout_table_pack(Evas_Object *obj, const_char
*part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned
short colspan, unsigned short rowspan)
+ Evas_Object * elm_layout_table_unpack(Evas_Object *obj, const_char
*part, Evas_Object *child_obj)
+ Eina_Bool elm_layout_table_clear(Evas_Object *obj, const_char
*part, Eina_Bool clear)
+ Evas_Object * elm_layout_edje_get(Evas_Object *obj)
+ const_char * elm_layout_data_get(Evas_Object *obj, const_char *key)
+ void elm_layout_sizing_eval(Evas_Object *obj)
+ Eina_Bool elm_layout_part_cursor_set(Evas_Object *obj,
const_char *part_name, const_char *cursor)
+ const_char * elm_layout_part_cursor_get(Evas_Object *obj,
const_char *part_name)
+ Eina_Bool elm_layout_part_cursor_unset(Evas_Object *obj,
const_char *part_name)
+ Eina_Bool elm_layout_part_cursor_style_set(Evas_Object *obj,
const_char *part_name, const_char *style)
+ const_char * elm_layout_part_cursor_style_get(Evas_Object *obj,
const_char *part_name)
+ Eina_Bool elm_layout_part_cursor_engine_only_set(Evas_Object
*obj, const_char *part_name, Eina_Bool engine_only)
+ Eina_Bool elm_layout_part_cursor_engine_only_get(Evas_Object
*obj, const_char *part_name)
+ Eina_Bool elm_layout_edje_object_can_access_set(Evas_Object
*obj, Eina_Bool can_access)
+ Eina_Bool elm_layout_edje_object_can_access_get(Evas_Object *obj)
- # Layout (api:TODO cb:DONE test:DONE doc:DONE py3:DONE)
- Eina_Bool elm_layout_file_set(Evas_Object *obj, const_char
*file, const_char *group)
- Eina_Bool elm_layout_theme_set(Evas_Object *obj, const_char
*clas, const_char *group, const_char *style)
- void elm_layout_signal_emit(Evas_Object *obj,
const_char *emission, const_char *source)
- void elm_layout_signal_callback_add(Evas_Object *obj,
const_char *emission, const_char *source, Edje_Signal_Cb func, void *data)
- void *elm_layout_signal_callback_del(Evas_Object *obj,
const_char *emission, const_char *source, Edje_Signal_Cb func)
- Eina_Bool elm_layout_box_append(Evas_Object *obj,
const_char *part, Evas_Object *child)
- Eina_Bool elm_layout_box_prepend(Evas_Object *obj,
const_char *part, Evas_Object *child)
- Eina_Bool elm_layout_box_insert_before(Evas_Object *obj,
const_char *part, Evas_Object *child, Evas_Object *reference)
- Eina_Bool elm_layout_box_insert_at(Evas_Object *obj,
const_char *part, Evas_Object *child, unsigned int pos)
- Evas_Object *elm_layout_box_remove(Evas_Object *obj,
const_char *part, Evas_Object *child)
- Eina_Bool elm_layout_box_remove_all(Evas_Object *obj,
const_char *part, Eina_Bool clear)
- Eina_Bool elm_layout_table_pack(Evas_Object *obj,
const_char *part, Evas_Object *child_obj, unsigned short col, unsigned short
row, unsigned short colspan, unsigned short rowspan)
- Evas_Object *elm_layout_table_unpack(Evas_Object *obj,
const_char *part, Evas_Object *child_obj)
- Eina_Bool elm_layout_table_clear(Evas_Object *obj,
const_char *part, Eina_Bool clear)
- Evas_Object *elm_layout_edje_get(Evas_Object *obj)
- const_char * elm_layout_data_get(Evas_Object *obj, const_char
*key)
- void elm_layout_sizing_eval(Evas_Object *obj)
- Eina_Bool elm_layout_part_cursor_set(Evas_Object *obj,
const_char *part_name, const_char *cursor)
- const_char * elm_layout_part_cursor_get(Evas_Object *obj,
const_char *part_name)
- Eina_Bool elm_layout_part_cursor_unset(Evas_Object *obj,
const_char *part_name)
- Eina_Bool elm_layout_part_cursor_style_set(Evas_Object
*obj, const_char *part_name, const_char *style)
- const_char * elm_layout_part_cursor_style_get(Evas_Object *obj,
const_char *part_name)
- Eina_Bool
elm_layout_part_cursor_engine_only_set(Evas_Object *obj, const_char *part_name,
Eina_Bool engine_only)
- Eina_Bool
elm_layout_part_cursor_engine_only_get(Evas_Object *obj, const_char *part_name)
- void elm_layout_icon_set(Evas_Object *obj, Evas_Object
*icon)
- Evas_Object *elm_layout_icon_get(Evas_Object *obj)
- void elm_layout_end_set(Evas_Object *obj, Evas_Object
*end)
- Evas_Object *elm_layout_end_get(Evas_Object *obj)
+ void elm_layout_icon_set(Evas_Object *obj, Evas_Object
*icon)
+ Evas_Object * elm_layout_icon_get(Evas_Object *obj)
+ void elm_layout_end_set(Evas_Object *obj, Evas_Object *end)
+ Evas_Object * elm_layout_end_get(Evas_Object *obj)
cdef class LayoutClass(Object):
+ cdef object _elm_layout_signal_cbs
+
cpdef file_set(self, filename, group = *)
cpdef theme_set(self, clas, group, style)
+ cpdef edje_object_can_access_set(self, bint can_access)
+ cpdef bint edje_object_can_access_get(self)
diff --git a/efl/elementary/layout_class.pyx b/efl/elementary/layout_class.pyx
index 649c616..f130265 100644
--- a/efl/elementary/layout_class.pyx
+++ b/efl/elementary/layout_class.pyx
@@ -17,6 +17,18 @@
include "widget_header.pxi"
+import traceback
+
+cdef void layout_signal_callback(void *data, Evas_Object *obj,
+ const_char *emission, const_char *source) with gil:
+ cdef Object self = object_from_instance(obj)
+ lst = tuple(<object>data)
+ for func, args, kargs in lst:
+ try:
+ func(self, _ctouni(emission), _ctouni(source), *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+
cdef class LayoutClass(Object):
"""
@@ -67,6 +79,35 @@ cdef class LayoutClass(Object):
<const_char *>group if group is not None else NULL):
raise RuntimeError("Could not set file.")
+ def freeze(self):
+ """Freezes the Elementary layout object.
+
+ This function puts all changes on hold. Successive freezes will
+ nest, requiring an equal number of thaws.
+
+ :return: The frozen state or 0 on Error
+
+ :see: :py:func:`thaw`
+
+ """
+ return elm_layout_freeze(self.obj)
+
+ def thaw(self):
+ """Thaws the Elementary object.
+
+ This function thaws the given Edje object and the Elementary sizing
calc.
+
+ :return: The frozen state or 0 if the object is not frozen or on error.
+
+ .. note::
+ If successive freezes were done, an equal number of
+ thaws will be required.
+
+ :see: :py:func:`freeze`
+
+ """
+ return elm_layout_thaw(self.obj)
+
property theme:
"""Set the edje group class, group name and style from the elementary
theme that will be used as layout.
@@ -114,7 +155,7 @@ cdef class LayoutClass(Object):
<const_char *>emission if emission is not None else NULL,
<const_char *>source if source is not None else NULL)
- #def signal_callback_add(self, emission, source, func, data):
+ def signal_callback_add(self, emission, source, func, *args, **kwargs):
"""Add a callback for a (Edje) signal emitted by a layout widget's
underlying Edje object.
@@ -132,10 +173,21 @@ cdef class LayoutClass(Object):
:type func: function
"""
- # TODO: remove _cfruni if implementing this
- #elm_layout_signal_callback_add(self.obj, _cfruni(emission),
_cfruni(source), Edje_Signal_Cb func, voiddata)
-
- #def signal_callback_del(self, emission, source, func):
+ if not callable(func):
+ raise TypeError("func is not callable.")
+
+ d = self._elm_layout_signal_cbs.setdefault(emission, {})
+ lst = d.setdefault(source, [])
+ if not lst:
+ if isinstance(emission, unicode): emission =
emission.encode("UTF-8")
+ if isinstance(source, unicode): source = source.encode("UTF-8")
+ elm_layout_signal_callback_add(self.obj,
+ <const_char *>emission if emission is not None else NULL,
+ <const_char *>source if source is not None else NULL,
+ layout_signal_callback, <void*>lst)
+ lst.append((func, args, kwargs))
+
+ def signal_callback_del(self, emission, source, func):
"""Remove a signal-triggered callback from a given layout widget.
This function removes the **last** callback attached to a signal
@@ -153,8 +205,35 @@ cdef class LayoutClass(Object):
:type func: function
"""
- # TODO: remove _cfruni if implementing this
- #elm_layout_signal_callback_del(self.obj, _cfruni(emission),
_cfruni(source), Edje_Signal_Cb func)
+ try:
+ d = self._elm_layout_signal_cbs[emission]
+ lst = d[source]
+ except KeyError:
+ raise ValueError(("function %s not associated with "
+ "emission %r, source %r") %
+ (func, emission, source))
+
+ i = -1
+ for i, (f, a, k) in enumerate(lst):
+ if func == f:
+ break
+ else:
+ raise ValueError(("function %s not associated with "
+ "emission %r, source %r") %
+ (func, emission, source))
+
+ lst.pop(i)
+ if lst:
+ return
+ d.pop(source)
+ if not d:
+ self._elm_layout_signal_cbs.pop(emission)
+ if isinstance(emission, unicode): emission = emission.encode("UTF-8")
+ if isinstance(source, unicode): source = source.encode("UTF-8")
+ elm_layout_signal_callback_del(self.obj,
+ <const_char *>emission if emission is not None else NULL,
+ <const_char *>source if source is not None else NULL,
+ layout_signal_callback)
def box_append(self, part, evasObject child):
"""box_append(unicode part, evas.Object child) -> bool
@@ -653,6 +732,28 @@ cdef class LayoutClass(Object):
return bool(elm_layout_part_cursor_engine_only_get(self.obj,
<const_char *>part_name if part_name is not None else NULL))
+ property edje_object_can_access:
+ """Set accessibility to all texblock(text) parts in the layout object
+
+ Makes it possible for all textblock(text) parts in the layout to have
+ accessibility.
+
+ :raise RuntimeError: if accessibility cannot be set.
+
+ """
+ def __set__(self, value):
+ self.edje_object_can_access_set(value)
+
+ def __get__(self):
+ return self.edje_object_can_access_get()
+
+ cpdef edje_object_can_access_set(self, bint can_access):
+ if not elm_layout_edje_object_can_access_set(self.obj, can_access):
+ raise RuntimeError("Could not set accessibility to layout
textblock parts.")
+
+ cpdef bint edje_object_can_access_get(self):
+ return elm_layout_edje_object_can_access_get(self.obj)
+
property icon:
"""The icon object in a layout that follows the Elementary naming
convention for its parts.
diff --git a/efl/elementary/object.pxd b/efl/elementary/object.pxd
index ee91002..314fe6b 100644
--- a/efl/elementary/object.pxd
+++ b/efl/elementary/object.pxd
@@ -17,7 +17,7 @@
from cpython cimport PyObject, Py_INCREF, Py_DECREF
from efl.evas cimport Eina_Bool, Eina_List, const_Eina_List, \
- Evas_Object, Evas_Smart_Cb, Evas_Coord
+ Evas_Object, const_Evas_Object, Evas_Smart_Cb, Evas_Coord
from efl.evas.enums cimport Evas_Callback_Type
from efl.evas cimport Object as evasObject
from efl.evas cimport Canvas as evasCanvas
@@ -73,10 +73,12 @@ cdef extern from "Elementary.h":
Evas_Object *elm_object_top_widget_get(Evas_Object *obj)
const_char * elm_object_widget_type_get(Evas_Object *obj)
void elm_object_signal_emit(Evas_Object *obj,
const_char *emission, const_char *source)
- # TODO: void elm_object_signal_callback_add(Evas_Object
*obj, const_char *emission, const_char *source, Edje_Signal_Cb func, void *data)
- # TODO: void * elm_object_signal_callback_del(Evas_Object
*obj, const_char *emission, const_char *source, Edje_Signal_Cb func)
+ void elm_object_signal_callback_add(Evas_Object *obj,
const_char *emission, const_char *source, Edje_Signal_Cb func, void *data)
+ void * elm_object_signal_callback_del(Evas_Object *obj,
const_char *emission, const_char *source, Edje_Signal_Cb func)
void elm_object_event_callback_add(Evas_Object *obj,
Elm_Event_Cb func, const_void *data)
void * elm_object_event_callback_del(Evas_Object *obj,
Elm_Event_Cb func, const_void *data)
+ void
elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+ Eina_Bool
elm_object_orientation_mode_disabled_get(const_Evas_Object *obj)
# Object - Cursors (elm_cursor.h) (py3: DONE)
void elm_object_cursor_set(Evas_Object *obj, const_char
*cursor)
@@ -98,6 +100,9 @@ cdef extern from "Elementary.h":
void elm_object_focus_custom_chain_append(Evas_Object
*obj, Evas_Object *child, Evas_Object *relative_child)
void elm_object_focus_custom_chain_prepend(Evas_Object
*obj, Evas_Object *child, Evas_Object *relative_child)
void elm_object_focus_next(Evas_Object *obj,
Elm_Focus_Direction direction)
+ Evas_Object * elm_object_focus_next_object_get(const_Evas_Object
*obj, Elm_Focus_Direction dir)
+ void elm_object_focus_next_object_set(Evas_Object *obj,
Evas_Object *next, Elm_Focus_Direction dir)
+ Evas_Object * elm_object_focused_object_get(const_Evas_Object
*obj)
void elm_object_tree_focus_allow_set(Evas_Object *obj,
Eina_Bool focusable)
Eina_Bool elm_object_tree_focus_allow_get(Evas_Object *obj)
@@ -114,8 +119,10 @@ cdef extern from "Elementary.h":
# Object - Scrollhints (elm_scroll.h)
void elm_object_scroll_hold_push(Evas_Object *obj)
void elm_object_scroll_hold_pop(Evas_Object *obj)
+ int elm_object_scroll_hold_get(const_Evas_Object *obj)
void elm_object_scroll_freeze_push(Evas_Object *obj)
void elm_object_scroll_freeze_pop(Evas_Object *obj)
+ int elm_object_scroll_freeze_get(const_Evas_Object
*obj)
void elm_object_scroll_lock_x_set(Evas_Object *obj,
Eina_Bool lock)
void elm_object_scroll_lock_y_set(Evas_Object *obj,
Eina_Bool lock)
Eina_Bool elm_object_scroll_lock_x_get(Evas_Object *obj)
@@ -162,6 +169,7 @@ cdef class Canvas(evasCanvas):
cdef class Object(evasObject):
cdef object _elmcallbacks
cdef object _elm_event_cbs
+ cdef object _elm_signal_cbs
cpdef text_set(self, text)
cpdef text_get(self)
@@ -174,3 +182,8 @@ cdef class Object(evasObject):
cpdef cursor_style_get(self)
cpdef tooltip_style_set(self, style=*)
cpdef tooltip_style_get(self)
+ cpdef orientation_mode_disabled_set(self, bint disabled)
+ cpdef bint orientation_mode_disabled_get(self)
+ cpdef focused_object_get(self)
+ cpdef int scroll_hold_get(self)
+ cpdef int scroll_freeze_get(self)
diff --git a/efl/elementary/object.pyx b/efl/elementary/object.pyx
index 2c3eaf4..363b592 100644
--- a/efl/elementary/object.pyx
+++ b/efl/elementary/object.pyx
@@ -279,6 +279,16 @@ cdef Eina_Bool _event_callback(void *data, Evas_Object *o,
Evas_Object *src, Eva
return ret
+cdef void signal_callback(void *data, Evas_Object *obj,
+ const_char *emission, const_char *source) with gil:
+ cdef Object self = object_from_instance(obj)
+ lst = tuple(<object>data)
+ for func, args, kargs in lst:
+ try:
+ func(self, _ctouni(emission), _ctouni(source), *args, **kargs)
+ except Exception, e:
+ traceback.print_exc()
+
# TODO: include "cnp_callbacks.pxi"
# TODO: Is this handled in Eo now?
@@ -594,11 +604,81 @@ cdef class Object(evasObject):
<const_char *>emission if emission is not None else NULL,
<const_char *>source if source is not None else NULL)
- #TODO: def signal_callback_add(self, emission, source, func, data):
- #elm_object_signal_callback_add(self.obj, emission, source, func, data)
+ def signal_callback_add(self, emission, source, func, *args, **kwargs):
+ """signal_callback_add(unicode emission, unicode source, func, *args,
**kwargs)
+
+ Add a callback for a signal emitted by widget edje object.
+
+ This function connects a callback function to a signal emitted by the
+ edje object of the obj.
+ Globs can occur in either the emission or source name.
+
+ :param emission: The signal's name.
+ :param source: The signal's source.
+ :param func: The callback function to be executed when the signal is
+ emitted.
+
+ """
+ if not callable(func):
+ raise TypeError("func is not callable.")
+
+ d = self._elm_signal_cbs.setdefault(emission, {})
+ lst = d.setdefault(source, [])
+ if not lst:
+ if isinstance(emission, unicode): emission =
emission.encode("UTF-8")
+ if isinstance(source, unicode): source = source.encode("UTF-8")
+ elm_object_signal_callback_add(self.obj,
+ <const_char *>emission if emission is not None else NULL,
+ <const_char *>source if source is not None else NULL,
+ signal_callback, <void*>lst)
+ lst.append((func, args, kwargs))
+
+ def signal_callback_del(self, emission, source, func):
+ """signal_callback_del(unicode emission, unicode source, func)
+
+ Remove a signal-triggered callback from a widget edje object.
+
+ :param emission: The signal's name.
+ :param source: The signal's source.
+ :param func: The callback function to be executed when the signal is
+ emitted.
- #TODO: def signal_callback_del(self, emission, source, func):
- #elm_object_signal_callback_del(self.obj, emission, source, func)
+ This function removes the **last** callback, previously attached to
+ a signal emitted by an underlying Edje object, whose
+ parameters *emission*, *source* and *func* match exactly with
+ those passed to a previous call to
+ :py:func:`signal_callback_add`.
+
+ """
+ try:
+ d = self._elm_signal_cbs[emission]
+ lst = d[source]
+ except KeyError:
+ raise ValueError(("function %s not associated with "
+ "emission %r, source %r") %
+ (func, emission, source))
+
+ i = -1
+ for i, (f, a, k) in enumerate(lst):
+ if func == f:
+ break
+ else:
+ raise ValueError(("function %s not associated with "
+ "emission %r, source %r") %
+ (func, emission, source))
+
+ lst.pop(i)
+ if lst:
+ return
+ d.pop(source)
+ if not d:
+ self._elm_signal_cbs.pop(emission)
+ if isinstance(emission, unicode): emission = emission.encode("UTF-8")
+ if isinstance(source, unicode): source = source.encode("UTF-8")
+ elm_object_signal_callback_del(self.obj,
+ <const_char *>emission if emission is not None else NULL,
+ <const_char *>source if source is not None else NULL,
+ signal_callback)
# NOTE: name clash with evas event_callback_*
def elm_event_callback_add(self, func, *args, **kargs):
@@ -687,6 +767,34 @@ cdef class Object(evasObject):
if not self._elm_event_cbs:
elm_object_event_callback_del(self.obj, _event_callback, NULL)
+
+ property orientation_mode_disabled:
+ """For disabling the orientation mode.
+
+ Orientation mode is used by widgets to change their styles or to send
+ signals whenever their window orientation is changed. If the
orientation
+ mode is enabled and the widget has different looks and styles for a
+ window orientation (0, 90, 180, 270), it will apply a style that has
+ been prepared for the new orientation, otherwise, it will send
+ signals to its own edje to change its states.
+
+ :type: bool
+
+ :since: 1.8
+
+ """
+ def __set__(self, value):
+ self.orientation_mode_disabled_set(value)
+
+ def __get__(self):
+ return self.orientation_mode_disabled_get()
+
+ cpdef orientation_mode_disabled_set(self, bint disabled):
+ elm_object_orientation_mode_disabled_set(self.obj, disabled)
+
+ cpdef bint orientation_mode_disabled_get(self):
+ return elm_object_orientation_mode_disabled_get(self.obj)
+
# Cursors
property cursor:
"""The cursor to be shown when mouse is over the object
@@ -864,7 +972,7 @@ cdef class Object(evasObject):
rel = relative_child.obj
elm_object_focus_custom_chain_prepend(self.obj, child.obj, rel)
- def focus_next(self, direction):
+ def focus_next(self, Elm_Focus_Direction direction):
"""Give focus to next object in object tree.
Give focus to next object in focus chain of one object sub-tree. If
@@ -872,11 +980,62 @@ cdef class Object(evasObject):
first object of chain.
:param dir: Direction to move the focus
- :type dir: Elm_Focus_Direction
+ :type dir: :ref:`Focus direction <Elm_Focus_Direction>`
"""
elm_object_focus_next(self.obj, direction)
+ def focus_next_object_get(self, Elm_Focus_Direction direction):
+ """Get next object which was set with specific focus direction.
+
+ Get next object which was set by elm_object_focus_next_object_set
+ with specific focus direction.
+
+ :param dir: Focus direction
+ :type dir: :ref:`Focus direction <Elm_Focus_Direction>`
+ :return: Focus next object or None, if there is no focus next object.
+
+ :see: :py:func:`focus_next`
+
+ :since: 1.8
+
+ """
+ return object_from_instance(elm_object_focus_next_object_get(self.obj,
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
+ :param dir: Focus direction
+ :type dir: :ref:`Focus direction <Elm_Focus_Direction>`
+
+ :see: :py:func:`focus_next`
+
+ :since: 1.8
+
+ """
+ elm_object_focus_next_object_set(self.obj, next.obj, direction)
+
+ property focused_object:
+ """The focused object in an object tree.
+
+ :return: Current focused or None, if there is no focused object.
+
+ :since: 1.8
+
+ """
+ def __get__(self):
+ return self.focused_object_get()
+
+ cpdef focused_object_get(self):
+ return object_from_instance(elm_object_focused_object_get(self.obj))
+
+
property tree_focus_allow:
"""Whether the Elementary object and its children are focusable
or not.
@@ -979,6 +1138,18 @@ cdef class Object(evasObject):
"""
elm_object_scroll_hold_pop(self.obj)
+ property scroll_hold:
+ """The scroll hold count.
+
+ :type: int
+
+ """
+ def __get__(self):
+ return self.scroll_hold_get()
+
+ cpdef int scroll_hold_get(self):
+ return elm_object_scroll_hold_get(self.obj)
+
def scroll_freeze_push(self):
"""scroll_freeze_push()
@@ -1001,6 +1172,18 @@ cdef class Object(evasObject):
"""
elm_object_scroll_freeze_pop(self.obj)
+ property scroll_freeze:
+ """The scroll freeze count.
+
+ :type: int
+
+ """
+ def __get__(self):
+ return self.scroll_freeze_get()
+
+ cpdef int scroll_freeze_get(self):
+ return elm_object_scroll_freeze_get(self.obj)
+
property scroll_lock_x:
def __get__(self):
return bool(elm_object_scroll_lock_x_get(self.obj))
@@ -1480,7 +1663,7 @@ cdef class Object(evasObject):
# :raise RuntimeError: if removing drop status fails.
- # @since 1.8
+ # :since: 1.8
# """
# if not elm_drop_target_del(self.obj):
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter