X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/214c4fbea5875368cc21a082d20cb082cd38cb3c..30e24d9dd5a5abf1c9a375ea259eb239b122b7f7:/wxPython/src/_core_api.i?ds=inline diff --git a/wxPython/src/_core_api.i b/wxPython/src/_core_api.i index 153124b842..9fcad55a74 100644 --- a/wxPython/src/_core_api.i +++ b/wxPython/src/_core_api.i @@ -21,7 +21,7 @@ // in the wrapper code. #include - WX_DECLARE_STRING_HASH_MAP( swig_type_info*, wxPyTypeInfoHashMap ); +WX_DECLARE_STRING_HASH_MAP( swig_type_info*, wxPyTypeInfoHashMap ); // Maintains a hashmap of className to swig_type_info pointers. Given the @@ -99,7 +99,11 @@ bool wxPyConvertSwigPtr(PyObject* obj, void **ptr, return SWIG_Python_ConvertPtr(obj, ptr, swigType, SWIG_POINTER_EXCEPTION) != -1; } +%} + +#if SWIG_VERSION < 0x010328 +%{ // Make a SWIGified pointer object suitable for a .this attribute PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) { @@ -108,7 +112,6 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) { swig_type_info* swigType = wxPyFindSwigType(className); wxCHECK_MSG(swigType != NULL, NULL, wxT("Unknown type in wxPyMakeSwigPtr")); -#if SWIG_VERSION < 0x010328 #ifdef SWIG_COBJECT_TYPES robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)swigType->name); #else @@ -118,13 +121,29 @@ PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) { PyString_FromString(result) : 0; } #endif + return robj; +} +%} + #else // SWIG_VERSION >= 1.3.28 +%{ +// Make a SWIGified pointer object suitable for a .this attribute +PyObject* wxPyMakeSwigPtr(void* ptr, const wxChar* className) { + + PyObject* robj = NULL; + + swig_type_info* swigType = wxPyFindSwigType(className); + wxCHECK_MSG(swigType != NULL, NULL, wxT("Unknown type in wxPyMakeSwigPtr")); + robj = PySwigObject_New(ptr, swigType, 0); -#endif return robj; } +%} +#endif + +%{ // Python's PyInstance_Check does not return True for instances of new-style // classes. This should get close enough for both new and old classes but I // should re-evaluate the need for doing instance checks... @@ -133,7 +152,6 @@ bool wxPyInstance_Check(PyObject* obj) { } - // This one checks if the object is an instance of a SWIG proxy class (it has // a .this attribute, and the .this attribute is a PySwigObject.) bool wxPySwigInstance_Check(PyObject* obj) { @@ -151,7 +169,6 @@ bool wxPySwigInstance_Check(PyObject* obj) { PyErr_Clear(); return false; } - // Export a C API in a struct. Other modules will be able to load this from @@ -218,7 +235,11 @@ static wxPyCoreAPI API = { wxPyInstance_Check, wxPySwigInstance_Check, - wxPyCheckForApp + wxPyCheckForApp, + + wxArrayDouble2PyList_helper, + wxPoint2D_LIST_helper, + wxRect2D_helper, };