From 185d7c3ee4c6e4a9ddaf811ae38e57d68a0fdff3 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 21 Nov 2000 03:44:14 +0000 Subject: [PATCH] New typemaps for wxString when compiling for Python 2.0 and beyond that allow Unicode objects to be passed as well as String objects. If a Unicode object is passed PyString_AsStringAndSize is used to convert it to a wxString using the default encoding. Fixed the generic buttons so tool tips work for them. Fixed a bug in the demo's tree control. Added a listbox to the listbox demo that shows how to find items with a patching prefix as keys are typed. Added code to the wxListCtrl demo to show how to get text from a column in report mode. Added code to the toolbar demo to clear the long help from the status bar after 2 seconds. Added wxJoystick. Fixed wxTimer so it can be used as described in the docs, either with a Notify method in a subclass, or sending an event to a wxEvtHandler object, (usually a window.) Added wxNotifyEvent.Allow() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/BUILD.unix.txt | 3 + wxPython/CHANGES.txt | 31 + wxPython/b.bat | 1 + wxPython/contrib/glcanvas/msw/glcanvas.cpp | 23 +- wxPython/contrib/ogl/ogl.cpp | 23 +- wxPython/contrib/ogl/oglbasic.cpp | 166 ++- wxPython/contrib/ogl/oglcanvas.cpp | 49 +- wxPython/contrib/ogl/oglshapes.cpp | 88 +- wxPython/contrib/ogl/oglshapes2.cpp | 62 +- wxPython/contrib/stc/stc_.cpp | 283 +++- wxPython/demo/GenericButtons.py | 1 + wxPython/demo/Main.py | 3 +- wxPython/demo/wxButton.py | 4 +- wxPython/demo/wxListBox.py | 55 + wxPython/demo/wxListCtrl.py | 20 +- wxPython/demo/wxToolBar.py | 77 +- wxPython/my_distutils.py | 4 +- wxPython/setup.py | 9 +- wxPython/src/_defs.i | 8 + wxPython/src/_extras.py | 37 +- wxPython/src/events.i | 1 + wxPython/src/helpers.cpp | 30 +- wxPython/src/image.i | 2 +- wxPython/src/libpy.c | 6 +- wxPython/src/misc2.i | 53 + wxPython/src/msw/calendar.cpp | 23 +- wxPython/src/msw/clip_dnd.cpp | 88 +- wxPython/src/msw/cmndlgs.cpp | 179 ++- wxPython/src/msw/controls.cpp | 390 ++++- wxPython/src/msw/controls2.cpp | 205 ++- wxPython/src/msw/events.cpp | 77 +- wxPython/src/msw/events.py | 3 + wxPython/src/msw/filesys.cpp | 361 ++++- wxPython/src/msw/frames.cpp | 75 +- wxPython/src/msw/gdi.cpp | 244 +++- wxPython/src/msw/grid.cpp | 286 +++- wxPython/src/msw/html.cpp | 374 ++++- wxPython/src/msw/htmlhelp.cpp | 296 +++- wxPython/src/msw/image.cpp | 181 ++- wxPython/src/msw/mdi.cpp | 49 +- wxPython/src/msw/misc.cpp | 52 +- wxPython/src/msw/misc2.cpp | 1520 +++++++++++++++++++- wxPython/src/msw/misc2.py | 141 ++ wxPython/src/msw/printfw.cpp | 49 +- wxPython/src/msw/sizers.cpp | 23 +- wxPython/src/msw/stattool.cpp | 192 ++- wxPython/src/msw/streams.cpp | 36 +- wxPython/src/msw/utils.cpp | 439 +++++- wxPython/src/msw/windows.cpp | 403 +++++- wxPython/src/msw/windows2.cpp | 62 +- wxPython/src/msw/windows3.cpp | 23 +- wxPython/src/msw/wx.cpp | 48 +- wxPython/src/msw/wx.py | 44 +- wxPython/src/my_typemaps.i | 44 +- wxPython/wxPython/lib/buttons.py | 4 +- 55 files changed, 6222 insertions(+), 728 deletions(-) diff --git a/wxPython/BUILD.unix.txt b/wxPython/BUILD.unix.txt index e1409e4e9f..14ae7aedf4 100644 --- a/wxPython/BUILD.unix.txt +++ b/wxPython/BUILD.unix.txt @@ -119,6 +119,9 @@ D. If using the sources (either from the tarball or from CVS) then special debugging code in wxWindows by defining the __WXDEBUG__ macro. You'll get some extra asserts, failure logging, etc. + To make a static library and not make a shared library, use the + --disable-shared and --enable-static flags. + E. Now just compile and install. You need to use GNU make, so if your system has something else get GNU make and build and install it and use it instead of your system's default make command. diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 3eb11fdc7f..2bf2d6488d 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -2,6 +2,37 @@ CHANGES.txt for wxPython ---------------------------------------------------------------------- +2.3b1 +----- + +New typemaps for wxString when compiling for Python 2.0 and beyond +that allow Unicode objects to be passed as well as String objects. If +a Unicode object is passed PyString_AsStringAndSize is used to convert +it to a wxString using the default encoding. + +Fixed the generic buttons so tool tips work for them. + +Fixed a bug in the demo's tree control. + +Added a listbox to the listbox demo that shows how to find items with +a patching prefix as keys are typed. + +Added code to the wxListCtrl demo to show how to get text from a +column in report mode. + +Added code to the toolbar demo to clear the long help from the status +bar after 2 seconds. + +Added wxJoystick. + +Fixed wxTimer so it can be used as described in the docs, either with +a Notify method in a subclass, or sending an event to a wxEvtHandler +object, (usually a window.) + +Added wxNotifyEvent.Allow() + + + New in 2.2.2 ------------ diff --git a/wxPython/b.bat b/wxPython/b.bat index 8c3b04a970..8be8fa0f71 100755 --- a/wxPython/b.bat +++ b/wxPython/b.bat @@ -51,6 +51,7 @@ echo %CMD% %CMD% iff "%OTHERCMD%" != "" then + echo %OTHERCMD% %OTHERCMD% endiff diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.cpp b/wxPython/contrib/glcanvas/msw/glcanvas.cpp index 714b9f8301..31f8a86cb2 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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/contrib/ogl/ogl.cpp b/wxPython/contrib/ogl/ogl.cpp index c10c10df03..c40f9ffa53 100644 --- a/wxPython/contrib/ogl/ogl.cpp +++ b/wxPython/contrib/ogl/ogl.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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/contrib/ogl/oglbasic.cpp b/wxPython/contrib/ogl/oglbasic.cpp index 473afa513d..5d7a34e06b 100644 --- a/wxPython/contrib/ogl/oglbasic.cpp +++ b/wxPython/contrib/ogl/oglbasic.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -156,11 +157,22 @@ static PyObject *_wrap_wxShapeRegion_SetText(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -376,11 +388,22 @@ static PyObject *_wrap_wxShapeRegion_SetName(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -416,11 +439,22 @@ static PyObject *_wrap_wxShapeRegion_SetColour(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -957,11 +991,22 @@ static PyObject *_wrap_wxShapeRegion_SetPenColour(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4950,11 +4995,22 @@ static PyObject *_wrap_wxPyShape_AddText(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5095,11 +5151,22 @@ static PyObject *_wrap_wxPyShape_FormatText(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5265,11 +5332,22 @@ static PyObject *_wrap_wxPyShape_SetTextColour(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5366,11 +5444,22 @@ static PyObject *_wrap_wxPyShape_SetRegionName(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5440,11 +5529,22 @@ static PyObject *_wrap_wxPyShape_GetRegionId(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5480,11 +5580,22 @@ static PyObject *_wrap_wxPyShape_NameRegions(PyObject *self, PyObject *args, PyO } if (_obj1) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5649,11 +5760,22 @@ static PyObject *_wrap_wxPyShape_FindRegion(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/contrib/ogl/oglcanvas.cpp b/wxPython/contrib/ogl/oglcanvas.cpp index 37f99a6054..a7feb2adec 100644 --- a/wxPython/contrib/ogl/oglcanvas.cpp +++ b/wxPython/contrib/ogl/oglcanvas.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -609,11 +610,22 @@ static PyObject *_wrap_wxDiagram_LoadFile(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -892,11 +904,22 @@ static PyObject *_wrap_wxDiagram_SaveFile(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/contrib/ogl/oglshapes.cpp b/wxPython/contrib/ogl/oglshapes.cpp index be89cdb1f7..8e50c3b275 100644 --- a/wxPython/contrib/ogl/oglshapes.cpp +++ b/wxPython/contrib/ogl/oglshapes.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -1213,11 +1214,22 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawText(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { _arg2 = &temp; @@ -4138,11 +4150,22 @@ static PyObject *_wrap_wxPyBitmapShape_SetFilename(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5745,11 +5768,22 @@ static PyObject *_wrap_wxPyDrawnShape_DrawText(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { _arg2 = &temp; @@ -10916,11 +10950,22 @@ static PyObject *_wrap_wxPyDivisionShape_SetLeftSideColour(PyObject *self, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -11064,11 +11109,22 @@ static PyObject *_wrap_wxPyDivisionShape_SetTopSideColour(PyObject *self, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/contrib/ogl/oglshapes2.cpp b/wxPython/contrib/ogl/oglshapes2.cpp index 2cd32fcd9f..5f31bd4ca9 100644 --- a/wxPython/contrib/ogl/oglshapes2.cpp +++ b/wxPython/contrib/ogl/oglshapes2.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -2961,11 +2962,22 @@ static PyObject *_wrap_wxPyLineShape_ClearArrow(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3107,11 +3119,22 @@ static PyObject *_wrap_wxPyLineShape_DeleteArrowHead(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3341,11 +3364,22 @@ static PyObject *_wrap_wxPyLineShape_FindArrowHead(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/contrib/stc/stc_.cpp b/wxPython/contrib/stc/stc_.cpp index c15e7b2029..23d65b1325 100644 --- a/wxPython/contrib/stc/stc_.cpp +++ b/wxPython/contrib/stc/stc_.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -206,11 +207,22 @@ static PyObject *_wrap_wxStyledTextCtrl_AddText(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -246,11 +258,22 @@ static PyObject *_wrap_wxStyledTextCtrl_AddStyledText(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -287,11 +310,22 @@ static PyObject *_wrap_wxStyledTextCtrl_InsertText(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2008,11 +2042,22 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetFaceName(PyObject *self, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2449,11 +2494,22 @@ static PyObject *_wrap_wxStyledTextCtrl_SetWordChars(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2806,11 +2862,22 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompShow(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2954,11 +3021,22 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompStops(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3049,11 +3127,22 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompSelect(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3146,11 +3235,22 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompSetFillUps(PyObject *self, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4060,11 +4160,22 @@ static PyObject *_wrap_wxStyledTextCtrl_FindText(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } _arg4 = (bool ) tempbool4; _arg5 = (bool ) tempbool5; @@ -4628,11 +4739,22 @@ static PyObject *_wrap_wxStyledTextCtrl_ReplaceSelection(PyObject *self, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4914,11 +5036,22 @@ static PyObject *_wrap_wxStyledTextCtrl_SetText(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5071,11 +5204,22 @@ static PyObject *_wrap_wxStyledTextCtrl_CallTipShow(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6126,11 +6270,22 @@ static PyObject *_wrap_wxStyledTextCtrl_SearchNext(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6167,11 +6322,22 @@ static PyObject *_wrap_wxStyledTextCtrl_SearchPrev(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6647,18 +6813,40 @@ static PyObject *_wrap_wxStyledTextCtrl_SetProperty(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6699,11 +6887,22 @@ static PyObject *_wrap_wxStyledTextCtrl_SetKeyWords(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6767,11 +6966,22 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetSpec(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6852,11 +7062,22 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetFontAttr(PyObject *self, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } _arg4 = (bool ) tempbool4; _arg5 = (bool ) tempbool5; diff --git a/wxPython/demo/GenericButtons.py b/wxPython/demo/GenericButtons.py index 876542eae8..ccdf0ef34a 100644 --- a/wxPython/demo/GenericButtons.py +++ b/wxPython/demo/GenericButtons.py @@ -32,6 +32,7 @@ class TestPanel(wxPanel): b.SetBackgroundColour(wxNamedColour("Navy")) b.SetForegroundColour(wxWHITE) #b.SetUseFocusIndicator(false) + b.SetToolTipString("This is a BIG button...") bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP) b = wxGenBitmapButton(self, -1, bmp, (10, 130)) diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 8a7bad7ce6..893fca90d2 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -257,8 +257,7 @@ class wxPythonDemo(wxFrame): item, flags = self.tree.HitTest(pt) if item == self.tree.GetSelection(): self.SetOverview(self.tree.GetItemText(item), self.curOverview) - else: - event.Skip() + event.Skip() #--------------------------------------------- def OnSelChanged(self, event): diff --git a/wxPython/demo/wxButton.py b/wxPython/demo/wxButton.py index b9bdc0bbc7..7ed3113215 100644 --- a/wxPython/demo/wxButton.py +++ b/wxPython/demo/wxButton.py @@ -14,9 +14,11 @@ class TestPanel(wxPanel): b.SetForegroundColour(wxWHITE) b.SetDefault() - wxButton(self, 20, "HELLO AGAIN!", wxPoint(20, 60), wxSize(90, 45)) + b = wxButton(self, 20, "HELLO AGAIN!", wxPoint(20, 60), wxSize(90, 45)) EVT_BUTTON(self, 20, self.OnClick) + b.SetToolTipString("This is a Hello button...") + bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP) mask = wxMaskColour(bmp, wxBLUE) diff --git a/wxPython/demo/wxListBox.py b/wxPython/demo/wxListBox.py index 3cba2b0fa2..ce659bd79c 100644 --- a/wxPython/demo/wxListBox.py +++ b/wxPython/demo/wxListBox.py @@ -1,6 +1,51 @@ from wxPython.wx import * +import string + +#--------------------------------------------------------------------------- + +class wxFindPrefixListBox(wxListBox): + def __init__(self, parent, id, pos=wxDefaultPosition, size=wxDefaultSize, + choices=[], style=0, validator=wxDefaultValidator): + wxListBox.__init__(self, parent, id, pos, size, choices, style, validator) + self.typedText = '' + EVT_KEY_UP(self, self.OnKey) + + + def FindPrefix(self, prefix): + if prefix: + prefix = string.lower(prefix) + length = len(prefix) + for x in range(self.Number()): + text = self.GetString(x) + text = string.lower(text) + if text[:length] == prefix: + return x + return -1 + + + def OnKey(self, evt): + key = evt.GetKeyCode() + if key >= 32 and key <= 127: + self.typedText = self.typedText + chr(key) + item = self.FindPrefix(self.typedText) + if item != -1: + self.SetSelection(item) + + elif key == WXK_BACK: # backspace removes one character and backs up + self.typedText = self.typedText[:-1] + if not self.typedText: + self.SetSelection(0) + else: + item = self.FindPrefix(self.typedText) + if item != -1: + self.SetSelection(item) + + else: + evt.Skip() + + #--------------------------------------------------------------------------- class TestListBox(wxPanel): @@ -32,6 +77,16 @@ class TestListBox(wxPanel): self.lb2.SetSelection(0) + sampleList = sampleList + ['test a', 'test aa', 'test aab', + 'test ab', 'test abc', 'test abcc', + 'test abcd' ] + sampleList.sort() + wxStaticText(self, -1, "Find Prefix:", wxPoint(15, 250)) + fp = wxFindPrefixListBox(self, -1, wxPoint(80, 250), wxSize(80, 120), + sampleList, wxLB_SINGLE) + fp.SetSelection(0) + + def EvtListBox(self, event): self.log.WriteText('EvtListBox: %s\n' % event.GetString()) diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py index 6ac4ede2ba..7d915f6cf7 100644 --- a/wxPython/demo/wxListCtrl.py +++ b/wxPython/demo/wxListCtrl.py @@ -66,14 +66,15 @@ class TestListCtrlPanel(wxPanel): tID = wxNewId() self.il = wxImageList(16, 16) - idx1 = self.il.Add(wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP)) + bmp = wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP) + idx1 = self.il.AddWithColourMask(bmp, wxWHITE) self.list = wxListCtrl(self, tID, style=wxLC_REPORT|wxSUNKEN_BORDER) self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL) + # Why doesn't this show up on MSW??? self.list.SetToolTip(wxToolTip("This is a ToolTip!")) - wxToolTip_Enable(true) self.list.InsertColumn(0, "Artist") self.list.InsertColumn(1, "Title", wxLIST_FORMAT_RIGHT) @@ -122,9 +123,19 @@ class TestListCtrlPanel(wxPanel): self.log.WriteText("x, y = %s\n" % str((self.x, self.y))) event.Skip() + + def getColumnText(self, index, col): + item = self.list.GetItem(index, col) + return item.GetText() + + def OnItemSelected(self, event): self.currentItem = event.m_itemIndex - self.log.WriteText("OnItemSelected: %s\n" % self.list.GetItemText(self.currentItem)) + self.log.WriteText("OnItemSelected: %s, %s, %s\n" % + (self.list.GetItemText(self.currentItem), + self.getColumnText(self.currentItem, 1), + self.getColumnText(self.currentItem, 2))) + def OnItemActivated(self, event): self.currentItem = event.m_itemIndex @@ -148,7 +159,7 @@ class TestListCtrlPanel(wxPanel): def OnDoubleClick(self, event): self.log.WriteText("OnDoubleClick item %s\n" % self.list.GetItemText(self.currentItem)) - + event.Skip() def OnRightClick(self, event): self.log.WriteText("OnRightClick %s\n" % self.list.GetItemText(self.currentItem)) @@ -170,6 +181,7 @@ class TestListCtrlPanel(wxPanel): EVT_MENU(self, tPopupID5, self.OnPopupFive) self.PopupMenu(menu, wxPoint(self.x, self.y)) menu.Destroy() + event.Skip() def OnPopupOne(self, event): self.log.WriteText("Popup one\n") diff --git a/wxPython/demo/wxToolBar.py b/wxPython/demo/wxToolBar.py index 81f6009ad7..bea5f1336f 100644 --- a/wxPython/demo/wxToolBar.py +++ b/wxPython/demo/wxToolBar.py @@ -8,11 +8,13 @@ class TestToolBar(wxFrame): wxFrame.__init__(self, parent, -1, 'Test ToolBar', wxPoint(0,0), wxSize(500, 300)) self.log = log + self.timer = None + EVT_CLOSE(self, self.OnCloseWindow) wxWindow(self, -1).SetBackgroundColour(wxNamedColour("WHITE")) tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER) #|wxTB_FLAT) - #tb = wxToolBar(self, -1, wxDefaultPosition, wxDefaultSize, + #tb = wxToolBarSimple(self, -1, wxDefaultPosition, wxDefaultSize, # wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT) #self.SetToolBar(tb) @@ -21,34 +23,34 @@ class TestToolBar(wxFrame): tb.AddSimpleTool(10, wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP), "New", "Long help for 'New'") EVT_TOOL(self, 10, self.OnToolClick) - EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick) - tb.AddSimpleTool(20, wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP), "Open") + tb.AddSimpleTool(20, wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP), + "Open", "Long help for 'Open'") EVT_TOOL(self, 20, self.OnToolClick) - EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick) tb.AddSeparator() - tb.AddSimpleTool(30, wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP), "Copy") + tb.AddSimpleTool(30, wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP), + "Copy", "Long help for 'Copy'") EVT_TOOL(self, 30, self.OnToolClick) - EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick) - tb.AddSimpleTool(40, wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP), "Paste") + tb.AddSimpleTool(40, wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP), + "Paste", "Long help for 'Paste'") EVT_TOOL(self, 40, self.OnToolClick) - EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick) tb.AddSeparator() tool = tb.AddTool(50, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP), shortHelpString="Toggle this", isToggle=true) EVT_TOOL(self, 50, self.OnToolClick) - EVT_TOOL_RCLICKED(self, 50, self.OnToolRClick) tb.AddTool(60, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP), wxBitmap('bitmaps/tog2.bmp', wxBITMAP_TYPE_BMP), shortHelpString="Toggle with 2 bitmaps", isToggle=true) EVT_TOOL(self, 60, self.OnToolClick) - EVT_TOOL_RCLICKED(self, 60, self.OnToolRClick) + EVT_TOOL_ENTER(self, -1, self.OnToolEnter) + EVT_TOOL_RCLICKED(self, -1, self.OnToolRClick) # Match all + EVT_TIMER(self, -1, self.OnClearSB) tb.AddSeparator() cbID = wxNewId() @@ -57,12 +59,8 @@ class TestToolBar(wxFrame): EVT_COMBOBOX(self, cbID, self.OnCombo) tb.Realize() - EVT_CLOSE(self, self.OnCloseWindow) - def OnCloseWindow(self, event): - self.Destroy() - def OnToolClick(self, event): self.log.WriteText("tool %s clicked\n" % event.GetId()) @@ -72,6 +70,25 @@ class TestToolBar(wxFrame): def OnCombo(self, event): self.log.WriteText("combobox item selected: %s\n" % event.GetString()) + def OnToolEnter(self, event): + self.log.WriteText('OnToolEnter: %s, %s\n' % (event.GetId(), event.GetInt())) + if self.timer is None: + self.timer = wxTimer(self) + self.timer.Start(2000) + event.Skip() + + + def OnClearSB(self, event): + self.SetStatusText("") + self.timer.Stop() + self.timer = None + + + def OnCloseWindow(self, event): + if self.timer is not None: + self.timer.Stop() + self.timer = None + self.Destroy() #--------------------------------------------------------------------------- @@ -98,37 +115,5 @@ def runTest(frame, nb, log): overview = """\ -The name wxToolBar is defined to be a synonym for one of the following classes: - -wxToolBar95 The native Windows 95 toolbar. Used on Windows 95, NT 4 and above. - -wxToolBarMSW A Windows implementation. Used on 16-bit Windows. - -wxToolBarGTK The GTK toolbar. - -wxToolBarSimple A simple implementation, with scrolling. Used on platforms with no native toolbar control, or where scrolling is required. - -wxToolBar() ------------------------ - -Default constructor. - -wxToolBar(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTB_HORIZONTAL | wxNO_BORDER, const wxString& name = wxPanelNameStr) - -Constructs a toolbar. - -Parameters -------------------- - -parent = Pointer to a parent window. - -id = Window identifier. If -1, will automatically create an identifier. - -pos = Window position. wxDefaultPosition is (-1, -1) which indicates that wxWindows should generate a default position for the window. If using the wxWindow class directly, supply an actual position. - -size = Window size. wxDefaultSize is (-1, -1) which indicates that wxWindows should generate a default size for the window. - -style = Window style. See wxToolBar for details. -name = Window name. """ diff --git a/wxPython/my_distutils.py b/wxPython/my_distutils.py index 47da51b1d7..9d66065ff0 100644 --- a/wxPython/my_distutils.py +++ b/wxPython/my_distutils.py @@ -53,9 +53,9 @@ class MyMSVCCompiler(MSVCCompiler): self.mkpath (os.path.dirname (obj)) if ext in self._c_extensions: - input_opt = "/Tc" + src + input_opt = "/Tc" + os.path.abspath(src) elif ext in self._cpp_extensions: - input_opt = "/Tp" + src + input_opt = "/Tp" + os.path.abspath(src) elif ext in self._rc_extensions: # compile .RC to .RES file input_opt = src diff --git a/wxPython/setup.py b/wxPython/setup.py index ffcdd04802..ba00793af8 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -201,6 +201,7 @@ print 'Preparing CORE...' swig_force = force swig_args = ['-c++', '-shadow', '-python', '-keyword', '-dascii', '-I./src', '-D'+WXPLAT] +swig_deps = ['src/my_typemaps.i'] swig_files = [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i', 'misc.i', 'misc2.i', 'utils.i', 'gdi.i', 'mdi.i', 'controls.i', @@ -210,7 +211,7 @@ swig_files = [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i', ] swig_sources = run_swig(swig_files, 'src', GENDIR, PKGDIR, - USE_SWIG, swig_force, swig_args) + USE_SWIG, swig_force, swig_args, swig_deps) copy_file('src/__init__.py', PKGDIR, update=1, verbose=0) copy_file('src/__version__.py', PKGDIR, update=1, verbose=0) @@ -264,7 +265,7 @@ else: swig_files = ['glcanvas.i'] swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR, - USE_SWIG, swig_force, swig_args) + USE_SWIG, swig_force, swig_args, swig_deps) gl_libs = [] if os.name == 'posix': @@ -294,7 +295,7 @@ else: 'oglcanvas.i'] swig_sources = run_swig(swig_files, location, '', PKGDIR, - USE_SWIG, swig_force, swig_args) + USE_SWIG, swig_force, swig_args, swig_deps) # make sure local copy of contrib files are up to date if IN_CVS_TREE: @@ -343,7 +344,7 @@ else: swig_sources = run_swig(swig_files, location, '', PKGDIR, USE_SWIG, swig_force, swig_args + ['-I'+STC_H, '-I'+location], - [STC_H+'/stc.h']) + swig_deps + [STC_H+'/stc.h']) # copy a project specific py module to the main package dir copy_file(location+'/stc.py', PKGDIR, update=1, verbose=1) diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index 9f3be2fecf..45ba348cf1 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -483,6 +483,14 @@ enum { wxHW_SCROLLBAR_NEVER, wxHW_SCROLLBAR_AUTO, + wxJOYSTICK1, + wxJOYSTICK2, + wxJOY_BUTTON1, + wxJOY_BUTTON2, + wxJOY_BUTTON3, + wxJOY_BUTTON4, + wxJOY_BUTTON_ANY, + }; diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 49e2eedce6..79bcb57446 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -674,22 +674,49 @@ def EVT_TIMER(win, id, func): def EVT_END_PROCESS(eh, id, func): eh.Connect(id, -1, wxEVT_END_PROCESS, func) + +# wxJoyStick +def EVT_JOY_DOWN(win, func): + win.Connect(-1, -1, wxEVT_JOY_DOWN, func) + +def EVT_JOY_UP(win, func): + win.Connect(-1, -1, wxEVT_JOY_UP, func) + +def EVT_JOY_MOVE(win, func): + win.Connect(-1, -1, wxEVT_JOY_MOVE, func) + +def EVT_JOY_ZMOVE(win, func): + win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) + +def EVT_JOYSTICK_EVENTS(win, func): + win.Connect(-1, -1, wxEVT_JOY_DOWN, func) + win.Connect(-1, -1, wxEVT_JOY_UP, func) + win.Connect(-1, -1, wxEVT_JOY_MOVE, func) + win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) + #---------------------------------------------------------------------- class wxTimer(wxPyTimer): - def __init__(self): - wxPyTimer.__init__(self, self.Notify) # derived class must provide - # Notify(self) method. + def __init__(self, evtHandler = None, id = -1): + if evtHandler is None: + wxPyTimer.__init__(self, self.Notify) # derived class must provide + # Notify(self) method. + else: + wxPyTimer.__init__(self, None) + self.SetOwner(evtHandler, id) #---------------------------------------------------------------------- # Some wxWin methods can take "NULL" as parameters, but the shadow classes # expect an object with the SWIG pointer as a 'this' member. This class # and instance fools the shadow into passing the NULL pointer. -class NullObj: +## NOTE: This is not needed anymore as None can be passed instead and +# will be interpreted as NULL. + +class _NullObj: this = 'NULL' # SWIG converts this to (void*)0 -NULL = NullObj() +NULL = _NullObj() #---------------------------------------------------------------------- diff --git a/wxPython/src/events.i b/wxPython/src/events.i index b534f076b7..2a9e392b70 100644 --- a/wxPython/src/events.i +++ b/wxPython/src/events.i @@ -383,6 +383,7 @@ class wxNotifyEvent : public wxCommandEvent { public: wxNotifyEvent(int commandType = wxEVT_NULL, int id = 0); bool IsAllowed(); + void Allow(); void Veto(); }; diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 715c3e3576..b59f95f5fe 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -561,20 +561,26 @@ wxPyTimer::~wxPyTimer() { } void wxPyTimer::Notify() { - bool doSave = wxPyRestoreThread(); - - PyObject* result; - PyObject* args = Py_BuildValue("()"); + if (!func || func == Py_None) { + wxTimer::Notify(); + } + else { + bool doSave = wxPyRestoreThread(); + + PyObject* result; + PyObject* args = Py_BuildValue("()"); + + result = PyEval_CallObject(func, args); + Py_DECREF(args); + if (result) { + Py_DECREF(result); + PyErr_Clear(); + } else { + PyErr_Print(); + } - result = PyEval_CallObject(func, args); - Py_DECREF(args); - if (result) { - Py_DECREF(result); - PyErr_Clear(); - } else { - PyErr_Print(); + wxPySaveThread(doSave); } - wxPySaveThread(doSave); } diff --git a/wxPython/src/image.i b/wxPython/src/image.i index fd8ba4d8b2..f3155144f1 100644 --- a/wxPython/src/image.i +++ b/wxPython/src/image.i @@ -139,7 +139,7 @@ public: } size_t len = self->GetWidth() * self->GetHeight() * 3; - dataPtr = new unsigned char[len]; + dataPtr = (unsigned char*) malloc(len); memcpy(dataPtr, PyString_AsString(data), len); self->SetData(dataPtr); } diff --git a/wxPython/src/libpy.c b/wxPython/src/libpy.c index 5841d40a50..7f05d84e59 100644 --- a/wxPython/src/libpy.c +++ b/wxPython/src/libpy.c @@ -5,10 +5,14 @@ * Contains variable linking and pointer type-checking code. ************************************************************************/ +#include +#include + +#include "Python.h" + #ifdef __cplusplus extern "C" { #endif -#include "Python.h" /* Definitions for Windows/Unix exporting */ #if defined(_WIN32) || defined(__WIN32__) diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index 8e80dd6a2a..fe7a1bfb50 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -22,6 +22,7 @@ #include #include #include +#include %} //---------------------------------------------------------------------- @@ -667,6 +668,58 @@ long wxExecute(const wxString& command, int sync = FALSE, wxPyProcess *process = NULL); +//---------------------------------------------------------------------- + +class wxJoystick { +public: + wxJoystick(int joystick = wxJOYSTICK1); + wxPoint GetPosition(); + int GetZPosition(); + int GetButtonState(); + int GetPOVPosition(); + int GetPOVCTSPosition(); + int GetRudderPosition(); + int GetUPosition(); + int GetVPosition(); + int GetMovementThreshold(); + void SetMovementThreshold(int threshold) ; + + bool IsOk(void); + int GetNumberJoysticks(); + int GetManufacturerId(); + int GetProductId(); + wxString GetProductName(); + int GetXMin(); + int GetYMin(); + int GetZMin(); + int GetXMax(); + int GetYMax(); + int GetZMax(); + int GetNumberButtons(); + int GetNumberAxes(); + int GetMaxButtons(); + int GetMaxAxes(); + int GetPollingMin(); + int GetPollingMax(); + int GetRudderMin(); + int GetRudderMax(); + int GetUMin(); + int GetUMax(); + int GetVMin(); + int GetVMax(); + + bool HasRudder(); + bool HasZ(); + bool HasU(); + bool HasV(); + bool HasPOV(); + bool HasPOV4Dir(); + bool HasPOVCTS(); + + bool SetCapture(wxWindow* win, int pollingFreq = 0); + bool ReleaseCapture(); +}; + //---------------------------------------------------------------------- //---------------------------------------------------------------------- diff --git a/wxPython/src/msw/calendar.cpp b/wxPython/src/msw/calendar.cpp index 48e24335e7..4a4e2b714c 100644 --- a/wxPython/src/msw/calendar.cpp +++ b/wxPython/src/msw/calendar.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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/clip_dnd.cpp b/wxPython/src/msw/clip_dnd.cpp index edff43c1ff..cfb9bc878b 100644 --- a/wxPython/src/msw/clip_dnd.cpp +++ b/wxPython/src/msw/clip_dnd.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -61,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); @@ -83,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; @@ -343,11 +344,22 @@ static PyObject *_wrap_wxCustomDataFormat(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCustomDataFormat",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1169,11 +1181,22 @@ static PyObject *_wrap_new_wxTextDataObject(PyObject *self, PyObject *args, PyOb return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1273,11 +1296,22 @@ static PyObject *_wrap_wxTextDataObject_SetText(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1331,11 +1365,22 @@ static PyObject *_wrap_new_wxPyTextDataObject(PyObject *self, PyObject *args, Py return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1699,11 +1744,22 @@ static PyObject *_wrap_wxFileDataObject_AddFile(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/cmndlgs.cpp b/wxPython/src/msw/cmndlgs.cpp index a6e15fdc90..e9406abd03 100644 --- a/wxPython/src/msw/cmndlgs.cpp +++ b/wxPython/src/msw/cmndlgs.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -62,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); @@ -84,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; @@ -679,11 +680,22 @@ static PyObject *_wrap_wxDirDialog_SetMessage(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -719,11 +731,22 @@ static PyObject *_wrap_wxDirDialog_SetPath(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1080,11 +1103,22 @@ static PyObject *_wrap_wxFileDialog_SetDirectory(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1120,11 +1154,22 @@ static PyObject *_wrap_wxFileDialog_SetFilename(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1188,11 +1233,22 @@ static PyObject *_wrap_wxFileDialog_SetMessage(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1228,11 +1284,22 @@ static PyObject *_wrap_wxFileDialog_SetPath(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1296,11 +1363,22 @@ static PyObject *_wrap_wxFileDialog_SetWildcard(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1488,18 +1566,40 @@ static PyObject *_wrap_new_wxSingleChoiceDialog(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj4) { @@ -1793,11 +1893,22 @@ static PyObject *_wrap_wxTextEntryDialog_SetValue(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2577,18 +2688,40 @@ static PyObject *_wrap_new_wxProgressDialog(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOi:new_wxProgressDialog",_kwnames,&_obj0,&_obj1,&_arg2,&_argo3,&_arg4)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index f171ca6104..6c0d847e04 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -332,11 +332,22 @@ static PyObject *_wrap_wxControl_SetLabel(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -409,11 +420,22 @@ static PyObject *_wrap_new_wxButton(PyObject *self, PyObject *args, PyObject *kw } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -1079,11 +1101,22 @@ static PyObject *_wrap_new_wxCheckBox(PyObject *self, PyObject *args, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -1309,11 +1342,22 @@ static PyObject *_wrap_wxChoice_Append(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1377,11 +1421,22 @@ static PyObject *_wrap_wxChoice_FindString(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1618,11 +1673,22 @@ static PyObject *_wrap_wxChoice_SetStringSelection(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1776,11 +1842,22 @@ static PyObject *_wrap_wxComboBox_Append(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1926,11 +2003,22 @@ static PyObject *_wrap_wxComboBox_FindString(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2199,11 +2287,22 @@ static PyObject *_wrap_wxComboBox_Replace(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2380,11 +2479,22 @@ static PyObject *_wrap_wxComboBox_SetValue(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2764,11 +2874,22 @@ static PyObject *_wrap_new_wxStaticBox(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -2935,11 +3056,22 @@ static PyObject *_wrap_new_wxStaticText(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -3024,11 +3156,22 @@ static PyObject *_wrap_wxStaticText_SetLabel(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3173,11 +3316,22 @@ static PyObject *_wrap_wxListBox_Append(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3297,11 +3451,22 @@ static PyObject *_wrap_wxListBox_FindString(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3644,11 +3809,22 @@ static PyObject *_wrap_wxListBox_SetFirstItemStr(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3716,11 +3892,22 @@ static PyObject *_wrap_wxListBox_SetString(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3758,11 +3945,22 @@ static PyObject *_wrap_wxListBox_SetStringSelection(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } _arg2 = (bool ) tempbool2; { @@ -4447,11 +4645,22 @@ static PyObject *_wrap_wxTextCtrl_LoadFile(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4592,11 +4801,22 @@ static PyObject *_wrap_wxTextCtrl_Replace(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4633,11 +4853,22 @@ static PyObject *_wrap_wxTextCtrl_SaveFile(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4786,11 +5017,22 @@ static PyObject *_wrap_wxTextCtrl_SetValue(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4854,11 +5096,22 @@ static PyObject *_wrap_wxTextCtrl_WriteText(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4894,11 +5147,22 @@ static PyObject *_wrap_wxTextCtrl_AppendText(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5228,11 +5492,22 @@ static PyObject *_wrap_wxTextCtrl_write(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5979,11 +6254,22 @@ static PyObject *_wrap_new_wxRadioBox(PyObject *self, PyObject *args, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -6123,11 +6409,22 @@ static PyObject *_wrap_wxRadioBox_FindString(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6315,11 +6612,22 @@ static PyObject *_wrap_wxRadioBox_SetItemLabel(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6383,11 +6691,22 @@ static PyObject *_wrap_wxRadioBox_SetStringSelection(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6521,11 +6840,22 @@ static PyObject *_wrap_new_wxRadioButton(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index fab7392364..79a41c0a69 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -63,12 +64,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 +86,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; @@ -774,11 +775,22 @@ static PyObject *_wrap_wxListItem_SetText(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1702,11 +1714,22 @@ static PyObject *_wrap_wxListItem_m_text_set(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3197,11 +3220,22 @@ static PyObject *_wrap_wxListCtrl_FindItem(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } _arg3 = (bool ) tempbool3; { @@ -3933,11 +3967,22 @@ static PyObject *_wrap_wxListCtrl_InsertColumn(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4010,11 +4055,22 @@ static PyObject *_wrap_wxListCtrl_InsertStringItem(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4081,11 +4137,22 @@ static PyObject *_wrap_wxListCtrl_InsertImageStringItem(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4327,11 +4394,22 @@ static PyObject *_wrap_wxListCtrl_SetStringItem(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4492,11 +4570,22 @@ static PyObject *_wrap_wxListCtrl_SetItemText(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5602,11 +5691,22 @@ static PyObject *_wrap_wxTreeCtrl_SetItemText(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6596,11 +6696,22 @@ static PyObject *_wrap_wxTreeCtrl_AddRoot(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo4) { if (_argo4 == Py_None) { _arg4 = NULL; } @@ -6658,11 +6769,22 @@ static PyObject *_wrap_wxTreeCtrl_PrependItem(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_argo5) { if (_argo5 == Py_None) { _arg5 = NULL; } @@ -6729,11 +6851,22 @@ static PyObject *_wrap_wxTreeCtrl_InsertItem(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } @@ -6792,11 +6925,22 @@ static PyObject *_wrap_wxTreeCtrl_InsertItemBefore(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } @@ -6854,11 +6998,22 @@ static PyObject *_wrap_wxTreeCtrl_AppendItem(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_argo5) { if (_argo5 == Py_None) { _arg5 = NULL; } diff --git a/wxPython/src/msw/events.cpp b/wxPython/src/msw/events.cpp index 47edfaf2de..06c0f87017 100644 --- a/wxPython/src/msw/events.cpp +++ b/wxPython/src/msw/events.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -951,11 +952,22 @@ static PyObject *_wrap_wxCommandEvent_SetString(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5205,11 +5217,22 @@ static PyObject *_wrap_wxUpdateUIEvent_SetText(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5328,6 +5351,33 @@ static PyObject *_wrap_wxNotifyEvent_IsAllowed(PyObject *self, PyObject *args, P return _resultobj; } +#define wxNotifyEvent_Allow(_swigobj) (_swigobj->Allow()) +static PyObject *_wrap_wxNotifyEvent_Allow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxNotifyEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNotifyEvent_Allow",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNotifyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxNotifyEvent_Allow. Expected _wxNotifyEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxNotifyEvent_Allow(_arg0); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxNotifyEvent_Veto(_swigobj) (_swigobj->Veto()) static PyObject *_wrap_wxNotifyEvent_Veto(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -6055,6 +6105,7 @@ static PyMethodDef eventscMethods[] = { { "wxPaletteChangedEvent_SetChangedWindow", (PyCFunction) _wrap_wxPaletteChangedEvent_SetChangedWindow, METH_VARARGS | METH_KEYWORDS }, { "new_wxPaletteChangedEvent", (PyCFunction) _wrap_new_wxPaletteChangedEvent, METH_VARARGS | METH_KEYWORDS }, { "wxNotifyEvent_Veto", (PyCFunction) _wrap_wxNotifyEvent_Veto, METH_VARARGS | METH_KEYWORDS }, + { "wxNotifyEvent_Allow", (PyCFunction) _wrap_wxNotifyEvent_Allow, METH_VARARGS | METH_KEYWORDS }, { "wxNotifyEvent_IsAllowed", (PyCFunction) _wrap_wxNotifyEvent_IsAllowed, METH_VARARGS | METH_KEYWORDS }, { "new_wxNotifyEvent", (PyCFunction) _wrap_new_wxNotifyEvent, METH_VARARGS | METH_KEYWORDS }, { "new_wxSysColourChangedEvent", (PyCFunction) _wrap_new_wxSysColourChangedEvent, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/events.py b/wxPython/src/msw/events.py index 4a44a50011..3d61ae0ddf 100644 --- a/wxPython/src/msw/events.py +++ b/wxPython/src/msw/events.py @@ -810,6 +810,9 @@ class wxNotifyEventPtr(wxCommandEventPtr): def IsAllowed(self, *_args, **_kwargs): val = apply(eventsc.wxNotifyEvent_IsAllowed,(self,) + _args, _kwargs) return val + def Allow(self, *_args, **_kwargs): + val = apply(eventsc.wxNotifyEvent_Allow,(self,) + _args, _kwargs) + return val def Veto(self, *_args, **_kwargs): val = apply(eventsc.wxNotifyEvent_Veto,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/msw/filesys.cpp b/wxPython/src/msw/filesys.cpp index 90cd522b88..782dc50251 100644 --- a/wxPython/src/msw/filesys.cpp +++ b/wxPython/src/msw/filesys.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -62,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); @@ -84,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; @@ -188,11 +189,22 @@ static PyObject *_wrap___wxMemoryFSHandler_AddFile_wxImage(PyObject *self, PyObj if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:__wxMemoryFSHandler_AddFile_wxImage",_kwnames,&_obj0,&_argo1,&_arg2)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } @@ -228,11 +240,22 @@ static PyObject *_wrap___wxMemoryFSHandler_AddFile_wxBitmap(PyObject *self, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:__wxMemoryFSHandler_AddFile_wxBitmap",_kwnames,&_obj0,&_argo1,&_arg2)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } @@ -267,11 +290,22 @@ static PyObject *_wrap___wxMemoryFSHandler_AddFile_Data(PyObject *self, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:__wxMemoryFSHandler_AddFile_Data",_kwnames,&_obj0,&_obj1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { _arg1 = _obj1; @@ -324,25 +358,58 @@ static PyObject *_wrap_new_wxFSFile(PyObject *self, PyObject *args, PyObject *kw } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } if (_argo4) { if (_argo4 == Py_None) { _arg4 = NULL; } @@ -641,11 +708,22 @@ static PyObject *_wrap_wxFileSystemHandler_CanOpen(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -691,11 +769,22 @@ static PyObject *_wrap_wxFileSystemHandler_OpenFile(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -738,11 +827,22 @@ static PyObject *_wrap_wxFileSystemHandler_FindFirst(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -815,11 +915,22 @@ static PyObject *_wrap_wxFileSystemHandler_GetProtocol(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -860,11 +971,22 @@ static PyObject *_wrap_wxFileSystemHandler_GetLeftLocation(PyObject *self, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -905,11 +1027,22 @@ static PyObject *_wrap_wxFileSystemHandler_GetAnchor(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -950,11 +1083,22 @@ static PyObject *_wrap_wxFileSystemHandler_GetRightLocation(PyObject *self, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -995,11 +1139,22 @@ static PyObject *_wrap_wxFileSystemHandler_GetMimeTypeFromExt(PyObject *self, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1066,11 +1221,22 @@ static PyObject *_wrap_wxFileSystem_ChangePathTo(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } _arg2 = (bool ) tempbool2; { @@ -1141,11 +1307,22 @@ static PyObject *_wrap_wxFileSystem_OpenFile(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1188,11 +1365,22 @@ static PyObject *_wrap_wxFileSystem_FindFirst(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1341,11 +1529,22 @@ static PyObject *_wrap_wxInternetFSHandler_CanOpen(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1391,11 +1590,22 @@ static PyObject *_wrap_wxInternetFSHandler_OpenFile(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1470,11 +1680,22 @@ static PyObject *_wrap_wxZipFSHandler_CanOpen(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1520,11 +1741,22 @@ static PyObject *_wrap_wxZipFSHandler_OpenFile(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1567,11 +1799,22 @@ static PyObject *_wrap_wxZipFSHandler_FindFirst(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1666,11 +1909,22 @@ static PyObject *_wrap_wxMemoryFSHandler_RemoveFile(PyObject *self, PyObject *ar if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMemoryFSHandler_RemoveFile",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1707,11 +1961,22 @@ static PyObject *_wrap_wxMemoryFSHandler_CanOpen(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1757,11 +2022,22 @@ static PyObject *_wrap_wxMemoryFSHandler_OpenFile(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1804,11 +2080,22 @@ static PyObject *_wrap_wxMemoryFSHandler_FindFirst(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/frames.cpp b/wxPython/src/msw/frames.cpp index 3edef79eff..149049f23c 100644 --- a/wxPython/src/msw/frames.cpp +++ b/wxPython/src/msw/frames.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -154,11 +155,22 @@ static PyObject *_wrap_new_wxFrame(PyObject *self, PyObject *args, PyObject *kwa } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -769,11 +781,22 @@ static PyObject *_wrap_wxFrame_SetStatusText(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -857,11 +880,22 @@ static PyObject *_wrap_wxFrame_SetTitle(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1114,11 +1148,22 @@ static PyObject *_wrap_new_wxMiniFrame(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index 450ae3ea02..3b52cc3849 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -63,12 +64,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 +86,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; @@ -370,11 +371,22 @@ static PyObject *_wrap_wxNamedColour(PyObject *self, PyObject *args, PyObject *k if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNamedColour",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1072,11 +1084,22 @@ static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:new_wxBitmap",_kwnames,&_obj0,&_arg1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1214,11 +1237,22 @@ static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1257,11 +1291,22 @@ static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } @@ -1851,11 +1896,22 @@ static PyObject *_wrap_new_wxIcon(PyObject *self, PyObject *args, PyObject *kwar if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:new_wxIcon",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1925,11 +1981,22 @@ static PyObject *_wrap_wxIcon_LoadFile(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2242,11 +2309,22 @@ static PyObject *_wrap_new_wxCursor(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:new_wxCursor",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2881,11 +2959,22 @@ static PyObject *_wrap_wxFont_SetFaceName(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4829,11 +4918,22 @@ static PyObject *_wrap_wxDC_DrawRotatedText(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4951,11 +5051,22 @@ static PyObject *_wrap_wxDC_DrawText(PyObject *self, PyObject *args, PyObject *k } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5689,11 +5800,22 @@ static PyObject *_wrap_wxDC_GetTextExtent(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5761,11 +5883,22 @@ static PyObject *_wrap_wxDC_GetFullTextExtent(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } @@ -6640,11 +6773,22 @@ static PyObject *_wrap_wxDC_StartDoc(PyObject *self, PyObject *args, PyObject *k } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -7402,25 +7546,58 @@ static PyObject *_wrap_new_wxPrinterDC(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|ii:new_wxPrinterDC",_kwnames,&_obj0,&_obj1,&_obj2,&tempbool3,&_arg4)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } _arg3 = (bool ) tempbool3; { @@ -7472,11 +7649,22 @@ static PyObject *_wrap_new_wxMetaFileDC(PyObject *self, PyObject *args, PyObject return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/grid.cpp b/wxPython/src/msw/grid.cpp index f142d87432..1afeefd444 100644 --- a/wxPython/src/msw/grid.cpp +++ b/wxPython/src/msw/grid.cpp @@ -881,11 +881,22 @@ static PyObject *_wrap_wxGridCellRenderer_SetParameters(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1204,11 +1215,22 @@ static PyObject *_wrap_wxPyGridCellRenderer_base_SetParameters(PyObject *self, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1601,11 +1623,22 @@ static PyObject *_wrap_wxGridCellEditor_SetParameters(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2508,11 +2541,22 @@ static PyObject *_wrap_wxPyGridCellEditor_base_SetParameters(PyObject *self, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4280,11 +4324,22 @@ static PyObject *_wrap_wxGridTableBase_SetValue(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4357,11 +4412,22 @@ static PyObject *_wrap_wxGridTableBase_CanGetValueAs(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4399,11 +4465,22 @@ static PyObject *_wrap_wxGridTableBase_CanSetValueAs(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4883,11 +4960,22 @@ static PyObject *_wrap_wxGridTableBase_SetRowLabelValue(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4924,11 +5012,22 @@ static PyObject *_wrap_wxGridTableBase_SetColLabelValue(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5273,11 +5372,22 @@ static PyObject *_wrap_wxPyGridTableBase_base_CanGetValueAs(PyObject *self, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5315,11 +5425,22 @@ static PyObject *_wrap_wxPyGridTableBase_base_CanSetValueAs(PyObject *self, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5620,11 +5741,22 @@ static PyObject *_wrap_wxPyGridTableBase_base_SetRowLabelValue(PyObject *self, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5661,11 +5793,22 @@ static PyObject *_wrap_wxPyGridTableBase_base_SetColLabelValue(PyObject *self, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -7060,11 +7203,22 @@ static PyObject *_wrap_wxGrid_DrawTextRectangle(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { _arg3 = &temp; @@ -7107,11 +7261,22 @@ static PyObject *_wrap_wxGrid_StringToLines(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo2) { if (_argo2 == Py_None) { _arg2 = NULL; } @@ -8858,11 +9023,22 @@ static PyObject *_wrap_wxGrid_SetRowLabelValue(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -8899,11 +9075,22 @@ static PyObject *_wrap_wxGrid_SetColLabelValue(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -9422,11 +9609,22 @@ static PyObject *_wrap_wxGrid_SetColFormatCustom(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -10830,11 +11028,22 @@ static PyObject *_wrap_wxGrid_SetCellValue(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -11314,11 +11523,22 @@ static PyObject *_wrap_wxGrid_RegisterDataType(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo2) { if (_argo2 == Py_None) { _arg2 = NULL; } @@ -11442,11 +11662,22 @@ static PyObject *_wrap_wxGrid_GetDefaultEditorForType(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -11489,11 +11720,22 @@ static PyObject *_wrap_wxGrid_GetDefaultRendererForType(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/html.cpp b/wxPython/src/msw/html.cpp index fd92146634..60a70c5d8f 100644 --- a/wxPython/src/msw/html.cpp +++ b/wxPython/src/msw/html.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -66,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); @@ -88,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; @@ -308,19 +309,41 @@ static PyObject *_wrap_new_wxHtmlLinkInfo(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:new_wxHtmlLinkInfo",_kwnames,&_obj0,&_obj1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_obj1) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -530,11 +553,22 @@ static PyObject *_wrap_wxHtmlTag_HasParam(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -571,11 +605,22 @@ static PyObject *_wrap_wxHtmlTag_GetParam(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -854,11 +899,22 @@ static PyObject *_wrap_wxHtmlParser_Parse(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -899,11 +955,22 @@ static PyObject *_wrap_wxHtmlParser_InitParser(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1069,11 +1136,22 @@ static PyObject *_wrap_wxHtmlParser_PushTagHandler(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1346,18 +1424,40 @@ static PyObject *_wrap_wxHtmlWinParser_SetFonts(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { _arg3 = _obj3; @@ -2015,11 +2115,22 @@ static PyObject *_wrap_wxHtmlWinParser_SetLink(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4143,18 +4254,40 @@ static PyObject *_wrap_wxHtmlWindow_SetFonts(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { _arg3 = _obj3; @@ -4662,19 +4795,41 @@ static PyObject *_wrap_wxHtmlDCRenderer_SetHtmlText(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } _arg3 = (bool ) tempbool3; { @@ -4838,19 +4993,41 @@ static PyObject *_wrap_wxHtmlPrintout_SetHtmlText(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } _arg3 = (bool ) tempbool3; { @@ -4891,11 +5068,22 @@ static PyObject *_wrap_wxHtmlPrintout_SetHtmlFile(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4932,11 +5120,22 @@ static PyObject *_wrap_wxHtmlPrintout_SetHeader(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4973,11 +5172,22 @@ static PyObject *_wrap_wxHtmlPrintout_SetFooter(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5107,11 +5317,22 @@ static PyObject *_wrap_wxHtmlEasyPrinting_PreviewFile(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5149,19 +5370,41 @@ static PyObject *_wrap_wxHtmlEasyPrinting_PreviewText(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5201,11 +5444,22 @@ static PyObject *_wrap_wxHtmlEasyPrinting_PrintFile(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5243,19 +5497,41 @@ static PyObject *_wrap_wxHtmlEasyPrinting_PrintText(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5350,11 +5626,22 @@ static PyObject *_wrap_wxHtmlEasyPrinting_SetHeader(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5391,11 +5678,22 @@ static PyObject *_wrap_wxHtmlEasyPrinting_SetFooter(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/htmlhelp.cpp b/wxPython/src/msw/htmlhelp.cpp index 9005f40f47..8d7c08dca3 100644 --- a/wxPython/src/msw/htmlhelp.cpp +++ b/wxPython/src/msw/htmlhelp.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -64,12 +65,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); @@ -86,23 +87,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; @@ -486,25 +487,58 @@ static PyObject *_wrap_new_wxHtmlBookRecord(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:new_wxHtmlBookRecord",_kwnames,&_obj0,&_obj1,&_obj2)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1263,11 +1297,22 @@ static PyObject *_wrap_wxHtmlHelpData_SetTempDir(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1304,11 +1349,22 @@ static PyObject *_wrap_wxHtmlHelpData_AddBook(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1344,11 +1400,22 @@ static PyObject *_wrap_wxHtmlHelpData_FindPageByName(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1609,11 +1676,22 @@ static PyObject *_wrap_new_wxHtmlHelpFrame(PyObject *self, PyObject *args, PyObj } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_argo4) { if (_argo4 == Py_None) { _arg4 = NULL; } @@ -1695,11 +1773,22 @@ static PyObject *_wrap_wxHtmlHelpFrame_SetTitleFormat(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1735,11 +1824,22 @@ static PyObject *_wrap_wxHtmlHelpFrame_Display(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1858,11 +1958,22 @@ static PyObject *_wrap_wxHtmlHelpFrame_KeywordSearch(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1907,11 +2018,22 @@ static PyObject *_wrap_wxHtmlHelpFrame_UseConfig(PyObject *self, PyObject *args, } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1957,11 +2079,22 @@ static PyObject *_wrap_wxHtmlHelpFrame_ReadCustomization(PyObject *self, PyObjec } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2007,11 +2140,22 @@ static PyObject *_wrap_wxHtmlHelpFrame_WriteCustomization(PyObject *self, PyObje } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2107,11 +2251,22 @@ static PyObject *_wrap_wxHtmlHelpController_SetTitleFormat(PyObject *self, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2147,11 +2302,22 @@ static PyObject *_wrap_wxHtmlHelpController_SetTempDir(PyObject *self, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2189,11 +2355,22 @@ static PyObject *_wrap_wxHtmlHelpController_AddBook(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2228,11 +2405,22 @@ static PyObject *_wrap_wxHtmlHelpController_Display(PyObject *self, PyObject *ar } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2351,11 +2539,22 @@ static PyObject *_wrap_wxHtmlHelpController_KeywordSearch(PyObject *self, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2400,11 +2599,22 @@ static PyObject *_wrap_wxHtmlHelpController_UseConfig(PyObject *self, PyObject * } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2450,11 +2660,22 @@ static PyObject *_wrap_wxHtmlHelpController_ReadCustomization(PyObject *self, Py } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2500,11 +2721,22 @@ static PyObject *_wrap_wxHtmlHelpController_WriteCustomization(PyObject *self, P } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/image.cpp b/wxPython/src/msw/image.cpp index bbd2ad6a15..5c6b50eeee 100644 --- a/wxPython/src/msw/image.cpp +++ b/wxPython/src/msw/image.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -59,12 +60,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 +82,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; @@ -191,18 +192,40 @@ static PyObject *_wrap_wxImageFromMime(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxImageFromMime",_kwnames,&_obj0,&_obj1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -446,11 +469,22 @@ static PyObject *_wrap_wxImageHandler_SetName(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -486,11 +520,22 @@ static PyObject *_wrap_wxImageHandler_SetExtension(PyObject *self, PyObject *arg } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -554,11 +599,22 @@ static PyObject *_wrap_wxImageHandler_SetMimeType(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -819,11 +875,22 @@ static PyObject *_wrap_new_wxImage(PyObject *self, PyObject *args, PyObject *kwa if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|l:new_wxImage",_kwnames,&_obj0,&_arg1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1165,11 +1232,22 @@ static PyObject *_wrap_wxImage_LoadFile(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1207,18 +1285,40 @@ static PyObject *_wrap_wxImage_LoadMimeFile(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1259,11 +1359,22 @@ static PyObject *_wrap_wxImage_SaveFile(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1301,18 +1412,40 @@ static PyObject *_wrap_wxImage_SaveMimeFile(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1558,7 +1691,7 @@ static void wxImage_SetData(wxImage *self,PyObject * data) { } size_t len = self->GetWidth() * self->GetHeight() * 3; - dataPtr = new unsigned char[len]; + dataPtr = (unsigned char*) malloc(len); memcpy(dataPtr, PyString_AsString(data), len); self->SetData(dataPtr); } diff --git a/wxPython/src/msw/mdi.cpp b/wxPython/src/msw/mdi.cpp index c414b5f1e9..dd0c5dfdee 100644 --- a/wxPython/src/msw/mdi.cpp +++ b/wxPython/src/msw/mdi.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -58,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); @@ -80,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; @@ -161,11 +162,22 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -596,11 +608,22 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { diff --git a/wxPython/src/msw/misc.cpp b/wxPython/src/msw/misc.cpp index 1d06cc0c6a..6384d02d5d 100644 --- a/wxPython/src/msw/misc.cpp +++ b/wxPython/src/msw/misc.cpp @@ -444,11 +444,22 @@ static PyObject *_wrap_wxShell(PyObject *self, PyObject *args, PyObject *kwargs) return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -643,11 +654,22 @@ static PyObject *_wrap_wxStripMenuCodes(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStripMenuCodes",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -811,11 +833,22 @@ static PyObject *_wrap_wxGetAccelFromString(PyObject *self, PyObject *args, PyOb if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGetAccelFromString",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4726,11 +4759,22 @@ static PyObject *_wrap_new_wxBusyInfo(PyObject *self, PyObject *args, PyObject * if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxBusyInfo",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp index 2cb28625ff..df596451fa 100644 --- a/wxPython/src/msw/misc2.cpp +++ b/wxPython/src/msw/misc2.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -61,15 +62,16 @@ extern PyObject *SWIG_newvarlink(void); #include #include #include +#include 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); @@ -86,23 +88,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; @@ -268,27 +270,60 @@ static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OOOiii:wxGetTextFromUser",_kwnames,&_obj0,&_obj1,&_obj2,&_argo3,&_arg4,&_arg5,&tempbool6)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_obj1) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } @@ -348,18 +383,40 @@ static PyObject *_wrap_wxGetSingleChoice(PyObject *self, PyObject *args, PyObjec if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|Oiiiii:wxGetSingleChoice",_kwnames,&_obj0,&_obj1,&_obj3,&_argo4,&_arg5,&_arg6,&tempbool7,&_arg8,&_arg9)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj3) { @@ -433,18 +490,40 @@ static PyObject *_wrap_wxGetSingleChoiceIndex(PyObject *self, PyObject *args, Py if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|Oiiiii:wxGetSingleChoiceIndex",_kwnames,&_obj0,&_obj1,&_obj3,&_argo4,&_arg5,&_arg6,&tempbool7,&_arg8,&_arg9)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj3) { @@ -507,19 +586,41 @@ static PyObject *_wrap_wxMessageBox(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOii:wxMessageBox",_kwnames,&_obj0,&_obj1,&_arg2,&_argo3,&_arg4,&_arg5)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_obj1) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } @@ -568,25 +669,58 @@ static PyObject *_wrap_wxGetNumberFromUser(PyObject *self, PyObject *args, PyObj if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOl|llOO:wxGetNumberFromUser",_kwnames,&_obj0,&_obj1,&_obj2,&_arg3,&_arg4,&_arg5,&_argo6,&_obj7)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } @@ -696,11 +830,22 @@ static PyObject *_wrap_wxFindWindowByLabel(PyObject *self, PyObject *args, PyObj if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxFindWindowByLabel",_kwnames,&_obj0,&_argo1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } @@ -742,11 +887,22 @@ static PyObject *_wrap_wxFindWindowByName(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxFindWindowByName",_kwnames,&_obj0,&_argo1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } @@ -1284,11 +1440,22 @@ static PyObject *_wrap_wxCreateFileTipProvider(PyObject *self, PyObject *args, P if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxCreateFileTipProvider",_kwnames,&_obj0,&_arg1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1377,11 +1544,22 @@ static PyObject *_wrap_wxDragString(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OO:wxDragString",_kwnames,&_obj0,&_argo1,&_obj2)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } @@ -1711,11 +1889,22 @@ static PyObject *_wrap_wxExecute(PyObject *self, PyObject *args, PyObject *kwarg if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iO:wxExecute",_kwnames,&_obj0,&_arg1,&_argo2)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_argo2) { if (_argo2 == Py_None) { _arg2 = NULL; } @@ -1750,11 +1939,22 @@ static PyObject *_wrap_new_wxToolTip(PyObject *self, PyObject *args, PyObject *k if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxToolTip",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1795,11 +1995,22 @@ static PyObject *_wrap_wxToolTip_SetTip(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3789,11 +4000,22 @@ static PyObject *_wrap_wxLog_AddTraceMask(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxLog_AddTraceMask",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -3819,11 +4041,22 @@ static PyObject *_wrap_wxLog_RemoveTraceMask(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxLog_RemoveTraceMask",_kwnames,&_obj0)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4851,7 +5084,1228 @@ static PyObject *_wrap_wxProcess_CloseOutput(PyObject *self, PyObject *args, PyO return _resultobj; } +#define new_wxJoystick(_swigarg0) (new wxJoystick(_swigarg0)) +static PyObject *_wrap_new_wxJoystick(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxJoystick * _result; + int _arg0 = (int ) wxJOYSTICK1; + char *_kwnames[] = { "joystick", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|i:new_wxJoystick",_kwnames,&_arg0)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxJoystick *)new_wxJoystick(_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxJoystick_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxJoystick_GetPosition(_swigobj) (_swigobj->GetPosition()) +static PyObject *_wrap_wxJoystick_GetPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPoint * _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetPosition",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetPosition. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxPoint (wxJoystick_GetPosition(_arg0)); + + wxPy_END_ALLOW_THREADS; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPoint_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +#define wxJoystick_GetZPosition(_swigobj) (_swigobj->GetZPosition()) +static PyObject *_wrap_wxJoystick_GetZPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetZPosition",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetZPosition. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetZPosition(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetButtonState(_swigobj) (_swigobj->GetButtonState()) +static PyObject *_wrap_wxJoystick_GetButtonState(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetButtonState",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetButtonState. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetButtonState(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetPOVPosition(_swigobj) (_swigobj->GetPOVPosition()) +static PyObject *_wrap_wxJoystick_GetPOVPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetPOVPosition",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetPOVPosition. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetPOVPosition(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetPOVCTSPosition(_swigobj) (_swigobj->GetPOVCTSPosition()) +static PyObject *_wrap_wxJoystick_GetPOVCTSPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetPOVCTSPosition",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetPOVCTSPosition. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetPOVCTSPosition(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetRudderPosition(_swigobj) (_swigobj->GetRudderPosition()) +static PyObject *_wrap_wxJoystick_GetRudderPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetRudderPosition",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetRudderPosition. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetRudderPosition(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetUPosition(_swigobj) (_swigobj->GetUPosition()) +static PyObject *_wrap_wxJoystick_GetUPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetUPosition",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetUPosition. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetUPosition(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetVPosition(_swigobj) (_swigobj->GetVPosition()) +static PyObject *_wrap_wxJoystick_GetVPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetVPosition",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetVPosition. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetVPosition(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetMovementThreshold(_swigobj) (_swigobj->GetMovementThreshold()) +static PyObject *_wrap_wxJoystick_GetMovementThreshold(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetMovementThreshold",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetMovementThreshold. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetMovementThreshold(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_SetMovementThreshold(_swigobj,_swigarg0) (_swigobj->SetMovementThreshold(_swigarg0)) +static PyObject *_wrap_wxJoystick_SetMovementThreshold(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxJoystick * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","threshold", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxJoystick_SetMovementThreshold",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_SetMovementThreshold. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxJoystick_SetMovementThreshold(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxJoystick_IsOk(_swigobj) (_swigobj->IsOk()) +static PyObject *_wrap_wxJoystick_IsOk(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_IsOk",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_IsOk. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_IsOk(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetNumberJoysticks(_swigobj) (_swigobj->GetNumberJoysticks()) +static PyObject *_wrap_wxJoystick_GetNumberJoysticks(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetNumberJoysticks",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetNumberJoysticks. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetNumberJoysticks(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetManufacturerId(_swigobj) (_swigobj->GetManufacturerId()) +static PyObject *_wrap_wxJoystick_GetManufacturerId(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetManufacturerId",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetManufacturerId. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetManufacturerId(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetProductId(_swigobj) (_swigobj->GetProductId()) +static PyObject *_wrap_wxJoystick_GetProductId(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetProductId",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetProductId. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetProductId(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetProductName(_swigobj) (_swigobj->GetProductName()) +static PyObject *_wrap_wxJoystick_GetProductName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetProductName",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetProductName. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxJoystick_GetProductName(_arg0)); + + wxPy_END_ALLOW_THREADS; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} + return _resultobj; +} + +#define wxJoystick_GetXMin(_swigobj) (_swigobj->GetXMin()) +static PyObject *_wrap_wxJoystick_GetXMin(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetXMin",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetXMin. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetXMin(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetYMin(_swigobj) (_swigobj->GetYMin()) +static PyObject *_wrap_wxJoystick_GetYMin(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetYMin",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetYMin. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetYMin(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetZMin(_swigobj) (_swigobj->GetZMin()) +static PyObject *_wrap_wxJoystick_GetZMin(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetZMin",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetZMin. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetZMin(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetXMax(_swigobj) (_swigobj->GetXMax()) +static PyObject *_wrap_wxJoystick_GetXMax(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetXMax",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetXMax. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetXMax(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetYMax(_swigobj) (_swigobj->GetYMax()) +static PyObject *_wrap_wxJoystick_GetYMax(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetYMax",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetYMax. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetYMax(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetZMax(_swigobj) (_swigobj->GetZMax()) +static PyObject *_wrap_wxJoystick_GetZMax(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetZMax",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetZMax. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetZMax(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetNumberButtons(_swigobj) (_swigobj->GetNumberButtons()) +static PyObject *_wrap_wxJoystick_GetNumberButtons(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetNumberButtons",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetNumberButtons. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetNumberButtons(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetNumberAxes(_swigobj) (_swigobj->GetNumberAxes()) +static PyObject *_wrap_wxJoystick_GetNumberAxes(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetNumberAxes",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetNumberAxes. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetNumberAxes(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetMaxButtons(_swigobj) (_swigobj->GetMaxButtons()) +static PyObject *_wrap_wxJoystick_GetMaxButtons(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetMaxButtons",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetMaxButtons. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetMaxButtons(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetMaxAxes(_swigobj) (_swigobj->GetMaxAxes()) +static PyObject *_wrap_wxJoystick_GetMaxAxes(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetMaxAxes",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetMaxAxes. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetMaxAxes(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetPollingMin(_swigobj) (_swigobj->GetPollingMin()) +static PyObject *_wrap_wxJoystick_GetPollingMin(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetPollingMin",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetPollingMin. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetPollingMin(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetPollingMax(_swigobj) (_swigobj->GetPollingMax()) +static PyObject *_wrap_wxJoystick_GetPollingMax(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetPollingMax",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetPollingMax. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetPollingMax(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetRudderMin(_swigobj) (_swigobj->GetRudderMin()) +static PyObject *_wrap_wxJoystick_GetRudderMin(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetRudderMin",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetRudderMin. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetRudderMin(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetRudderMax(_swigobj) (_swigobj->GetRudderMax()) +static PyObject *_wrap_wxJoystick_GetRudderMax(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetRudderMax",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetRudderMax. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetRudderMax(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetUMin(_swigobj) (_swigobj->GetUMin()) +static PyObject *_wrap_wxJoystick_GetUMin(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetUMin",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetUMin. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetUMin(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetUMax(_swigobj) (_swigobj->GetUMax()) +static PyObject *_wrap_wxJoystick_GetUMax(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetUMax",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetUMax. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetUMax(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetVMin(_swigobj) (_swigobj->GetVMin()) +static PyObject *_wrap_wxJoystick_GetVMin(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetVMin",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetVMin. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetVMin(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_GetVMax(_swigobj) (_swigobj->GetVMax()) +static PyObject *_wrap_wxJoystick_GetVMax(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_GetVMax",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_GetVMax. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxJoystick_GetVMax(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_HasRudder(_swigobj) (_swigobj->HasRudder()) +static PyObject *_wrap_wxJoystick_HasRudder(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_HasRudder",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_HasRudder. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_HasRudder(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_HasZ(_swigobj) (_swigobj->HasZ()) +static PyObject *_wrap_wxJoystick_HasZ(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_HasZ",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_HasZ. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_HasZ(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_HasU(_swigobj) (_swigobj->HasU()) +static PyObject *_wrap_wxJoystick_HasU(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_HasU",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_HasU. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_HasU(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_HasV(_swigobj) (_swigobj->HasV()) +static PyObject *_wrap_wxJoystick_HasV(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_HasV",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_HasV. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_HasV(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_HasPOV(_swigobj) (_swigobj->HasPOV()) +static PyObject *_wrap_wxJoystick_HasPOV(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_HasPOV",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_HasPOV. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_HasPOV(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_HasPOV4Dir(_swigobj) (_swigobj->HasPOV4Dir()) +static PyObject *_wrap_wxJoystick_HasPOV4Dir(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_HasPOV4Dir",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_HasPOV4Dir. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_HasPOV4Dir(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_HasPOVCTS(_swigobj) (_swigobj->HasPOVCTS()) +static PyObject *_wrap_wxJoystick_HasPOVCTS(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_HasPOVCTS",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_HasPOVCTS. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_HasPOVCTS(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_SetCapture(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetCapture(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxJoystick_SetCapture(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + wxWindow * _arg1; + int _arg2 = (int ) 0; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","win","pollingFreq", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxJoystick_SetCapture",_kwnames,&_argo0,&_argo1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_SetCapture. Expected _wxJoystick_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxJoystick_SetCapture. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_SetCapture(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxJoystick_ReleaseCapture(_swigobj) (_swigobj->ReleaseCapture()) +static PyObject *_wrap_wxJoystick_ReleaseCapture(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxJoystick_ReleaseCapture",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxJoystick_ReleaseCapture. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxJoystick_ReleaseCapture(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static PyMethodDef misc2cMethods[] = { + { "wxJoystick_ReleaseCapture", (PyCFunction) _wrap_wxJoystick_ReleaseCapture, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_SetCapture", (PyCFunction) _wrap_wxJoystick_SetCapture, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_HasPOVCTS", (PyCFunction) _wrap_wxJoystick_HasPOVCTS, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_HasPOV4Dir", (PyCFunction) _wrap_wxJoystick_HasPOV4Dir, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_HasPOV", (PyCFunction) _wrap_wxJoystick_HasPOV, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_HasV", (PyCFunction) _wrap_wxJoystick_HasV, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_HasU", (PyCFunction) _wrap_wxJoystick_HasU, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_HasZ", (PyCFunction) _wrap_wxJoystick_HasZ, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_HasRudder", (PyCFunction) _wrap_wxJoystick_HasRudder, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetVMax", (PyCFunction) _wrap_wxJoystick_GetVMax, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetVMin", (PyCFunction) _wrap_wxJoystick_GetVMin, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetUMax", (PyCFunction) _wrap_wxJoystick_GetUMax, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetUMin", (PyCFunction) _wrap_wxJoystick_GetUMin, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetRudderMax", (PyCFunction) _wrap_wxJoystick_GetRudderMax, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetRudderMin", (PyCFunction) _wrap_wxJoystick_GetRudderMin, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetPollingMax", (PyCFunction) _wrap_wxJoystick_GetPollingMax, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetPollingMin", (PyCFunction) _wrap_wxJoystick_GetPollingMin, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetMaxAxes", (PyCFunction) _wrap_wxJoystick_GetMaxAxes, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetMaxButtons", (PyCFunction) _wrap_wxJoystick_GetMaxButtons, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetNumberAxes", (PyCFunction) _wrap_wxJoystick_GetNumberAxes, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetNumberButtons", (PyCFunction) _wrap_wxJoystick_GetNumberButtons, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetZMax", (PyCFunction) _wrap_wxJoystick_GetZMax, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetYMax", (PyCFunction) _wrap_wxJoystick_GetYMax, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetXMax", (PyCFunction) _wrap_wxJoystick_GetXMax, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetZMin", (PyCFunction) _wrap_wxJoystick_GetZMin, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetYMin", (PyCFunction) _wrap_wxJoystick_GetYMin, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetXMin", (PyCFunction) _wrap_wxJoystick_GetXMin, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetProductName", (PyCFunction) _wrap_wxJoystick_GetProductName, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetProductId", (PyCFunction) _wrap_wxJoystick_GetProductId, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetManufacturerId", (PyCFunction) _wrap_wxJoystick_GetManufacturerId, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetNumberJoysticks", (PyCFunction) _wrap_wxJoystick_GetNumberJoysticks, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_IsOk", (PyCFunction) _wrap_wxJoystick_IsOk, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_SetMovementThreshold", (PyCFunction) _wrap_wxJoystick_SetMovementThreshold, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetMovementThreshold", (PyCFunction) _wrap_wxJoystick_GetMovementThreshold, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetVPosition", (PyCFunction) _wrap_wxJoystick_GetVPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetUPosition", (PyCFunction) _wrap_wxJoystick_GetUPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetRudderPosition", (PyCFunction) _wrap_wxJoystick_GetRudderPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetPOVCTSPosition", (PyCFunction) _wrap_wxJoystick_GetPOVCTSPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetPOVPosition", (PyCFunction) _wrap_wxJoystick_GetPOVPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetButtonState", (PyCFunction) _wrap_wxJoystick_GetButtonState, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetZPosition", (PyCFunction) _wrap_wxJoystick_GetZPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxJoystick_GetPosition", (PyCFunction) _wrap_wxJoystick_GetPosition, METH_VARARGS | METH_KEYWORDS }, + { "new_wxJoystick", (PyCFunction) _wrap_new_wxJoystick, METH_VARARGS | METH_KEYWORDS }, { "wxProcess_CloseOutput", (PyCFunction) _wrap_wxProcess_CloseOutput, METH_VARARGS | METH_KEYWORDS }, { "wxProcess_GetOutputStream", (PyCFunction) _wrap_wxProcess_GetOutputStream, METH_VARARGS | METH_KEYWORDS }, { "wxProcess_GetErrorStream", (PyCFunction) _wrap_wxProcess_GetErrorStream, METH_VARARGS | METH_KEYWORDS }, @@ -5197,6 +6651,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBusyInfo","_class_wxBusyInfo",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}, @@ -5321,6 +6776,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPyDropTarget","_class_wxPyDropTarget",0}, { "_wxActivateEvent","_class_wxActivateEvent",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, diff --git a/wxPython/src/msw/misc2.py b/wxPython/src/msw/misc2.py index ab39918201..ea88f93e61 100644 --- a/wxPython/src/msw/misc2.py +++ b/wxPython/src/msw/misc2.py @@ -471,6 +471,147 @@ class wxProcess(wxProcessPtr): +class wxJoystickPtr : + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetPosition(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetPosition,(self,) + _args, _kwargs) + if val: val = wxPointPtr(val) ; val.thisown = 1 + return val + def GetZPosition(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetZPosition,(self,) + _args, _kwargs) + return val + def GetButtonState(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetButtonState,(self,) + _args, _kwargs) + return val + def GetPOVPosition(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetPOVPosition,(self,) + _args, _kwargs) + return val + def GetPOVCTSPosition(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetPOVCTSPosition,(self,) + _args, _kwargs) + return val + def GetRudderPosition(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetRudderPosition,(self,) + _args, _kwargs) + return val + def GetUPosition(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetUPosition,(self,) + _args, _kwargs) + return val + def GetVPosition(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetVPosition,(self,) + _args, _kwargs) + return val + def GetMovementThreshold(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetMovementThreshold,(self,) + _args, _kwargs) + return val + def SetMovementThreshold(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_SetMovementThreshold,(self,) + _args, _kwargs) + return val + def IsOk(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_IsOk,(self,) + _args, _kwargs) + return val + def GetNumberJoysticks(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetNumberJoysticks,(self,) + _args, _kwargs) + return val + def GetManufacturerId(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetManufacturerId,(self,) + _args, _kwargs) + return val + def GetProductId(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetProductId,(self,) + _args, _kwargs) + return val + def GetProductName(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetProductName,(self,) + _args, _kwargs) + return val + def GetXMin(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetXMin,(self,) + _args, _kwargs) + return val + def GetYMin(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetYMin,(self,) + _args, _kwargs) + return val + def GetZMin(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetZMin,(self,) + _args, _kwargs) + return val + def GetXMax(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetXMax,(self,) + _args, _kwargs) + return val + def GetYMax(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetYMax,(self,) + _args, _kwargs) + return val + def GetZMax(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetZMax,(self,) + _args, _kwargs) + return val + def GetNumberButtons(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetNumberButtons,(self,) + _args, _kwargs) + return val + def GetNumberAxes(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetNumberAxes,(self,) + _args, _kwargs) + return val + def GetMaxButtons(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetMaxButtons,(self,) + _args, _kwargs) + return val + def GetMaxAxes(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetMaxAxes,(self,) + _args, _kwargs) + return val + def GetPollingMin(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetPollingMin,(self,) + _args, _kwargs) + return val + def GetPollingMax(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetPollingMax,(self,) + _args, _kwargs) + return val + def GetRudderMin(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetRudderMin,(self,) + _args, _kwargs) + return val + def GetRudderMax(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetRudderMax,(self,) + _args, _kwargs) + return val + def GetUMin(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetUMin,(self,) + _args, _kwargs) + return val + def GetUMax(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetUMax,(self,) + _args, _kwargs) + return val + def GetVMin(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetVMin,(self,) + _args, _kwargs) + return val + def GetVMax(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_GetVMax,(self,) + _args, _kwargs) + return val + def HasRudder(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_HasRudder,(self,) + _args, _kwargs) + return val + def HasZ(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_HasZ,(self,) + _args, _kwargs) + return val + def HasU(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_HasU,(self,) + _args, _kwargs) + return val + def HasV(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_HasV,(self,) + _args, _kwargs) + return val + def HasPOV(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_HasPOV,(self,) + _args, _kwargs) + return val + def HasPOV4Dir(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_HasPOV4Dir,(self,) + _args, _kwargs) + return val + def HasPOVCTS(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_HasPOVCTS,(self,) + _args, _kwargs) + return val + def SetCapture(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_SetCapture,(self,) + _args, _kwargs) + return val + def ReleaseCapture(self, *_args, **_kwargs): + val = apply(misc2c.wxJoystick_ReleaseCapture,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxJoystick(wxJoystickPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(misc2c.new_wxJoystick,_args,_kwargs) + self.thisown = 1 + + + + #-------------- FUNCTION WRAPPERS ------------------ diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp index b61c2601e1..faba8817ca 100644 --- a/wxPython/src/msw/printfw.cpp +++ b/wxPython/src/msw/printfw.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -62,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); @@ -84,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; @@ -580,11 +581,22 @@ static PyObject *_wrap_wxPrintData_SetPrinterName(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4143,11 +4155,22 @@ static PyObject *_wrap_new_wxPreviewFrame(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { diff --git a/wxPython/src/msw/sizers.cpp b/wxPython/src/msw/sizers.cpp index 5c93701808..54ebaf3eba 100644 --- a/wxPython/src/msw/sizers.cpp +++ b/wxPython/src/msw/sizers.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -58,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); @@ -80,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; diff --git a/wxPython/src/msw/stattool.cpp b/wxPython/src/msw/stattool.cpp index f1c8308492..bd837ca799 100644 --- a/wxPython/src/msw/stattool.cpp +++ b/wxPython/src/msw/stattool.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -60,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); @@ -82,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; @@ -381,11 +382,22 @@ static PyObject *_wrap_wxStatusBar_SetStatusText(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1068,11 +1080,22 @@ static PyObject *_wrap_wxToolBarToolBase_SetShortHelp(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1108,11 +1131,22 @@ static PyObject *_wrap_wxToolBarToolBase_SetLongHelp(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1415,19 +1449,41 @@ static PyObject *_wrap_wxToolBarBase_AddTool(PyObject *self, PyObject *args, PyO } if (_obj6) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj6) && !PyUnicode_Check(_obj6)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj6, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg6 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj6)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg6 = new wxString(PyString_AsString(_obj6), PyString_Size(_obj6)); + _arg6 = new wxString(PyString_AS_STRING(_obj6), PyString_GET_SIZE(_obj6)); +#endif } if (_obj7) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj7) && !PyUnicode_Check(_obj7)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj7, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg7 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj7)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg7 = new wxString(PyString_AsString(_obj7), PyString_Size(_obj7)); + _arg7 = new wxString(PyString_AS_STRING(_obj7), PyString_GET_SIZE(_obj7)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1491,19 +1547,41 @@ static PyObject *_wrap_wxToolBarBase_AddSimpleTool(PyObject *self, PyObject *arg } if (_obj3) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } if (_obj4) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj4) && !PyUnicode_Check(_obj4)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj4, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg4 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj4)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg4 = new wxString(PyString_AsString(_obj4), PyString_Size(_obj4)); + _arg4 = new wxString(PyString_AS_STRING(_obj4), PyString_GET_SIZE(_obj4)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1586,19 +1664,41 @@ static PyObject *_wrap_wxToolBarBase_InsertTool(PyObject *self, PyObject *args, } if (_obj7) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj7) && !PyUnicode_Check(_obj7)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj7, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg7 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj7)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg7 = new wxString(PyString_AsString(_obj7), PyString_Size(_obj7)); + _arg7 = new wxString(PyString_AS_STRING(_obj7), PyString_GET_SIZE(_obj7)); +#endif } if (_obj8) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj8) && !PyUnicode_Check(_obj8)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj8, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg8 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj8)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg8 = new wxString(PyString_AsString(_obj8), PyString_Size(_obj8)); + _arg8 = new wxString(PyString_AS_STRING(_obj8), PyString_GET_SIZE(_obj8)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1663,19 +1763,41 @@ static PyObject *_wrap_wxToolBarBase_InsertSimpleTool(PyObject *self, PyObject * } if (_obj4) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj4) && !PyUnicode_Check(_obj4)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj4, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg4 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj4)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg4 = new wxString(PyString_AsString(_obj4), PyString_Size(_obj4)); + _arg4 = new wxString(PyString_AS_STRING(_obj4), PyString_GET_SIZE(_obj4)); +#endif } if (_obj5) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj5) && !PyUnicode_Check(_obj5)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj5, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg5 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj5)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg5 = new wxString(PyString_AsString(_obj5), PyString_Size(_obj5)); + _arg5 = new wxString(PyString_AS_STRING(_obj5), PyString_GET_SIZE(_obj5)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2245,11 +2367,22 @@ static PyObject *_wrap_wxToolBarBase_SetToolShortHelp(PyObject *self, PyObject * } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2319,11 +2452,22 @@ static PyObject *_wrap_wxToolBarBase_SetToolLongHelp(PyObject *self, PyObject *a } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/streams.cpp b/wxPython/src/msw/streams.cpp index fbea578e45..c391ffde0f 100644 --- a/wxPython/src/msw/streams.cpp +++ b/wxPython/src/msw/streams.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -60,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); @@ -82,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; @@ -702,11 +703,22 @@ static PyObject *_wrap_wxOutputStream_write(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxOutputStream_write(_arg0,*_arg1); diff --git a/wxPython/src/msw/utils.cpp b/wxPython/src/msw/utils.cpp index c594f0632a..03558621af 100644 --- a/wxPython/src/msw/utils.cpp +++ b/wxPython/src/msw/utils.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -61,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); @@ -83,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; @@ -378,11 +379,22 @@ static PyObject *_wrap_wxConfigBase_DeleteEntry(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } _arg2 = (bool ) tempbool2; { @@ -419,11 +431,22 @@ static PyObject *_wrap_wxConfigBase_DeleteGroup(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -459,11 +482,22 @@ static PyObject *_wrap_wxConfigBase_Exists(PyObject *self, PyObject *args, PyObj } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -829,11 +863,22 @@ static PyObject *_wrap_wxConfigBase_HasEntry(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -869,11 +914,22 @@ static PyObject *_wrap_wxConfigBase_HasGroup(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -965,19 +1021,41 @@ static PyObject *_wrap_wxConfigBase_Read(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1023,11 +1101,22 @@ static PyObject *_wrap_wxConfigBase_ReadInt(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1064,11 +1153,22 @@ static PyObject *_wrap_wxConfigBase_ReadFloat(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1133,11 +1233,22 @@ static PyObject *_wrap_wxConfigBase_SetPath(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1203,11 +1314,22 @@ static PyObject *_wrap_wxConfigBase_SetAppName(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1243,11 +1365,22 @@ static PyObject *_wrap_wxConfigBase_SetVendorName(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1341,18 +1474,40 @@ static PyObject *_wrap_wxConfigBase_Write(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1393,11 +1548,22 @@ static PyObject *_wrap_wxConfigBase_WriteInt(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1434,11 +1600,22 @@ static PyObject *_wrap_wxConfigBase_WriteFloat(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1474,11 +1651,22 @@ static PyObject *_wrap_wxConfigBase_GetEntryType(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1516,18 +1704,40 @@ static PyObject *_wrap_wxConfigBase_RenameEntry(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1569,18 +1779,40 @@ static PyObject *_wrap_wxConfigBase_RenameGroup(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1620,11 +1852,22 @@ static PyObject *_wrap_wxConfigBase_ExpandEnvVars(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1673,35 +1916,79 @@ static PyObject *_wrap_new_wxConfig(PyObject *self, PyObject *args, PyObject *kw return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_obj1) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1790,35 +2077,79 @@ static PyObject *_wrap_new_wxFileConfig(PyObject *self, PyObject *args, PyObject return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } if (_obj1) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2121,18 +2452,40 @@ static PyObject *_wrap_wxDateTime_GetAmPmStrings(PyObject *self, PyObject *args, if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_GetAmPmStrings",_kwnames,&_obj0,&_obj1)) return NULL; { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 4bee7e82c8..878f002f01 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -1479,11 +1479,22 @@ static PyObject *_wrap_wxWindow_FindWindowByName(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1996,11 +2007,22 @@ static PyObject *_wrap_wxWindow_SetLabel(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2377,11 +2399,22 @@ static PyObject *_wrap_wxWindow_GetTextExtent(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2449,11 +2482,22 @@ static PyObject *_wrap_wxWindow_GetFullTextExtent(PyObject *self, PyObject *args } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } @@ -2962,11 +3006,22 @@ static PyObject *_wrap_wxWindow_LoadFromResource(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } @@ -3928,11 +3983,22 @@ static PyObject *_wrap_wxWindow_SetName(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4345,11 +4411,22 @@ static PyObject *_wrap_wxWindow_SetTitle(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -4673,11 +4750,22 @@ static PyObject *_wrap_wxWindow_SetToolTipString(PyObject *self, PyObject *args, } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -5295,11 +5383,22 @@ static PyObject *_wrap_new_wxDialog(PyObject *self, PyObject *args, PyObject *kw } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { @@ -5554,11 +5653,22 @@ static PyObject *_wrap_wxDialog_SetTitle(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6360,11 +6470,22 @@ static PyObject *_wrap_new_wxMenu(PyObject *self, PyObject *args, PyObject *kwar return NULL; if (_obj0) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj0)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6409,19 +6530,41 @@ static PyObject *_wrap_wxMenu_Append(PyObject *self, PyObject *args, PyObject *k } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6466,11 +6609,22 @@ static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } @@ -6481,11 +6635,22 @@ static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObjec } if (_obj4) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj4) && !PyUnicode_Check(_obj4)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj4, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg4 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj4)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg4 = new wxString(PyString_AsString(_obj4), PyString_Size(_obj4)); + _arg4 = new wxString(PyString_AS_STRING(_obj4), PyString_GET_SIZE(_obj4)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6734,11 +6899,22 @@ static PyObject *_wrap_wxMenu_FindItem(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6840,11 +7016,22 @@ static PyObject *_wrap_wxMenu_SetTitle(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6914,11 +7101,22 @@ static PyObject *_wrap_wxMenu_SetLabel(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -6988,11 +7186,22 @@ static PyObject *_wrap_wxMenu_SetHelpString(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -7709,11 +7918,22 @@ static PyObject *_wrap_wxMenuBar_Append(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -7759,11 +7979,22 @@ static PyObject *_wrap_wxMenuBar_Insert(PyObject *self, PyObject *args, PyObject } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -7872,11 +8103,22 @@ static PyObject *_wrap_wxMenuBar_Replace(PyObject *self, PyObject *args, PyObjec } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -7984,11 +8226,22 @@ static PyObject *_wrap_wxMenuBar_SetLabelTop(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -8060,18 +8313,40 @@ static PyObject *_wrap_wxMenuBar_FindMenuItem(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -8264,11 +8539,22 @@ static PyObject *_wrap_wxMenuBar_SetLabel(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -8338,11 +8624,22 @@ static PyObject *_wrap_wxMenuBar_SetHelpString(PyObject *self, PyObject *args, P } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -8421,19 +8718,41 @@ static PyObject *_wrap_new_wxMenuItem(PyObject *self, PyObject *args, PyObject * } if (_obj2) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } if (_obj3) { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } _arg4 = (bool ) tempbool4; if (_argo5) { @@ -8602,11 +8921,22 @@ static PyObject *_wrap_wxMenuItem_SetText(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -8999,11 +9329,22 @@ static PyObject *_wrap_wxMenuItem_SetHelp(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; diff --git a/wxPython/src/msw/windows2.cpp b/wxPython/src/msw/windows2.cpp index 110282526d..7f74455f7a 100644 --- a/wxPython/src/msw/windows2.cpp +++ b/wxPython/src/msw/windows2.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -66,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); @@ -88,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; @@ -461,11 +462,22 @@ static PyObject *_wrap_wxNotebook_SetPageText(PyObject *self, PyObject *args, Py } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -852,11 +864,22 @@ static PyObject *_wrap_wxNotebook_AddPage(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AsString(_obj2), PyString_Size(_obj2)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -905,11 +928,22 @@ static PyObject *_wrap_wxNotebook_InsertPage(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg3 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AsString(_obj3), PyString_Size(_obj3)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); +#endif } _arg4 = (bool ) tempbool4; { diff --git a/wxPython/src/msw/windows3.cpp b/wxPython/src/msw/windows3.cpp index ec6e100e57..4a668a6f81 100644 --- a/wxPython/src/msw/windows3.cpp +++ b/wxPython/src/msw/windows3.cpp @@ -3,7 +3,7 @@ * * This file was automatically generated by : * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Build 810) + * Version 1.1 (Build 883) * * Portions Copyright (c) 1995-1998 * The University of Utah and The Regents of the University of California. @@ -41,6 +41,7 @@ #ifdef __cplusplus extern "C" { #endif + extern void SWIG_MakePtr(char *, void *, char *); extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); extern char *SWIG_GetPtr(char *, void **, char *); @@ -60,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); @@ -82,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/wx.cpp b/wxPython/src/msw/wx.cpp index 9945b8bc47..0b7f33e6fa 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -1402,11 +1402,22 @@ static PyObject *_wrap_wxPyApp_SetAppName(PyObject *self, PyObject *args, PyObje } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1472,11 +1483,22 @@ static PyObject *_wrap_wxPyApp_SetClassName(PyObject *self, PyObject *args, PyOb } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -1606,11 +1628,22 @@ static PyObject *_wrap_wxPyApp_SetVendorName(PyObject *self, PyObject *args, PyO } } { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; @@ -2025,6 +2058,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBusyInfo","_class_wxBusyInfo",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}, @@ -2203,6 +2237,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_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, @@ -2552,6 +2587,13 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxLI_VERTICAL", PyInt_FromLong((long) wxLI_VERTICAL)); PyDict_SetItemString(d,"wxHW_SCROLLBAR_NEVER", PyInt_FromLong((long) wxHW_SCROLLBAR_NEVER)); PyDict_SetItemString(d,"wxHW_SCROLLBAR_AUTO", PyInt_FromLong((long) wxHW_SCROLLBAR_AUTO)); + PyDict_SetItemString(d,"wxJOYSTICK1", PyInt_FromLong((long) wxJOYSTICK1)); + PyDict_SetItemString(d,"wxJOYSTICK2", PyInt_FromLong((long) wxJOYSTICK2)); + PyDict_SetItemString(d,"wxJOY_BUTTON1", PyInt_FromLong((long) wxJOY_BUTTON1)); + PyDict_SetItemString(d,"wxJOY_BUTTON2", PyInt_FromLong((long) wxJOY_BUTTON2)); + PyDict_SetItemString(d,"wxJOY_BUTTON3", PyInt_FromLong((long) wxJOY_BUTTON3)); + PyDict_SetItemString(d,"wxJOY_BUTTON4", PyInt_FromLong((long) wxJOY_BUTTON4)); + PyDict_SetItemString(d,"wxJOY_BUTTON_ANY", PyInt_FromLong((long) wxJOY_BUTTON_ANY)); PyDict_SetItemString(d,"wxDEFAULT", PyInt_FromLong((long) wxDEFAULT)); PyDict_SetItemString(d,"wxDECORATIVE", PyInt_FromLong((long) wxDECORATIVE)); PyDict_SetItemString(d,"wxROMAN", PyInt_FromLong((long) wxROMAN)); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index be3ac2ec4f..1f385d3112 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -454,6 +454,13 @@ wxLI_HORIZONTAL = wxc.wxLI_HORIZONTAL wxLI_VERTICAL = wxc.wxLI_VERTICAL wxHW_SCROLLBAR_NEVER = wxc.wxHW_SCROLLBAR_NEVER wxHW_SCROLLBAR_AUTO = wxc.wxHW_SCROLLBAR_AUTO +wxJOYSTICK1 = wxc.wxJOYSTICK1 +wxJOYSTICK2 = wxc.wxJOYSTICK2 +wxJOY_BUTTON1 = wxc.wxJOY_BUTTON1 +wxJOY_BUTTON2 = wxc.wxJOY_BUTTON2 +wxJOY_BUTTON3 = wxc.wxJOY_BUTTON3 +wxJOY_BUTTON4 = wxc.wxJOY_BUTTON4 +wxJOY_BUTTON_ANY = wxc.wxJOY_BUTTON_ANY wxDEFAULT = wxc.wxDEFAULT wxDECORATIVE = wxc.wxDECORATIVE wxROMAN = wxc.wxROMAN @@ -1520,22 +1527,49 @@ def EVT_TIMER(win, id, func): def EVT_END_PROCESS(eh, id, func): eh.Connect(id, -1, wxEVT_END_PROCESS, func) + +# wxJoyStick +def EVT_JOY_DOWN(win, func): + win.Connect(-1, -1, wxEVT_JOY_DOWN, func) + +def EVT_JOY_UP(win, func): + win.Connect(-1, -1, wxEVT_JOY_UP, func) + +def EVT_JOY_MOVE(win, func): + win.Connect(-1, -1, wxEVT_JOY_MOVE, func) + +def EVT_JOY_ZMOVE(win, func): + win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) + +def EVT_JOYSTICK_EVENTS(win, func): + win.Connect(-1, -1, wxEVT_JOY_DOWN, func) + win.Connect(-1, -1, wxEVT_JOY_UP, func) + win.Connect(-1, -1, wxEVT_JOY_MOVE, func) + win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) + #---------------------------------------------------------------------- class wxTimer(wxPyTimer): - def __init__(self): - wxPyTimer.__init__(self, self.Notify) # derived class must provide - # Notify(self) method. + def __init__(self, evtHandler = None, id = -1): + if evtHandler is None: + wxPyTimer.__init__(self, self.Notify) # derived class must provide + # Notify(self) method. + else: + wxPyTimer.__init__(self, None) + self.SetOwner(evtHandler, id) #---------------------------------------------------------------------- # Some wxWin methods can take "NULL" as parameters, but the shadow classes # expect an object with the SWIG pointer as a 'this' member. This class # and instance fools the shadow into passing the NULL pointer. -class NullObj: +## NOTE: This is not needed anymore as None can be passed instead and +# will be interpreted as NULL. + +class _NullObj: this = 'NULL' # SWIG converts this to (void*)0 -NULL = NullObj() +NULL = _NullObj() #---------------------------------------------------------------------- diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 9ee9ee6479..b42c841801 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -162,13 +162,55 @@ static char* wxStringErrorMsg = "string type is required for parameter"; %} +// TODO: Which works best??? + +// Implementation #1 +// %typemap(python, in) wxString& (PyObject* temp, int tmpDoDecRef) { +// temp = $source; +// tmpDoDecRef = 0; +// #if PYTHON_API_VERSION >= 1009 +// if (PyUnicode_Check(temp) { +// temp = PyUnicode_AsUTF8String(temp); +// if (! temp) { +// PyErr_SetString(PyExc_TypeError, "Unicode encoding to UTF8 failed."); +// return NULL; +// } +// tmpDoDecRef = 1; +// #endif +// if (!PyString_Check(temp)) { +// PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); +// return NULL; +// } +// $target = new wxString(PyString_AsString(temp), PyString_Size(temp)); +// #if PYTHON_API_VERESION >= 1009 +// if (tmpDoDecRef) Py_DECREF(temp); +// #endif +// } + + +// Implementation #2 %typemap(python, in) wxString& { +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check($source) && !PyUnicode_Check($source)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize($source, &tmpPtr, &tmpSize) == -1) + return NULL; + $target = new wxString(tmpPtr, tmpSize); +#else if (!PyString_Check($source)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - $target = new wxString(PyString_AsString($source), PyString_Size($source)); + $target = new wxString(PyString_AS_STRING($source), PyString_GET_SIZE($source)); +#endif } + + + + %typemap(python, freearg) wxString& { if ($target) delete $source; diff --git a/wxPython/wxPython/lib/buttons.py b/wxPython/wxPython/lib/buttons.py index 1657983b85..6e3c713662 100644 --- a/wxPython/wxPython/lib/buttons.py +++ b/wxPython/wxPython/lib/buttons.py @@ -248,6 +248,7 @@ class wxGenButton(wxControl): self.CaptureMouse() self.SetFocus() self.Refresh() + event.Skip() def OnLeftUp(self, event): @@ -258,7 +259,7 @@ class wxGenButton(wxControl): self.up = true self.ReleaseMouse() self.Refresh() - + event.Skip() def OnMotion(self, event): if not self.IsEnabled(): @@ -274,6 +275,7 @@ class wxGenButton(wxControl): self.up = true self.Refresh() return + event.Skip() def OnGainFocus(self, event): -- 2.45.2