Salome HOME
Merge changes from 'master' branch.
[modules/kernel.git] / src / LifeCycleCORBA_SWIG / libSALOME_LifeCycleCORBA.i
index ecfef6ab9b6739583c501e21a57ca58473ddb167..0cce5c6ee21d1974914e3d44173b082badfb5bce 100644 (file)
@@ -45,27 +45,9 @@ typedef int Py_ssize_t;
 #define PY_SSIZE_T_MIN INT_MIN
 #endif
 
-//--- from omniORBpy.h (not present on Debian Sarge packages)
-
-struct omniORBpyAPI {
-
-  PyObject* (*cxxObjRefToPyObjRef)(const CORBA::Object_ptr cxx_obj,
-                                   CORBA::Boolean hold_lock);
-  // Convert a C++ object reference to a Python object reference.
-  // If <hold_lock> is true, caller holds the Python interpreter lock.
-
-  CORBA::Object_ptr (*pyObjRefToCxxObjRef)(PyObject* py_obj,
-                                           CORBA::Boolean hold_lock);
-  // Convert a Python object reference to a C++ object reference.
-  // Raises BAD_PARAM if the Python object is not an object reference.
-  // If <hold_lock> is true, caller holds the Python interpreter lock.
-
-
-  omniORBpyAPI();
-  // Constructor for the singleton. Sets up the function pointers.
-};
-
-omniORBpyAPI* api;
+#include <Python.h>
+#include <omniORBpy.h>
+omniORBpyAPI* api=0;
 
 %}
 
@@ -84,7 +66,7 @@ omniORBpyAPI* api;
     return NULL;
   }
   PyObject* pyapi = PyObject_GetAttrString(omnipy, (char*)"API");
-  api = (omniORBpyAPI*)PyCapsule_New(pyapi,NULL,NULL);
+  api = (omniORBpyAPI*)PyCapsule_GetPointer(pyapi,"_omnipy.API");
   Py_DECREF(pyapi);
 %}