summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-05-04 12:09:20 +0200
committerdavemds <dave@gurumeditation.it>2014-05-04 12:09:20 +0200
commit8b9e5901a37763f5166c11925193289c9e7007b8 (patch)
tree3eac69d3ec4fa56344f4689dc14efcbf39543423
parentbc322297563764c0d09f1cbc81a988d0a34268dd (diff)
New item,focused/unfocused signals for the List widget
Plus: * Object.focused_item * ObjectItem.focus
-rw-r--r--efl/elementary/list.pyx23
-rw-r--r--efl/elementary/object.pxd3
-rw-r--r--efl/elementary/object.pyx15
-rw-r--r--efl/elementary/object_item.pxd3
-rw-r--r--efl/elementary/object_item.pyx18
5 files changed, 62 insertions, 0 deletions
diff --git a/efl/elementary/list.pyx b/efl/elementary/list.pyx
index 4441b1d..35a6fad 100644
--- a/efl/elementary/list.pyx
+++ b/efl/elementary/list.pyx
@@ -56,6 +56,8 @@ Smart callbacks one can listen to:
56- ``language,changed`` - the program's language changed 56- ``language,changed`` - the program's language changed
57- ``focused`` - When the list has received focus. (since 1.8) 57- ``focused`` - When the list has received focus. (since 1.8)
58- ``unfocused`` - When the list has lost focus. (since 1.8) 58- ``unfocused`` - When the list has lost focus. (since 1.8)
59- ``item,focused`` - When the list item has received focus. (since 1.10)
60- ``item,unfocused`` - When the list item has lost focus. (since 1.10)
59 61
60Available styles for it: 62Available styles for it:
61 63
@@ -1074,6 +1076,27 @@ cdef class List(Object):
1074 def callback_unfocused_del(self, func): 1076 def callback_unfocused_del(self, func):
1075 self._callback_del("unfocused", func) 1077 self._callback_del("unfocused", func)
1076 1078
1079 def callback_item_focused_add(self, func, *args, **kwargs):
1080 """When the list item has received focus.
1081
1082 .. versionadded:: 1.10
1083
1084 """
1085 self._callback_add_full("item,focused", _cb_object_item_conv, func, *args, **kwargs)
1086
1087 def callback_item_focused_del(self, func):
1088 self._callback_del_full("item,focused", _cb_object_item_conv, func)
1089
1090 def callback_item_unfocused_add(self, func, *args, **kwargs):
1091 """When the list item has lost focus.
1092
1093 .. versionadded:: 1.10
1094
1095 """
1096 self._callback_add_full("item,unfocused", _cb_object_item_conv, func, *args, **kwargs)
1097
1098 def callback_item_unfocused_del(self, func):
1099 self._callback_del_full("item,unfocused", _cb_object_item_conv, func)
1077 1100
1078 property scroller_policy: 1101 property scroller_policy:
1079 """ 1102 """
diff --git a/efl/elementary/object.pxd b/efl/elementary/object.pxd
index 473d38a..b54e7dd 100644
--- a/efl/elementary/object.pxd
+++ b/efl/elementary/object.pxd
@@ -29,6 +29,8 @@ cdef extern from "Edje.h":
29cdef extern from "Elementary.h": 29cdef extern from "Elementary.h":
30 ctypedef struct Elm_Theme 30 ctypedef struct Elm_Theme
31 31
32 ctypedef struct Elm_Object_Item
33
32 ctypedef struct Elm_Selection_Data: 34 ctypedef struct Elm_Selection_Data:
33 Evas_Coord x, y 35 Evas_Coord x, y
34 Elm_Sel_Format format 36 Elm_Sel_Format format
@@ -103,6 +105,7 @@ cdef extern from "Elementary.h":
103 Eina_Bool elm_object_tree_focus_allow_get(const Evas_Object *obj) 105 Eina_Bool elm_object_tree_focus_allow_get(const Evas_Object *obj)
104 Eina_Bool elm_object_focus_highlight_style_set(Evas_Object *obj, const char *style) 106 Eina_Bool elm_object_focus_highlight_style_set(Evas_Object *obj, const char *style)
105 const char * elm_object_focus_highlight_style_get(const Evas_Object *obj) 107 const char * elm_object_focus_highlight_style_get(const Evas_Object *obj)
108 Elm_Object_Item * elm_object_focused_item_get(const Evas_Object *obj)
106 109
107 # Object - Mirroring (elm_mirroring.h) 110 # Object - Mirroring (elm_mirroring.h)
108 Eina_Bool elm_object_mirrored_get(const Evas_Object *obj) 111 Eina_Bool elm_object_mirrored_get(const Evas_Object *obj)
diff --git a/efl/elementary/object.pyx b/efl/elementary/object.pyx
index 92b3090..8ceca49 100644
--- a/efl/elementary/object.pyx
+++ b/efl/elementary/object.pyx
@@ -1122,6 +1122,21 @@ cdef class Object(evasObject):
1122 def focused_object_get(self): 1122 def focused_object_get(self):
1123 return object_from_instance(elm_object_focused_object_get(self.obj)) 1123 return object_from_instance(elm_object_focused_object_get(self.obj))
1124 1124
1125 property focused_item:
1126 """The focused object item in an object tree.
1127
1128 :return: Current focused item or None, if there is no focused item.
1129
1130 .. versionadded:: 1.10
1131
1132 """
1133 def __get__(self):
1134 return _object_item_to_python(elm_object_focused_item_get(self.obj))
1135
1136 def focused_item_get(self):
1137 return _object_item_to_python(elm_object_focused_item_get(self.obj))
1138
1139
1125 property focus_highlight_style: 1140 property focus_highlight_style:
1126 """The focus highlight style name to be used. 1141 """The focus highlight style name to be used.
1127 1142
diff --git a/efl/elementary/object_item.pxd b/efl/elementary/object_item.pxd
index c4fe57a..b013879 100644
--- a/efl/elementary/object_item.pxd
+++ b/efl/elementary/object_item.pxd
@@ -44,6 +44,9 @@ cdef extern from "Elementary.h":
44 const char * elm_object_item_cursor_style_get(const Elm_Object_Item *it) 44 const char * elm_object_item_cursor_style_get(const Elm_Object_Item *it)
45 void elm_object_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only) 45 void elm_object_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only)
46 Eina_Bool elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it) 46 Eina_Bool elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it)
47 void elm_object_item_focus_set(Elm_Object_Item *it, Eina_Bool focused)
48 Eina_Bool elm_object_item_focus_get(const Elm_Object_Item *it)
49
47 50
48 #TODO: Evas_Object * elm_object_item_access_register(Elm_Object_Item *item) 51 #TODO: Evas_Object * elm_object_item_access_register(Elm_Object_Item *item)
49 #TODO: void elm_object_item_access_unregister(Elm_Object_Item *item) 52 #TODO: void elm_object_item_access_unregister(Elm_Object_Item *item)
diff --git a/efl/elementary/object_item.pyx b/efl/elementary/object_item.pyx
index 1185a5e..affef3c 100644
--- a/efl/elementary/object_item.pyx
+++ b/efl/elementary/object_item.pyx
@@ -609,6 +609,24 @@ cdef class ObjectItem(object):
609 def cursor_engine_only_get(self): 609 def cursor_engine_only_get(self):
610 return elm_object_item_cursor_engine_only_get(self.item) 610 return elm_object_item_cursor_engine_only_get(self.item)
611 611
612 property focus:
613 """Whether the item is focused or not.
614
615 .. versionadded:: 1.10
616
617 """
618 def __set__(self, focused):
619 elm_object_item_focus_set(self.item, bool(focused))
620
621 def __get__(self):
622 return elm_object_item_focus_get(self.item)
623
624 def focus_set(self, focused):
625 elm_object_item_focus_set(self.item, bool(focused))
626 def focus_get(self):
627 return elm_object_item_focus_get(self.item)
628
629
612 # TODO: Accessibility 630 # TODO: Accessibility
613 # def access_unregister(self): 631 # def access_unregister(self):
614 # """Unregister accessible object of the object item. 632 # """Unregister accessible object of the object item.