python-efl: Consolidate elm cb conversions.

SVN revision: 84309
This commit is contained in:
Kai Huuhko 2013-02-22 12:00:26 +00:00
parent 8573629c83
commit e8a1b68b79
20 changed files with 30 additions and 51 deletions

View File

@ -44,7 +44,7 @@
"""
include "widget_header.pxi"
include "callbacks.pxi"
include "callback_conversions.pxi"
from layout_class cimport LayoutClass

View File

@ -0,0 +1,11 @@
from libc.string cimport const_char
from object_item cimport Elm_Object_Item
from object_item cimport _object_item_to_python
def _cb_string_conv(long addr):
cdef const_char *s = <const_char *>addr
return _ctouni(s) if s is not NULL else None
def _cb_object_item_conv(long addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)

View File

@ -1,26 +0,0 @@
# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
#
# This file is part of python-elementary.
#
# 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-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.
#
# 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/>.
#
from efl.eo cimport const_char_ptr
def _cb_string_conv(long addr):
cdef const_char_ptr s = <const_char_ptr>addr
if s == NULL:
return None
else:
return s

View File

@ -35,8 +35,9 @@
"""
include "widget_header.pxi"
include "callback_conversions.pxi"
from object_item cimport ObjectItem
from object_item import _cb_object_item_conv
from layout_class cimport LayoutClass
cimport enums

View File

@ -16,9 +16,10 @@
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
include "widget_header.pxi"
include "callback_conversions.pxi"
from object cimport Object
from object_item cimport ObjectItem, _object_item_callback, _object_item_to_python
from object_item import _cb_object_item_conv
from scroller cimport *
cdef class DiskselectorItem(ObjectItem):

View File

@ -31,7 +31,7 @@
"""
include "widget_header.pxi"
include "callbacks.pxi"
include "callback_conversions.pxi"
from layout_class cimport LayoutClass

View File

@ -31,7 +31,7 @@
"""
include "widget_header.pxi"
include "callbacks.pxi"
include "callback_conversions.pxi"
cimport enums

View File

@ -31,7 +31,7 @@
"""
include "widget_header.pxi"
include "callbacks.pxi"
include "callback_conversions.pxi"
from object cimport Object

View File

@ -17,7 +17,7 @@
#
include "widget_header.pxi"
include "callbacks.pxi"
include "callback_conversions.pxi"
from object cimport Object
from object_item cimport _object_item_to_python, _object_item_callback, _object_item_list_to_python

View File

@ -39,6 +39,7 @@
"""
include "widget_header.pxi"
include "callback_conversions.pxi"
include "tooltips.pxi"
from object cimport Object
@ -47,7 +48,6 @@ from object_item cimport ObjectItem, \
elm_object_item_widget_get, \
_object_item_from_python, \
_object_item_list_to_python
from object_item import _cb_object_item_conv
from general cimport strdup
from scroller cimport *
cimport enums

View File

@ -146,6 +146,7 @@
"""
include "widget_header.pxi"
include "callback_conversions.pxi"
include "tooltips.pxi"
from object_item cimport ObjectItem, \
_object_item_to_python, \
@ -153,7 +154,6 @@ from object_item cimport ObjectItem, \
_object_item_from_python, \
_object_item_list_to_python, \
elm_object_item_data_get
from object_item import _cb_object_item_conv
from general cimport strdup
from efl.evas cimport eina_list_remove_list
from scroller cimport *

View File

@ -32,8 +32,9 @@
"""
include "widget_header.pxi"
include "callback_conversions.pxi"
from object_item cimport _object_item_callback, _object_item_list_to_python
from object_item import _cb_object_item_conv
cimport enums

View File

@ -55,7 +55,7 @@
"""
include "widget_header.pxi"
include "callbacks.pxi"
include "callback_conversions.pxi"
cimport enums

View File

@ -16,11 +16,11 @@
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
include "widget_header.pxi"
include "callback_conversions.pxi"
from layout_class cimport LayoutClass
from object_item cimport _object_item_callback, _object_item_to_python
from object_item import _cb_object_item_conv
cdef enum Elm_Index_Item_Insert_Kind:
ELM_INDEX_ITEM_INSERT_APPEND

View File

@ -93,12 +93,12 @@
"""
include "widget_header.pxi"
include "callback_conversions.pxi"
from object cimport Object
from object_item cimport _object_item_callback, \
_object_item_to_python, \
_object_item_list_to_python
from object_item import _cb_object_item_conv
from scroller cimport *
cimport enums

View File

@ -92,7 +92,6 @@ cdef Eina_Bool _event_dispatcher(o, src, Evas_Callback_Type t, event_info):
return True
return False
#TODO: More event types
cdef Eina_Bool _event_callback(void *data, Evas_Object *o, Evas_Object *src, Evas_Callback_Type t, void *event_info) with gil:
cdef Object obj = object_from_instance(o)
cdef Object src_obj = object_from_instance(src)
@ -123,10 +122,6 @@ cdef void _event_data_del_cb(void *data, Evas_Object *o, void *event_info) with
# Py_DECREF(<object>data)
def _cb_string_conv(long addr):
cdef const_char_ptr s = <const_char_ptr>addr
return s if s is not NULL else None
cdef _object_list_to_python(const_Eina_List *lst):
cdef Evas_Object *o
ret = []

View File

@ -27,10 +27,6 @@ import traceback
cdef class ObjectItem
def _cb_object_item_conv(long addr):
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
return _object_item_to_python(it)
cdef Elm_Object_Item * _object_item_from_python(ObjectItem item) except NULL:
if item is None or item.item is NULL:
raise TypeError("Invalid item!")

View File

@ -16,11 +16,11 @@
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
include "widget_header.pxi"
include "callback_conversions.pxi"
from layout_class cimport LayoutClass
from object_item cimport _object_item_to_python
from object_item import _cb_object_item_conv
cdef class SegmentControlItem(ObjectItem):

View File

@ -17,6 +17,7 @@
#
include "widget_header.pxi"
include "callback_conversions.pxi"
include "conversions.pxi"
from layout_class cimport LayoutClass
@ -24,7 +25,6 @@ from layout_class cimport LayoutClass
import traceback
from object_item cimport _object_item_to_python, \
_object_item_list_to_python
from object_item import _cb_object_item_conv
cdef _py_elm_slideshow_item_call(func, Evas_Object *obj, data) with gil:
try:

View File

@ -66,7 +66,7 @@ include "widget_header.pxi"
from object cimport Object
include "conversions.pxi"
include "callbacks.pxi"
include "callback_conversions.pxi"
import traceback
cimport enums