]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/helpers.h
Added patch to wxPoint_LIST_helper from Tim Hochberg that should make
[wxWidgets.git] / wxPython / src / helpers.h
index f53092e220ef5c496b3015fc33bd0ebc1d6865cb..8282d033b99f59483d856bbc13d45d4f41c79286 100644 (file)
@@ -112,7 +112,7 @@ byte* byte_LIST_helper(PyObject* source);
 int* int_LIST_helper(PyObject* source);
 long* long_LIST_helper(PyObject* source);
 char** string_LIST_helper(PyObject* source);
-wxPoint* wxPoint_LIST_helper(PyObject* source);
+wxPoint* wxPoint_LIST_helper(PyObject* source, int* npoints);
 wxBitmap** wxBitmap_LIST_helper(PyObject* source);
 wxString* wxString_LIST_helper(PyObject* source);
 wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source);
@@ -137,13 +137,6 @@ extern "C" char *SWIG_GetPtrObj(PyObject *obj, void **ptr, char *type);
 # pragma warning(disable:4190)
 #endif
 
-
-
-// Non-const versions to keep SWIG happy.
-extern wxPoint  wxPyDefaultPosition;
-extern wxSize   wxPyDefaultSize;
-extern wxString wxPyEmptyStr;
-
 //----------------------------------------------------------------------
 
 class wxPyCallback : public wxObject {
@@ -237,7 +230,7 @@ struct wxPyCoreAPI {
     int*        (*p_int_LIST_helper)(PyObject* source);
     long*       (*p_long_LIST_helper)(PyObject* source);
     char**      (*p_string_LIST_helper)(PyObject* source);
-    wxPoint*    (*p_wxPoint_LIST_helper)(PyObject* source);
+    wxPoint*    (*p_wxPoint_LIST_helper)(PyObject* source, int* npoints);
     wxBitmap**  (*p_wxBitmap_LIST_helper)(PyObject* source);
     wxString*   (*p_wxString_LIST_helper)(PyObject* source);
     wxAcceleratorEntry*   (*p_wxAcceleratorEntry_LIST_helper)(PyObject* source);
@@ -323,15 +316,11 @@ public:
         bool doSave;
 #ifdef wxPyUSE_EXPORT
         doSave = wxPyCoreAPIPtr->p_wxPyRestoreThread();
-#else
-        doSave = wxPyRestoreThread();
-#endif
-
         Py_DECREF(m_obj);
-
-#ifdef wxPyUSE_EXPORT
         wxPyCoreAPIPtr->p_wxPySaveThread(doSave);
 #else
+        doSave = wxPyRestoreThread();
+        Py_DECREF(m_obj);
         wxPySaveThread(doSave);
 #endif
     }
@@ -624,8 +613,8 @@ public:
 #define IMP_PYCALLBACK__BOOL2DBL2INT(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(bool a, double b, double c, int d, int e) {              \
         bool doSave = wxPyRestoreThread();                                      \
-        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
-            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(idii)",                       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                            \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddii)",             \
                                                 (int)a,b,c,d,e));               \
         else                                                                    \
             PCLASS::CBNAME(a, b, c, d, e);                                      \