From: Enlightenment S. <no-...@en...> - 2012-04-10 09:12:14
|
Log: BINDINGS/python entry: Fixed "anchor,clicked" callback NULL event_info issue. Patch by Kai Huuko <kai...@gm...> It looks ok to me but I want efl-python guys to review this. But there are a lot to fix up in python-bindings yet. On Mon, Apr 9, 2012 at 5:43 AM, Kai Huuhko <kai...@gm...> wrote: > Attached is a patch which makes the callback receive event_info with a > conversion function. I used the old AnchorBlock widget as reference. It > still doesn't open Hover, should this be done in the conversion code? > Author: seoz Date: 2012-04-10 02:12:05 -0700 (Tue, 10 Apr 2012) New Revision: 69988 Trac: http://trac.enlightenment.org/e/changeset/69988 Modified: trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd Modified: trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi =================================================================== --- trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi 2012-04-10 08:08:40 UTC (rev 69987) +++ trunk/BINDINGS/python/python-elementary/elementary/elementary.c_elementary_entry.pxi 2012-04-10 09:12:05 UTC (rev 69988) @@ -30,7 +30,26 @@ return None return string +class EntryAnchorInfo: + def __init__(self): + self.name = None + self.button = 0 + self.x = 0 + self.y = 0 + self.w = 0 + self.h = 0 +def _entryanchor_conv(long addr): + cdef Elm_Entry_Anchor_Info *ei = <Elm_Entry_Anchor_Info *>addr + eai = EntryAnchorInfo() + eai.name = ei.name + eai.button = ei.button + eai.x = ei.x + eai.y = ei.y + eai.w = ei.w + eai.h = ei.h + return eai + cdef class Entry(Object): def __init__(self, c_evas.Object parent): Object.__init__(self, parent.evas) @@ -91,10 +110,12 @@ self._callback_del("cursor,changed", func) def callback_anchor_clicked_add(self, func, *args, **kwargs): - self._callback_add("anchor,clicked", func, *args, **kwargs) + self._callback_add_full("anchor,clicked", _entryanchor_conv, + func, *args, **kwargs) def callback_anchor_clicked_del(self, func): - self._callback_del("anchor,clicked", func) + self._callback_del_full("anchor,clicked", _entryanchor_conv, + func) def callback_activated_add(self, func, *args, **kwargs): self._callback_add("activated", func, *args, **kwargs) Modified: trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd =================================================================== --- trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd 2012-04-10 08:08:40 UTC (rev 69987) +++ trunk/BINDINGS/python/python-elementary/include/elementary/c_elementary.pxd 2012-04-10 09:12:05 UTC (rev 69988) @@ -181,7 +181,13 @@ ELM_BUBBLE_POS_BOTTOM_LEFT ELM_BUBBLE_POS_BOTTOM_RIGHT - ctypedef struct Elm_Entry_Anchor_Info + ctypedef struct Elm_Entry_Anchor_Info: + char *name + int button + evas.c_evas.Evas_Coord x + evas.c_evas.Evas_Coord y + evas.c_evas.Evas_Coord w + evas.c_evas.Evas_Coord h ctypedef char *(*GenlistItemLabelGetFunc)(void *data, evas.c_evas.Evas_Object *obj, const_char_ptr part) ctypedef evas.c_evas.Evas_Object *(*GenlistItemIconGetFunc)(void *data, evas.c_evas.Evas_Object *obj, const_char_ptr part) |