diff options
author | Kai Huuhko <kai.huuhko@gmail.com> | 2014-07-01 20:39:09 +0300 |
---|---|---|
committer | Kai Huuhko <kai.huuhko@gmail.com> | 2014-07-01 20:41:47 +0300 |
commit | bb77d08ed9e7e44ec06933ab2283dea944573939 (patch) | |
tree | 0169ca4bfbe5f2d595345985aa6f8e395ca9a846 | |
parent | 2a303f29e18513aad046d607873babcf397429d3 (diff) |
Elementary: Fix object item tooltips
It would be an ABI breakage if the tooltips had ever worked in
the first place but apparently they never did.
-rw-r--r-- | efl/elementary/gengrid_item.pxi | 14 | ||||
-rw-r--r-- | efl/elementary/genlist_item.pxi | 13 | ||||
-rw-r--r-- | efl/elementary/object_item.pyx | 13 | ||||
-rw-r--r-- | efl/elementary/tooltips.pxi | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/efl/elementary/gengrid_item.pxi b/efl/elementary/gengrid_item.pxi index bc9013f..a535bf5 100644 --- a/efl/elementary/gengrid_item.pxi +++ b/efl/elementary/gengrid_item.pxi | |||
@@ -319,11 +319,11 @@ cdef class GengridItem(ObjectItem): | |||
319 | def tooltip_content_cb_set(self, func, *args, **kargs): | 319 | def tooltip_content_cb_set(self, func, *args, **kargs): |
320 | """Set the content to be shown in the tooltip object | 320 | """Set the content to be shown in the tooltip object |
321 | 321 | ||
322 | Setup the tooltip to object. The object can have only one tooltip, | 322 | Setup the tooltip to object. The object can have only one tooltip, so |
323 | so any previews tooltip data is removed. ``func(args, kargs)`` will | 323 | any previews tooltip data is removed. ``func(owner, item, tooltip, |
324 | be called every time that need show the tooltip and it should return a | 324 | args, kargs)`` will be called every time that need show the tooltip and |
325 | valid Evas_Object. This object is then managed fully by tooltip system | 325 | it should return a valid Evas_Object. This object is then managed fully |
326 | and is deleted when the tooltip is gone. | 326 | by tooltip system and is deleted when the tooltip is gone. |
327 | 327 | ||
328 | :param func: Function to be create tooltip content, called when | 328 | :param func: Function to be create tooltip content, called when |
329 | need show tooltip. | 329 | need show tooltip. |
@@ -334,9 +334,9 @@ cdef class GengridItem(ObjectItem): | |||
334 | 334 | ||
335 | cdef void *cbdata | 335 | cdef void *cbdata |
336 | 336 | ||
337 | data = (func, self, args, kargs) | 337 | data = (func, args, kargs) |
338 | Py_INCREF(data) | 338 | Py_INCREF(data) |
339 | # FIXME: refleak? | 339 | # DECREF is in data_del_cb |
340 | cbdata = <void *>data | 340 | cbdata = <void *>data |
341 | elm_gengrid_item_tooltip_content_cb_set(self.item, | 341 | elm_gengrid_item_tooltip_content_cb_set(self.item, |
342 | _tooltip_item_content_create, | 342 | _tooltip_item_content_create, |
diff --git a/efl/elementary/genlist_item.pxi b/efl/elementary/genlist_item.pxi index 96daebe..a5f84cc 100644 --- a/efl/elementary/genlist_item.pxi +++ b/efl/elementary/genlist_item.pxi | |||
@@ -399,11 +399,11 @@ cdef class GenlistItem(ObjectItem): | |||
399 | def tooltip_content_cb_set(self, func, *args, **kargs): | 399 | def tooltip_content_cb_set(self, func, *args, **kargs): |
400 | """Set the content to be shown in the tooltip object | 400 | """Set the content to be shown in the tooltip object |
401 | 401 | ||
402 | Setup the tooltip to object. The object can have only one tooltip, | 402 | Setup the tooltip to object. The object can have only one tooltip, so |
403 | so any previews tooltip data is removed. ``func(args,kargs)`` will | 403 | any previews tooltip data is removed. ``func(owner, item, tooltip, |
404 | be called every time that need show the tooltip and it should return | 404 | args, kargs)`` will be called every time that need show the tooltip and |
405 | a valid Evas_Object. This object is then managed fully by tooltip | 405 | it should return a valid Evas_Object. This object is then managed fully |
406 | system and is deleted when the tooltip is gone. | 406 | by tooltip system and is deleted when the tooltip is gone. |
407 | 407 | ||
408 | :param func: Function to be create tooltip content, called when | 408 | :param func: Function to be create tooltip content, called when |
409 | need show tooltip. | 409 | need show tooltip. |
@@ -414,8 +414,9 @@ cdef class GenlistItem(ObjectItem): | |||
414 | 414 | ||
415 | cdef void *cbdata | 415 | cdef void *cbdata |
416 | 416 | ||
417 | data = (func, self, args, kargs) | 417 | data = (func, args, kargs) |
418 | Py_INCREF(data) | 418 | Py_INCREF(data) |
419 | # DECREF is in data_del_cb | ||
419 | cbdata = <void *>data | 420 | cbdata = <void *>data |
420 | elm_genlist_item_tooltip_content_cb_set(self.item, | 421 | elm_genlist_item_tooltip_content_cb_set(self.item, |
421 | _tooltip_item_content_create, | 422 | _tooltip_item_content_create, |
diff --git a/efl/elementary/object_item.pyx b/efl/elementary/object_item.pyx index 02e8a31..1e81dd6 100644 --- a/efl/elementary/object_item.pyx +++ b/efl/elementary/object_item.pyx | |||
@@ -477,12 +477,11 @@ cdef class ObjectItem(object): | |||
477 | def tooltip_content_cb_set(self, func, *args, **kargs): | 477 | def tooltip_content_cb_set(self, func, *args, **kargs): |
478 | """Set the content to be shown in the tooltip object | 478 | """Set the content to be shown in the tooltip object |
479 | 479 | ||
480 | Setup the tooltip to object. The object can have only one tooltip, | 480 | Setup the tooltip to object. The object can have only one tooltip, so |
481 | so any previews tooltip data is removed. ``func(owner, tooltip, | 481 | any previews tooltip data is removed. ``func(owner, item, tooltip, |
482 | args, kargs)`` will be called every time that need show the tooltip | 482 | args, kargs)`` will be called every time that need show the tooltip and |
483 | and it should return a valid Evas_Object. This object is then | 483 | it should return a valid Evas_Object. This object is then managed fully |
484 | managed fully by tooltip system and is deleted when the tooltip is | 484 | by tooltip system and is deleted when the tooltip is gone. |
485 | gone. | ||
486 | 485 | ||
487 | :param func: Function to be create tooltip content, called when | 486 | :param func: Function to be create tooltip content, called when |
488 | need show tooltip. | 487 | need show tooltip. |
@@ -495,8 +494,8 @@ cdef class ObjectItem(object): | |||
495 | cdef void *cbdata | 494 | cdef void *cbdata |
496 | 495 | ||
497 | data = (func, args, kargs) | 496 | data = (func, args, kargs) |
498 | # FIXME: refleak | ||
499 | Py_INCREF(data) | 497 | Py_INCREF(data) |
498 | # DECREF is in data_del_cb | ||
500 | cbdata = <void *>data | 499 | cbdata = <void *>data |
501 | elm_object_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create, | 500 | elm_object_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create, |
502 | cbdata, _tooltip_item_data_del_cb) | 501 | cbdata, _tooltip_item_data_del_cb) |
diff --git a/efl/elementary/tooltips.pxi b/efl/elementary/tooltips.pxi index 50f9947..ea57ed0 100644 --- a/efl/elementary/tooltips.pxi +++ b/efl/elementary/tooltips.pxi | |||
@@ -42,7 +42,7 @@ cdef Evas_Object *_tooltip_item_content_create(void *data, Evas_Object *o, Evas_ | |||
42 | tooltip = object_from_instance(t) | 42 | tooltip = object_from_instance(t) |
43 | item = _object_item_to_python(<Elm_Object_Item *>it) | 43 | item = _object_item_to_python(<Elm_Object_Item *>it) |
44 | (func, args, kargs) = <object>data | 44 | (func, args, kargs) = <object>data |
45 | ret = func(obj, item, *args, **kargs) | 45 | ret = func(obj, item, tooltip, *args, **kargs) |
46 | if not ret: | 46 | if not ret: |
47 | return NULL | 47 | return NULL |
48 | return ret.obj | 48 | return ret.obj |