summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-08-16 12:33:29 +0200
committerdavemds <dave@gurumeditation.it>2014-08-16 12:33:29 +0200
commit9a78c4e22d8e0483749aa2093c29a28a181a3838 (patch)
tree95362d8bf6a5cf032fad5bcd40698a112850d4b9
parent042dc0f835b37811babb75b32d2874cf340e78ec (diff)
Expose object_from_instance and the inverse to other C code
This create the efl.eo_api.h file that you can copy to your source if you want to use the exported api
-rw-r--r--efl/eo/efl.eo.pyx6
-rw-r--r--include/efl.eo.pxd5
2 files changed, 9 insertions, 2 deletions
diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index d9547bb..6a2cd03 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -95,7 +95,7 @@ cdef void _object_mapping_unregister(char *name):
95 eina_hash_del(object_mapping, name, NULL) 95 eina_hash_del(object_mapping, name, NULL)
96 96
97 97
98cdef object object_from_instance(cEo *obj): 98cdef api object object_from_instance(cEo *obj):
99 """ Create a python object from a C Eo object pointer. """ 99 """ Create a python object from a C Eo object pointer. """
100 cdef: 100 cdef:
101 void *data 101 void *data
@@ -140,6 +140,10 @@ cdef object object_from_instance(cEo *obj):
140 o._set_obj(obj) 140 o._set_obj(obj)
141 return o 141 return o
142 142
143cdef api cEo *instance_from_object(object obj):
144 cdef Eo o = obj
145 return o.obj
146
143 147
144cdef void _register_decorated_callbacks(Eo obj): 148cdef void _register_decorated_callbacks(Eo obj):
145 """ 149 """
diff --git a/include/efl.eo.pxd b/include/efl.eo.pxd
index 96e6727..3e8e2b1 100644
--- a/include/efl.eo.pxd
+++ b/include/efl.eo.pxd
@@ -30,8 +30,11 @@ cdef:
30 30
31 int PY_REFCOUNT(object o) 31 int PY_REFCOUNT(object o)
32 32
33 object object_from_instance(cEo *obj)
34 void _object_mapping_register(char *name, object cls) except * 33 void _object_mapping_register(char *name, object cls) except *
35 void _object_mapping_unregister(char *name) 34 void _object_mapping_unregister(char *name)
36 35
37 void _register_decorated_callbacks(Eo obj) 36 void _register_decorated_callbacks(Eo obj)
37
38cdef api:
39 object object_from_instance(cEo *obj)
40 cEo *instance_from_object(object o)