summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2014-05-17 18:30:14 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2014-05-17 18:30:14 +0300
commit2788035e888025030f5670e3eec449b6d9702473 (patch)
tree6b200c9040248e8e903e764b071e5afea564a0b9
parent0e7855a2f2dd4cb62d706ef857d836a68691b8a6 (diff)
Elementary.object_item: Add missing API
-rw-r--r--efl/elementary/object_item.pxd6
-rw-r--r--efl/elementary/object_item.pyx93
2 files changed, 98 insertions, 1 deletions
diff --git a/efl/elementary/object_item.pxd b/efl/elementary/object_item.pxd
index b013879..539bb58 100644
--- a/efl/elementary/object_item.pxd
+++ b/efl/elementary/object_item.pxd
@@ -55,6 +55,12 @@ cdef extern from "Elementary.h":
55 #TODO: const Eina_List *elm_object_item_access_order_get(const Elm_Object_Item *item) 55 #TODO: const Eina_List *elm_object_item_access_order_get(const Elm_Object_Item *item)
56 #TODO: void elm_object_item_access_order_unset(Elm_Object_Item *item) 56 #TODO: void elm_object_item_access_order_unset(Elm_Object_Item *item)
57 57
58 Evas_Object * elm_object_item_track(Elm_Object_Item *it)
59 void elm_object_item_untrack(Elm_Object_Item *it)
60 int elm_object_item_track_get(const Elm_Object_Item *it)
61 void elm_object_item_style_set(Elm_Object_Item *it, const char *part)
62 const char * elm_object_item_style_get(Elm_Object_Item *it)
63
58 64
59 65
60cdef _object_item_to_python(Elm_Object_Item *it) 66cdef _object_item_to_python(Elm_Object_Item *it)
diff --git a/efl/elementary/object_item.pyx b/efl/elementary/object_item.pyx
index affef3c..ab1e4c1 100644
--- a/efl/elementary/object_item.pyx
+++ b/efl/elementary/object_item.pyx
@@ -626,7 +626,7 @@ cdef class ObjectItem(object):
626 def focus_get(self): 626 def focus_get(self):
627 return elm_object_item_focus_get(self.item) 627 return elm_object_item_focus_get(self.item)
628 628
629 629
630 # TODO: Accessibility 630 # TODO: Accessibility
631 # def access_unregister(self): 631 # def access_unregister(self):
632 # """Unregister accessible object of the object item. 632 # """Unregister accessible object of the object item.
@@ -664,3 +664,94 @@ cdef class ObjectItem(object):
664 # def __del__(self): 664 # def __del__(self):
665 # elm_object_item_access_order_unset(self.item) 665 # elm_object_item_access_order_unset(self.item)
666 666
667
668 property track:
669 """The track object of the item.
670
671 .. note::
672
673 This returns a rectangle object that represents the object items
674 internal object. If you wish to, for example, get the geometry or
675 visibility of the item you can use Evas API properties of the track
676 object such as :py:attr:`~efl.evas.Object.geometry` or
677 :py:attr:`~efl.evas.Object.visible`. Note that the widget items
678 may, or may not, actually have an internal object so this API will
679 return None if the tracking object doesn't exist. Additionally, the
680 widget item is managed/controlled by the widget, which means the
681 widget item may be changed (moved, resized even deleted) anytime by
682 its own widget. Do not attempt to change the track object, and
683 don't keep around a reference to the track object unless it's
684 really required, instead get the track object at the moment you
685 need to refer to it. Otherwise you need to add some callbacks to
686 the track object to track its attributes' changes.
687
688 .. warning::
689
690 After use the track object, please call ``del item.track`` to free
691 the track object properly. **Don't call ``obj.delete()`` on the
692 track object.**
693
694 .. versionadded:: 1.10
695
696 """
697 def __get__(self):
698 return object_from_instance(elm_object_item_track(self.item))
699
700 def __del__(self):
701 elm_object_item_untrack(self.item)
702
703 def track(self):
704 """Same as ``item.track``"""
705 return object_from_instance(elm_object_item_track(self.item))
706
707 def untrack(self):
708 """Same as ``del item.track``"""
709 elm_object_item_untrack(self.item)
710
711 property track_count:
712 """The track object reference count.
713
714 .. note::
715
716 This gets the reference count for the track object. Whenever you
717 get the tracking object with :py:attr:`track` the reference count
718 is increased by one. Likewise the reference count is decreased when
719 you call ``del item.track``. Unless the reference count reaches
720 zero the track object won't be deleted so please make sure to call
721 ``del item.track`` as many times as :py:attr:`track`.
722
723 .. versionadded:: 1.10
724
725 """
726 def __get__(self):
727 return elm_object_item_track_get(self.item)
728
729 def track_get(self):
730 """Same as ``item.track_count``"""
731 return elm_object_item_track_get(self.item)
732
733 property style:
734 """The style of an object item.
735
736 :type: string
737
738 .. versionadded:: 1.10
739
740 """
741 def __set__(self, style):
742 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
743 elm_object_item_style_set(self.item,
744 <const char *>style if style is not None else NULL
745 )
746
747 def __get__(self):
748 return _ctouni(elm_object_item_style_get(self.item))
749
750 def style_set(self, style):
751 if isinstance(style, unicode): style = PyUnicode_AsUTF8String(style)
752 elm_object_item_style_set(self.item,
753 <const char *>style if style is not None else NULL
754 )
755
756 def style_get(self):
757 return _ctouni(elm_object_item_style_get(self.item))