From e0672e2fc37e31421484286e764c8f6322aa0f19 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 2 Apr 2001 07:07:22 +0000 Subject: [PATCH] Added patch to wxPoint_LIST_helper from Tim Hochberg that should make it gobs faster in certain situations. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/CHANGES.txt | 2 + wxPython/contrib/glcanvas/msw/glcanvas.cpp | 5 + wxPython/contrib/ogl/oglbasic.cpp | 10 +- wxPython/contrib/ogl/oglshapes.cpp | 96 ++++++---------- wxPython/contrib/stc/stc_.cpp | 10 +- wxPython/src/export.h | 2 +- wxPython/src/helpers.cpp | 125 +++++++++++++++++---- wxPython/src/helpers.h | 4 +- wxPython/src/msw/calendar.cpp | 28 +++-- wxPython/src/msw/clip_dnd.cpp | 26 +++-- wxPython/src/msw/cmndlgs.cpp | 26 +++-- wxPython/src/msw/controls.cpp | 26 +++-- wxPython/src/msw/controls2.cpp | 26 +++-- wxPython/src/msw/events.cpp | 28 +++-- wxPython/src/msw/filesys.cpp | 26 +++-- wxPython/src/msw/frames.cpp | 26 +++-- wxPython/src/msw/gdi.cpp | 48 +++----- wxPython/src/msw/grid.cpp | 28 +++-- wxPython/src/msw/htmlhelp.cpp | 30 +++-- wxPython/src/msw/image.cpp | 26 +++-- wxPython/src/msw/mdi.cpp | 26 +++-- wxPython/src/msw/misc.cpp | 20 ++-- wxPython/src/msw/misc2.cpp | 2 + wxPython/src/msw/printfw.cpp | 26 +++-- wxPython/src/msw/sizers.cpp | 26 +++-- wxPython/src/msw/stattool.cpp | 26 +++-- wxPython/src/msw/streams.cpp | 20 ++-- wxPython/src/msw/utils.cpp | 20 ++-- wxPython/src/msw/windows2.cpp | 28 +++-- wxPython/src/msw/windows3.cpp | 28 +++-- wxPython/src/my_typemaps.i | 22 ++-- 31 files changed, 507 insertions(+), 335 deletions(-) diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 9102149981..ea3bea6e95 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -32,6 +32,8 @@ that can be used in place of wxPyOnDemandOutputWindow. Added colourselect.py, imagebrowser.py and an updated calendar.py to wxPython/lib from Lorne White. +Added patch to wxPoint_LIST_helper from Tim Hochberg that should make +it gobs faster in certain situations. diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.cpp b/wxPython/contrib/glcanvas/msw/glcanvas.cpp index 61505c8598..25cf0ed7d6 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas.cpp @@ -56,7 +56,12 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "glcanvasc" #include "export.h" +#ifdef __WXMSW__ #include "myglcanvas.h" +#else +#include +#endif + static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; diff --git a/wxPython/contrib/ogl/oglbasic.cpp b/wxPython/contrib/ogl/oglbasic.cpp index b5a838cd81..2ff15c00e2 100644 --- a/wxPython/contrib/ogl/oglbasic.cpp +++ b/wxPython/contrib/ogl/oglbasic.cpp @@ -8510,6 +8510,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxPyShapeEvtHandler","_class_wxPyShape",SwigwxPyShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_wxPyShape",SwigwxPyShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0}, @@ -8519,7 +8520,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxStatusBar","_wxStatusBar",0}, { "_class_wxGIFHandler","_wxGIFHandler",0}, { "_class_wxPySizer","_wxPySizer",0}, - { "_class_wxPostScriptDC","_wxPostScriptDC",0}, { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, @@ -8583,6 +8583,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxPenList","_class_wxPenList",0}, + { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, @@ -8671,6 +8672,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTextCtrl","_wxTextCtrl",0}, { "_class_wxListItemAttr","_wxListItemAttr",0}, { "_wxLayoutConstraints","_class_wxLayoutConstraints",0}, + { "_wxMetaFileDC","_class_wxMetaFileDC",0}, { "_class_wxTextDataObject","_wxTextDataObject",0}, { "_wxMenu","_class_wxMenu",0}, { "_class_wxMoveEvent","_wxMoveEvent",0}, @@ -8706,6 +8708,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxFontList","_class_wxFontList",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, + { "_wxJoystick","_class_wxJoystick",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, { "_wxClientDC","_class_wxClientDC",0}, { "_wxMouseEvent","_class_wxMouseEvent",0}, @@ -8721,6 +8724,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_short","_short",0}, { "_wxMemoryDC","_class_wxMemoryDC",0}, { "_wxPyTextDataObject","_class_wxPyTextDataObject",0}, + { "_class_wxTaskBarIcon","_wxTaskBarIcon",0}, { "_class_wxPrintDialog","_wxPrintDialog",0}, { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0}, { "_wxPaintDC","_class_wxPaintDC",0}, @@ -8730,7 +8734,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStatusBar","_class_wxStatusBar",0}, { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0}, { "_class_wxCursor","_wxCursor",0}, - { "_wxPostScriptDC","_class_wxPostScriptDC",0}, { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxPyProcess","_wxPyProcess",0}, { "_class_wxImageHandler","_wxImageHandler",0}, @@ -8739,6 +8742,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, + { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, { "_wxControl","_class_wxControl",0}, { "_class_wxListBox","_wxListBox",0}, @@ -8829,6 +8833,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -8885,6 +8890,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, { "_class_wxFontList","_wxFontList",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, diff --git a/wxPython/contrib/ogl/oglshapes.cpp b/wxPython/contrib/ogl/oglshapes.cpp index 5dde9a5565..0abd5a9e79 100644 --- a/wxPython/contrib/ogl/oglshapes.cpp +++ b/wxPython/contrib/ogl/oglshapes.cpp @@ -1273,6 +1273,7 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawLines(PyObject *self, PyObject *args int _arg1; wxPoint * _arg2; PyObject * _argo0 = 0; + int NPOINTS; PyObject * _obj2 = 0; char *_kwnames[] = { "self","points", NULL }; @@ -1288,18 +1289,13 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawLines(PyObject *self, PyObject *args } if (_obj2) { - _arg2 = wxPoint_LIST_helper(_obj2); - if (_arg2 == NULL) { - return NULL; - } + _arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS); + if (_arg2 == NULL) { + return NULL; + } } { - if (_obj2) { - _arg1 = PyList_Size(_obj2); - } - else { - _arg1 = 0; - } + _arg1 = NPOINTS; } { wxPy_BEGIN_ALLOW_THREADS; @@ -1322,6 +1318,7 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawPolygon(PyObject *self, PyObject *ar wxPoint * _arg2; int _arg3 = (int ) 0; PyObject * _argo0 = 0; + int NPOINTS; PyObject * _obj2 = 0; char *_kwnames[] = { "self","points","flags", NULL }; @@ -1337,18 +1334,13 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawPolygon(PyObject *self, PyObject *ar } if (_obj2) { - _arg2 = wxPoint_LIST_helper(_obj2); - if (_arg2 == NULL) { - return NULL; - } + _arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS); + if (_arg2 == NULL) { + return NULL; + } } { - if (_obj2) { - _arg1 = PyList_Size(_obj2); - } - else { - _arg1 = 0; - } + _arg1 = NPOINTS; } { wxPy_BEGIN_ALLOW_THREADS; @@ -1370,6 +1362,7 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawSpline(PyObject *self, PyObject *arg int _arg1; wxPoint * _arg2; PyObject * _argo0 = 0; + int NPOINTS; PyObject * _obj2 = 0; char *_kwnames[] = { "self","points", NULL }; @@ -1385,18 +1378,13 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawSpline(PyObject *self, PyObject *arg } if (_obj2) { - _arg2 = wxPoint_LIST_helper(_obj2); - if (_arg2 == NULL) { - return NULL; - } + _arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS); + if (_arg2 == NULL) { + return NULL; + } } { - if (_obj2) { - _arg1 = PyList_Size(_obj2); - } - else { - _arg1 = 0; - } + _arg1 = NPOINTS; } { wxPy_BEGIN_ALLOW_THREADS; @@ -5546,6 +5534,7 @@ static PyObject *_wrap_wxPyDrawnShape_DrawLines(PyObject *self, PyObject *args, int _arg1; wxPoint * _arg2; PyObject * _argo0 = 0; + int NPOINTS; PyObject * _obj2 = 0; char *_kwnames[] = { "self","points", NULL }; @@ -5561,18 +5550,13 @@ static PyObject *_wrap_wxPyDrawnShape_DrawLines(PyObject *self, PyObject *args, } if (_obj2) { - _arg2 = wxPoint_LIST_helper(_obj2); - if (_arg2 == NULL) { - return NULL; - } + _arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS); + if (_arg2 == NULL) { + return NULL; + } } { - if (_obj2) { - _arg1 = PyList_Size(_obj2); - } - else { - _arg1 = 0; - } + _arg1 = NPOINTS; } { wxPy_BEGIN_ALLOW_THREADS; @@ -5630,6 +5614,7 @@ static PyObject *_wrap_wxPyDrawnShape_DrawPolygon(PyObject *self, PyObject *args wxPoint * _arg2; int _arg3 = (int ) 0; PyObject * _argo0 = 0; + int NPOINTS; PyObject * _obj2 = 0; char *_kwnames[] = { "self","points","flags", NULL }; @@ -5645,18 +5630,13 @@ static PyObject *_wrap_wxPyDrawnShape_DrawPolygon(PyObject *self, PyObject *args } if (_obj2) { - _arg2 = wxPoint_LIST_helper(_obj2); - if (_arg2 == NULL) { - return NULL; - } + _arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS); + if (_arg2 == NULL) { + return NULL; + } } { - if (_obj2) { - _arg1 = PyList_Size(_obj2); - } - else { - _arg1 = 0; - } + _arg1 = NPOINTS; } { wxPy_BEGIN_ALLOW_THREADS; @@ -5749,6 +5729,7 @@ static PyObject *_wrap_wxPyDrawnShape_DrawSpline(PyObject *self, PyObject *args, int _arg1; wxPoint * _arg2; PyObject * _argo0 = 0; + int NPOINTS; PyObject * _obj2 = 0; char *_kwnames[] = { "self","points", NULL }; @@ -5764,18 +5745,13 @@ static PyObject *_wrap_wxPyDrawnShape_DrawSpline(PyObject *self, PyObject *args, } if (_obj2) { - _arg2 = wxPoint_LIST_helper(_obj2); - if (_arg2 == NULL) { - return NULL; - } + _arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS); + if (_arg2 == NULL) { + return NULL; + } } { - if (_obj2) { - _arg1 = PyList_Size(_obj2); - } - else { - _arg1 = 0; - } + _arg1 = NPOINTS; } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/contrib/stc/stc_.cpp b/wxPython/contrib/stc/stc_.cpp index d59e0bbb80..a4bbb25439 100644 --- a/wxPython/contrib/stc/stc_.cpp +++ b/wxPython/contrib/stc/stc_.cpp @@ -8630,13 +8630,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, { "_class_wxStatusBar","_wxStatusBar",0}, { "_class_wxGIFHandler","_wxGIFHandler",0}, { "_class_wxPySizer","_wxPySizer",0}, - { "_class_wxPostScriptDC","_wxPostScriptDC",0}, { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, @@ -8704,6 +8704,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxPenList","_class_wxPenList",0}, + { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, @@ -8791,6 +8792,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTextCtrl","_wxTextCtrl",0}, { "_class_wxListItemAttr","_wxListItemAttr",0}, { "_wxLayoutConstraints","_class_wxLayoutConstraints",0}, + { "_wxMetaFileDC","_class_wxMetaFileDC",0}, { "_class_wxTextDataObject","_wxTextDataObject",0}, { "_wxMenu","_class_wxMenu",0}, { "_class_wxMoveEvent","_wxMoveEvent",0}, @@ -8829,6 +8831,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxFontList","_class_wxFontList",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, + { "_wxJoystick","_class_wxJoystick",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, { "_wxClientDC","_class_wxClientDC",0}, { "_wxMouseEvent","_class_wxMouseEvent",0}, @@ -8844,6 +8847,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_short","_short",0}, { "_wxMemoryDC","_class_wxMemoryDC",0}, { "_wxPyTextDataObject","_class_wxPyTextDataObject",0}, + { "_class_wxTaskBarIcon","_wxTaskBarIcon",0}, { "_class_wxPrintDialog","_wxPrintDialog",0}, { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0}, { "_wxPaintDC","_class_wxPaintDC",0}, @@ -8853,7 +8857,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStatusBar","_class_wxStatusBar",0}, { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0}, { "_class_wxCursor","_wxCursor",0}, - { "_wxPostScriptDC","_class_wxPostScriptDC",0}, { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxPyProcess","_wxPyProcess",0}, { "_class_wxImageHandler","_wxImageHandler",0}, @@ -8861,6 +8864,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, + { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, { "_wxControl","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl}, { "_wxControl","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl}, @@ -8953,6 +8957,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -9011,6 +9016,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, { "_class_wxFontList","_wxFontList",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent}, { "_class_wxCommandEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent}, { "_class_wxCommandEvent","_wxCommandEvent",0}, diff --git a/wxPython/src/export.h b/wxPython/src/export.h index 79412e942e..f7c2fd349d 100644 --- a/wxPython/src/export.h +++ b/wxPython/src/export.h @@ -41,7 +41,7 @@ static void wxPyCoreAPI_IMPORT() { #define int_LIST_helper(a) (wxPyCoreAPIPtr->p_int_LIST_helper(a)) #define long_LIST_helper(a) (wxPyCoreAPIPtr->p_long_LIST_helper(a)) #define string_LIST_helper(a) (wxPyCoreAPIPtr->p_string_LIST_helper(a)) -#define wxPoint_LIST_helper(a) (wxPyCoreAPIPtr->p_wxPoint_LIST_helper(a)) +#define wxPoint_LIST_helper(a,b) (wxPyCoreAPIPtr->p_wxPoint_LIST_helper(a, b)) #define wxBitmap_LIST_helper(a) (wxPyCoreAPIPtr->p_wxBitmap_LIST_helper(a)) #define wxString_LIST_helper(a) (wxPyCoreAPIPtr->p_wxString_LIST_helper(a)) #define wxAcceleratorEntry_LIST_helper(a) (wxPyCoreAPIPtr->p_wxAcceleratorEntry_LIST_helper(a)) diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index d07600f82b..3aa1ae21d9 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -757,43 +757,115 @@ char** string_LIST_helper(PyObject* source) { return temp; } +//-------------------------------- +// Part of patch from Tim Hochberg +static inline bool wxPointFromObjects(PyObject* o1, PyObject* o2, wxPoint* point) { + if (PyInt_Check(o1) && PyInt_Check(o2)) { + point->x = PyInt_AS_LONG(o1); + point->y = PyInt_AS_LONG(o2); + return true; + } + if (PyFloat_Check(o1) && PyFloat_Check(o2)) { + point->x = (int)PyFloat_AS_DOUBLE(o1); + point->y = (int)PyFloat_AS_DOUBLE(o2); + return true; + } + if (PyInstance_Check(o1) || PyInstance_Check(o2)) { + // Disallow instances because they can cause havok + return false; + } + if (PyNumber_Check(o1) && PyNumber_Check(o2)) { + // I believe this excludes instances, so this should be safe without INCREFFing o1 and o2 + point->x = PyInt_AsLong(o1); + point->y = PyInt_AsLong(o2); + return true; + } + return false; +} -wxPoint* wxPoint_LIST_helper(PyObject* source) { - if (!PyList_Check(source)) { - PyErr_SetString(PyExc_TypeError, "Expected a list object."); - return NULL; +wxPoint* wxPoint_LIST_helper(PyObject* source, int *count) { + // Putting all of the declarations here allows + // us to put the error handling all in one place. + int x; + wxPoint* temp; + PyObject *o, *o1, *o2; + int isFast = PyList_Check(source) || PyTuple_Check(source); + + // The length of the sequence is returned in count. + if (!PySequence_Check(source)) { + goto error0; } - int count = PyList_Size(source); - wxPoint* temp = new wxPoint[count]; - if (! temp) { + *count = PySequence_Length(source); + if (*count < 0) { + goto error0; + } + + temp = new wxPoint[*count]; + if (!temp) { PyErr_SetString(PyExc_MemoryError, "Unable to allocate temporary array"); return NULL; } - for (int x=0; x #include #include +#ifdef __WXMSW__ #include +#endif static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp index 650d82cd08..a8581c6de5 100644 --- a/wxPython/src/msw/printfw.cpp +++ b/wxPython/src/msw/printfw.cpp @@ -63,12 +63,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -85,23 +85,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; @@ -4553,6 +4553,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_byte","_unsigned_char",0}, { "_wxDataObject","_class_wxDataObject",0}, { "_wxStaticBox","_class_wxStaticBox",0}, + { "_wxColourDatabase","_class_wxColourDatabase",0}, { "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0}, { "_wxPyDropSource","_class_wxPyDropSource",0}, { "_wxChoice","_class_wxChoice",0}, @@ -4644,6 +4645,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxFontData","_wxFontData",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxPenList","_class_wxPenList",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, @@ -4663,6 +4665,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxToolBar","_wxToolBar",0}, { "_wxDropTarget","_class_wxDropTarget",0}, { "_class_wxStaticLine","_wxStaticLine",0}, + { "_class_wxColourDatabase","_wxColourDatabase",0}, { "_wxScrollEvent","_class_wxScrollEvent",0}, { "_wxToolBarToolBase","_class_wxToolBarToolBase",0}, { "_EBool","_wxCoord",0}, @@ -4686,7 +4689,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxDC","_wxDC",0}, { "_wxScrollWinEvent","_class_wxScrollWinEvent",0}, { "_class_wxProgressDialog","_wxProgressDialog",0}, + { "_class_wxBrushList","_wxBrushList",0}, { "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0}, + { "_class_wxPenList","_wxPenList",0}, { "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0}, { "_class_wxDirDialog","_wxDirDialog",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, @@ -4880,6 +4885,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, + { "_wxBrushList","_class_wxBrushList",0}, { "_wxCustomDataObject","_class_wxCustomDataObject",0}, { "_class_wxSize","_wxSize",0}, { "_class_wxBitmap","_wxBitmap",0}, diff --git a/wxPython/src/msw/sizers.cpp b/wxPython/src/msw/sizers.cpp index 2ac42e5fa5..071e38d270 100644 --- a/wxPython/src/msw/sizers.cpp +++ b/wxPython/src/msw/sizers.cpp @@ -59,12 +59,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -81,23 +81,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; @@ -2848,6 +2848,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_byte","_unsigned_char",0}, { "_wxDataObject","_class_wxDataObject",0}, { "_wxStaticBox","_class_wxStaticBox",0}, + { "_wxColourDatabase","_class_wxColourDatabase",0}, { "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0}, { "_wxPyDropSource","_class_wxPyDropSource",0}, { "_wxChoice","_class_wxChoice",0}, @@ -2938,6 +2939,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBoxSizer","_class_wxBoxSizer",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxPenList","_class_wxPenList",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, { "_wxScrollBar","_class_wxScrollBar",0}, @@ -2950,6 +2952,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxStaticBitmap","_wxStaticBitmap",0}, { "_wxDropTarget","_class_wxDropTarget",0}, { "_class_wxStaticLine","_wxStaticLine",0}, + { "_class_wxColourDatabase","_wxColourDatabase",0}, { "_wxScrollEvent","_class_wxScrollEvent",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, @@ -2968,7 +2971,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRect","_wxRect",0}, { "_class_wxDC","_wxDC",0}, { "_wxScrollWinEvent","_class_wxScrollWinEvent",0}, + { "_class_wxBrushList","_wxBrushList",0}, { "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0}, + { "_class_wxPenList","_wxPenList",0}, { "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, { "_wxMaximizeEvent","_class_wxMaximizeEvent",0}, @@ -3150,6 +3155,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, + { "_wxBrushList","_class_wxBrushList",0}, { "_wxCustomDataObject","_class_wxCustomDataObject",0}, { "_class_wxSize","_wxSize",0}, { "_class_wxBitmap","_wxBitmap",0}, diff --git a/wxPython/src/msw/stattool.cpp b/wxPython/src/msw/stattool.cpp index fff1dabb00..60f0af1d9d 100644 --- a/wxPython/src/msw/stattool.cpp +++ b/wxPython/src/msw/stattool.cpp @@ -61,12 +61,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -83,23 +83,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; @@ -3336,6 +3336,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_byte","_unsigned_char",0}, { "_wxDataObject","_class_wxDataObject",0}, { "_wxStaticBox","_class_wxStaticBox",0}, + { "_wxColourDatabase","_class_wxColourDatabase",0}, { "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0}, { "_wxPyDropSource","_class_wxPyDropSource",0}, { "_wxChoice","_class_wxChoice",0}, @@ -3406,6 +3407,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxPenList","_class_wxPenList",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, { "_wxScrollBar","_class_wxScrollBar",0}, @@ -3420,6 +3422,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxToolBar","_wxToolBar",0}, { "_wxDropTarget","_class_wxDropTarget",0}, { "_class_wxStaticLine","_wxStaticLine",0}, + { "_class_wxColourDatabase","_wxColourDatabase",0}, { "_wxScrollEvent","_class_wxScrollEvent",0}, { "_wxToolBarToolBase","_class_wxToolBarToolBase",0}, { "_EBool","_wxCoord",0}, @@ -3439,7 +3442,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRect","_wxRect",0}, { "_class_wxDC","_wxDC",0}, { "_wxScrollWinEvent","_class_wxScrollWinEvent",0}, + { "_class_wxBrushList","_wxBrushList",0}, { "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0}, + { "_class_wxPenList","_wxPenList",0}, { "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, { "_wxMaximizeEvent","_class_wxMaximizeEvent",0}, @@ -3627,6 +3632,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, + { "_wxBrushList","_class_wxBrushList",0}, { "_wxCustomDataObject","_class_wxCustomDataObject",0}, { "_class_wxSize","_wxSize",0}, { "_class_wxBitmap","_wxBitmap",0}, diff --git a/wxPython/src/msw/streams.cpp b/wxPython/src/msw/streams.cpp index cc97a57d90..bc7024b5b5 100644 --- a/wxPython/src/msw/streams.cpp +++ b/wxPython/src/msw/streams.cpp @@ -61,12 +61,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -83,23 +83,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; diff --git a/wxPython/src/msw/utils.cpp b/wxPython/src/msw/utils.cpp index 4f677d45b6..89dafb96f9 100644 --- a/wxPython/src/msw/utils.cpp +++ b/wxPython/src/msw/utils.cpp @@ -62,12 +62,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -84,23 +84,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; diff --git a/wxPython/src/msw/windows2.cpp b/wxPython/src/msw/windows2.cpp index 118dcc2ed8..d9fa9bae4e 100644 --- a/wxPython/src/msw/windows2.cpp +++ b/wxPython/src/msw/windows2.cpp @@ -67,12 +67,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -89,23 +89,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; @@ -2159,6 +2159,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_byte","_unsigned_char",0}, { "_wxDataObject","_class_wxDataObject",0}, { "_wxStaticBox","_class_wxStaticBox",0}, + { "_wxColourDatabase","_class_wxColourDatabase",0}, { "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0}, { "_wxPyDropSource","_class_wxPyDropSource",0}, { "_wxChoice","_class_wxChoice",0}, @@ -2238,6 +2239,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxPenList","_class_wxPenList",0}, { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, @@ -2253,6 +2255,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxStaticBitmap","_wxStaticBitmap",0}, { "_wxDropTarget","_class_wxDropTarget",0}, { "_class_wxStaticLine","_wxStaticLine",0}, + { "_class_wxColourDatabase","_wxColourDatabase",0}, { "_wxScrollEvent","_class_wxScrollEvent",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, @@ -2273,7 +2276,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRect","_wxRect",0}, { "_class_wxDC","_wxDC",0}, { "_wxScrollWinEvent","_class_wxScrollWinEvent",0}, + { "_class_wxBrushList","_wxBrushList",0}, { "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0}, + { "_class_wxPenList","_wxPenList",0}, { "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, { "_wxMaximizeEvent","_class_wxMaximizeEvent",0}, @@ -2316,6 +2321,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyValidator","_wxPyValidator",0}, { "_class_wxCloseEvent","_wxCloseEvent",0}, { "_wxBusyInfo","_class_wxBusyInfo",0}, + { "_wxFontList","_class_wxFontList",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, @@ -2441,6 +2447,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGauge","_class_wxGauge",0}, { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxFontList","_wxFontList",0}, { "_class_wxCommandEvent","_class_wxSplitterEvent",SwigwxSplitterEventTowxCommandEvent}, { "_class_wxCommandEvent","_wxSplitterEvent",SwigwxSplitterEventTowxCommandEvent}, { "_class_wxCommandEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent}, @@ -2448,6 +2455,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, + { "_wxBrushList","_class_wxBrushList",0}, { "_wxCustomDataObject","_class_wxCustomDataObject",0}, { "_class_wxSize","_wxSize",0}, { "_class_wxBitmap","_wxBitmap",0}, diff --git a/wxPython/src/msw/windows3.cpp b/wxPython/src/msw/windows3.cpp index 2710a673bb..f2373175ee 100644 --- a/wxPython/src/msw/windows3.cpp +++ b/wxPython/src/msw/windows3.cpp @@ -61,12 +61,12 @@ extern PyObject *SWIG_newvarlink(void); static PyObject* l_output_helper(PyObject* target, PyObject* o) { PyObject* o2; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyList_Check(target)) { o2 = target; target = PyList_New(0); @@ -83,23 +83,23 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; PyObject* o3; - if (!target) { + if (!target) { target = o; - } else if (target == Py_None) { + } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { + } else { if (!PyTuple_Check(target)) { o2 = target; target = PyTuple_New(1); PyTuple_SetItem(target, 0, o2); } - o3 = PyTuple_New(1); - PyTuple_SetItem(o3, 0, o); + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); o2 = target; - target = PySequence_Concat(o2, o3); - Py_DECREF(o2); + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); Py_DECREF(o3); } return target; @@ -1779,6 +1779,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_byte","_unsigned_char",0}, { "_wxDataObject","_class_wxDataObject",0}, { "_wxStaticBox","_class_wxStaticBox",0}, + { "_wxColourDatabase","_class_wxColourDatabase",0}, { "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0}, { "_wxPyDropSource","_class_wxPyDropSource",0}, { "_wxChoice","_class_wxChoice",0}, @@ -1871,6 +1872,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxPenList","_class_wxPenList",0}, { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, @@ -1887,6 +1889,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxToolBar","_wxToolBar",0}, { "_wxDropTarget","_class_wxDropTarget",0}, { "_class_wxStaticLine","_wxStaticLine",0}, + { "_class_wxColourDatabase","_wxColourDatabase",0}, { "_wxScrollEvent","_class_wxScrollEvent",0}, { "_wxToolBarToolBase","_class_wxToolBarToolBase",0}, { "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0}, @@ -1909,7 +1912,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRect","_wxRect",0}, { "_class_wxDC","_wxDC",0}, { "_wxScrollWinEvent","_class_wxScrollWinEvent",0}, + { "_class_wxBrushList","_wxBrushList",0}, { "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0}, + { "_class_wxPenList","_wxPenList",0}, { "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0}, { "_wxMDIParentFrame","_class_wxMDIParentFrame",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, @@ -1957,6 +1962,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxCloseEvent","_wxCloseEvent",0}, { "_wxSashEvent","_class_wxSashEvent",0}, { "_wxBusyInfo","_class_wxBusyInfo",0}, + { "_wxFontList","_class_wxFontList",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, @@ -2086,11 +2092,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGauge","_class_wxGauge",0}, { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxFontList","_wxFontList",0}, { "_class_wxCommandEvent","_class_wxSashEvent",SwigwxSashEventTowxCommandEvent}, { "_class_wxCommandEvent","_wxSashEvent",SwigwxSashEventTowxCommandEvent}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, + { "_wxBrushList","_class_wxBrushList",0}, { "_wxCustomDataObject","_class_wxCustomDataObject",0}, { "_class_wxSize","_wxSize",0}, { "_class_wxBitmap","_wxBitmap",0}, diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 349cc9245d..f0246d6055 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -131,24 +131,15 @@ delete [] $source; } - - - - %typemap(python,build) int PCOUNT { - if (_in_points) { - $target = PyList_Size(_in_points); - } - else { - $target = 0; - } + $target = NPOINTS; } -%typemap(python,in) wxPoint* points { - $target = wxPoint_LIST_helper($source); - if ($target == NULL) { - return NULL; - } +%typemap(python,in) wxPoint* points (int NPOINTS) { + $target = wxPoint_LIST_helper($source, &NPOINTS); + if ($target == NULL) { + return NULL; + } } %typemap(python,freearg) wxPoint* points { delete [] $source; @@ -156,6 +147,7 @@ + //--------------------------------------------------------------------------- %{ -- 2.45.2