davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=9a78c4e22d8e0483749aa2093c29a28a181a3838

commit 9a78c4e22d8e0483749aa2093c29a28a181a3838
Author: davemds <[email protected]>
Date:   Sat Aug 16 12:33:29 2014 +0200

    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
---
 efl/eo/efl.eo.pyx  | 6 +++++-
 include/efl.eo.pxd | 5 ++++-
 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):
     eina_hash_del(object_mapping, name, NULL)
 
 
-cdef object object_from_instance(cEo *obj):
+cdef api object object_from_instance(cEo *obj):
     """ Create a python object from a C Eo object pointer. """
     cdef:
         void *data
@@ -140,6 +140,10 @@ cdef object object_from_instance(cEo *obj):
     o._set_obj(obj)
     return o
 
+cdef api cEo *instance_from_object(object obj):
+    cdef Eo o = obj
+    return o.obj
+
 
 cdef void _register_decorated_callbacks(Eo obj):
     """
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:
 
     int PY_REFCOUNT(object o)
 
-    object object_from_instance(cEo *obj)
     void _object_mapping_register(char *name, object cls) except *
     void _object_mapping_unregister(char *name)
 
     void _register_decorated_callbacks(Eo obj)
+
+cdef api:
+    object object_from_instance(cEo *obj)
+    cEo *instance_from_object(object o)

-- 


Reply via email to