X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1893b029458c15069855bde50889d2a1a82a44e9..b89f0cb06a187c6fe7e75ab5aa359b019b8ff766:/wxPython/src/gtk/image.cpp diff --git a/wxPython/src/gtk/image.cpp b/wxPython/src/gtk/image.cpp index 6f1c5c5683..e20a4634dd 100644 --- a/wxPython/src/gtk/image.cpp +++ b/wxPython/src/gtk/image.cpp @@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "imagec" #include "helpers.h" +#include "pyistream.h" #include @@ -85,12 +86,6 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } -#if PYTHON_API_VERSION >= 1009 - static char* wxStringErrorMsg = "String or Unicode type required"; -#else - static char* wxStringErrorMsg = "String type required"; -#endif - wxImage* wxEmptyImage(int width=0, int height=0) { if (width == 0 && height == 0) return new wxImage; @@ -98,14 +93,17 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return new wxImage(width, height); } + wxImage* wxImageFromMime(const wxString& name, const wxString& mimetype, int index) { return new wxImage(name, mimetype, index); } + wxImage* wxImageFromBitmap(const wxBitmap &bitmap) { - return new wxImage(bitmap); + return new wxImage(bitmap.ConvertToImage()); } + wxImage* wxImageFromData(int width, int height, unsigned char* data) { // Copy the source data so the wxImage can clean it up later unsigned char* copy = (unsigned char*)malloc(width*height*3); @@ -117,6 +115,18 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return new wxImage(width, height, copy, FALSE); } + + wxImage* wxImageFromStream(wxInputStream& stream, + long type = wxBITMAP_TYPE_ANY, int index = -1) { + return new wxImage(stream, type, index); + } + + + wxImage* wxImageFromStreamMime(wxInputStream& stream, + const wxString& mimetype, int index = -1 ) { + return new wxImage(stream, mimetype, index); + } + #if 0 extern wxImage wxNullImage; @@ -142,7 +152,7 @@ static PyObject *_wrap_wxEmptyImage(PyObject *self, PyObject *args, PyObject *kw return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxImage *)wxEmptyImage(_arg0,_arg1); + _result = (wxImage *)wxEmptyImage(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -171,44 +181,18 @@ static PyObject *_wrap_wxImageFromMime(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxImageFromMime",_kwnames,&_obj0,&_obj1,&_arg2)) return NULL; { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _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, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) 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_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxImage *)wxImageFromMime(*_arg0,*_arg1,_arg2); + _result = (wxImage *)wxImageFromMime(*_arg0,*_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -250,7 +234,7 @@ static PyObject *_wrap_wxImageFromBitmap(PyObject *self, PyObject *args, PyObjec } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxImage *)wxImageFromBitmap(*_arg0); + _result = (wxImage *)wxImageFromBitmap(*_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -286,7 +270,7 @@ static PyObject *_wrap_wxImageFromData(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxImage *)wxImageFromData(_arg0,_arg1,_arg2); + _result = (wxImage *)wxImageFromData(_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -300,6 +284,112 @@ static PyObject *_wrap_wxImageFromData(PyObject *self, PyObject *args, PyObject return _resultobj; } +static PyObject *_wrap_wxImageFromStream(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxImage * _result; + wxInputStream * _arg0; + long _arg1 = (long ) wxBITMAP_TYPE_ANY; + int _arg2 = (int ) -1; + wxPyInputStream * temp; + bool created; + PyObject * _obj0 = 0; + char *_kwnames[] = { "stream","type","index", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|li:wxImageFromStream",_kwnames,&_obj0,&_arg1,&_arg2)) + return NULL; +{ + if (SWIG_GetPtrObj(_obj0, (void **) &temp, "_wxPyInputStream_p") == 0) { + _arg0 = temp->m_wxis; + created = FALSE; + } else { + _arg0 = wxPyCBInputStream::create(_obj0, FALSE); + if (_arg0 == NULL) { + PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object."); + return NULL; + } + created = TRUE; + } +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxImage *)wxImageFromStream(*_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxImage_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (created) + delete _arg0; +} + return _resultobj; +} + +static PyObject *_wrap_wxImageFromStreamMime(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxImage * _result; + wxInputStream * _arg0; + wxString * _arg1; + int _arg2 = (int ) -1; + wxPyInputStream * temp; + bool created; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "stream","mimetype","index", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxImageFromStreamMime",_kwnames,&_obj0,&_obj1,&_arg2)) + return NULL; +{ + if (SWIG_GetPtrObj(_obj0, (void **) &temp, "_wxPyInputStream_p") == 0) { + _arg0 = temp->m_wxis; + created = FALSE; + } else { + _arg0 = wxPyCBInputStream::create(_obj0, FALSE); + if (_arg0 == NULL) { + PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object."); + return NULL; + } + created = TRUE; + } +} +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxImage *)wxImageFromStreamMime(*_arg0,*_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxImage_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (created) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + static PyObject *_wrap_wxInitAllImageHandlers(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; char *_kwnames[] = { NULL }; @@ -309,7 +399,7 @@ static PyObject *_wrap_wxInitAllImageHandlers(PyObject *self, PyObject *args, Py return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxInitAllImageHandlers(); + wxInitAllImageHandlers(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -354,7 +444,7 @@ static PyObject *_wrap_wxBitmapFromImage(PyObject *self, PyObject *args, PyObjec } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxBitmap *)wxBitmapFromImage(*_arg0,_arg1); + _result = (wxBitmap *)wxBitmapFromImage(*_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -396,12 +486,16 @@ static PyObject *_wrap_wxImageHandler_GetName(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxImageHandler_GetName(_arg0)); + _result = new wxString (wxImageHandler_GetName(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -429,12 +523,16 @@ static PyObject *_wrap_wxImageHandler_GetExtension(PyObject *self, PyObject *arg } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxImageHandler_GetExtension(_arg0)); + _result = new wxString (wxImageHandler_GetExtension(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -462,7 +560,7 @@ static PyObject *_wrap_wxImageHandler_GetType(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (long )wxImageHandler_GetType(_arg0); + _result = (long )wxImageHandler_GetType(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -490,12 +588,16 @@ static PyObject *_wrap_wxImageHandler_GetMimeType(PyObject *self, PyObject *args } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxImageHandler_GetMimeType(_arg0)); + _result = new wxString (wxImageHandler_GetMimeType(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { delete _result; @@ -524,26 +626,13 @@ static PyObject *_wrap_wxImageHandler_CanRead(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, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImageHandler_CanRead(_arg0,*_arg1); + _result = (bool )wxImageHandler_CanRead(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -575,26 +664,13 @@ 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, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImageHandler_SetName(_arg0,*_arg1); + wxImageHandler_SetName(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -627,26 +703,13 @@ 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, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) 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_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImageHandler_SetExtension(_arg0,*_arg1); + wxImageHandler_SetExtension(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -679,7 +742,7 @@ static PyObject *_wrap_wxImageHandler_SetType(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImageHandler_SetType(_arg0,_arg1); + wxImageHandler_SetType(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -708,26 +771,13 @@ 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, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImageHandler_SetMimeType(_arg0,*_arg1); + wxImageHandler_SetMimeType(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -768,7 +818,7 @@ static PyObject *_wrap_new_wxPNGHandler(PyObject *self, PyObject *args, PyObject return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPNGHandler *)new_wxPNGHandler(); + _result = (wxPNGHandler *)new_wxPNGHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -810,7 +860,7 @@ static PyObject *_wrap_new_wxJPEGHandler(PyObject *self, PyObject *args, PyObjec return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxJPEGHandler *)new_wxJPEGHandler(); + _result = (wxJPEGHandler *)new_wxJPEGHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -852,7 +902,7 @@ static PyObject *_wrap_new_wxBMPHandler(PyObject *self, PyObject *args, PyObject return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxBMPHandler *)new_wxBMPHandler(); + _result = (wxBMPHandler *)new_wxBMPHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -902,7 +952,7 @@ static PyObject *_wrap_new_wxICOHandler(PyObject *self, PyObject *args, PyObject return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxICOHandler *)new_wxICOHandler(); + _result = (wxICOHandler *)new_wxICOHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -916,6 +966,130 @@ static PyObject *_wrap_new_wxICOHandler(PyObject *self, PyObject *args, PyObject return _resultobj; } +static void *SwigwxCURHandlerTowxICOHandler(void *ptr) { + wxCURHandler *src; + wxICOHandler *dest; + src = (wxCURHandler *) ptr; + dest = (wxICOHandler *) src; + return (void *) dest; +} + +static void *SwigwxCURHandlerTowxBMPHandler(void *ptr) { + wxCURHandler *src; + wxBMPHandler *dest; + src = (wxCURHandler *) ptr; + dest = (wxBMPHandler *) src; + return (void *) dest; +} + +static void *SwigwxCURHandlerTowxImageHandler(void *ptr) { + wxCURHandler *src; + wxImageHandler *dest; + src = (wxCURHandler *) ptr; + dest = (wxImageHandler *) src; + return (void *) dest; +} + +static void *SwigwxCURHandlerTowxObject(void *ptr) { + wxCURHandler *src; + wxObject *dest; + src = (wxCURHandler *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxCURHandler() (new wxCURHandler()) +static PyObject *_wrap_new_wxCURHandler(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCURHandler * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxCURHandler",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxCURHandler *)new_wxCURHandler(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxCURHandler_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +static void *SwigwxANIHandlerTowxCURHandler(void *ptr) { + wxANIHandler *src; + wxCURHandler *dest; + src = (wxANIHandler *) ptr; + dest = (wxCURHandler *) src; + return (void *) dest; +} + +static void *SwigwxANIHandlerTowxICOHandler(void *ptr) { + wxANIHandler *src; + wxICOHandler *dest; + src = (wxANIHandler *) ptr; + dest = (wxICOHandler *) src; + return (void *) dest; +} + +static void *SwigwxANIHandlerTowxBMPHandler(void *ptr) { + wxANIHandler *src; + wxBMPHandler *dest; + src = (wxANIHandler *) ptr; + dest = (wxBMPHandler *) src; + return (void *) dest; +} + +static void *SwigwxANIHandlerTowxImageHandler(void *ptr) { + wxANIHandler *src; + wxImageHandler *dest; + src = (wxANIHandler *) ptr; + dest = (wxImageHandler *) src; + return (void *) dest; +} + +static void *SwigwxANIHandlerTowxObject(void *ptr) { + wxANIHandler *src; + wxObject *dest; + src = (wxANIHandler *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxANIHandler() (new wxANIHandler()) +static PyObject *_wrap_new_wxANIHandler(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxANIHandler * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxANIHandler",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxANIHandler *)new_wxANIHandler(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxANIHandler_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + static void *SwigwxGIFHandlerTowxImageHandler(void *ptr) { wxGIFHandler *src; wxImageHandler *dest; @@ -944,7 +1118,7 @@ static PyObject *_wrap_new_wxGIFHandler(PyObject *self, PyObject *args, PyObject return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGIFHandler *)new_wxGIFHandler(); + _result = (wxGIFHandler *)new_wxGIFHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -986,7 +1160,7 @@ static PyObject *_wrap_new_wxPNMHandler(PyObject *self, PyObject *args, PyObject return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPNMHandler *)new_wxPNMHandler(); + _result = (wxPNMHandler *)new_wxPNMHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1028,7 +1202,7 @@ static PyObject *_wrap_new_wxPCXHandler(PyObject *self, PyObject *args, PyObject return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPCXHandler *)new_wxPCXHandler(); + _result = (wxPCXHandler *)new_wxPCXHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1070,7 +1244,7 @@ static PyObject *_wrap_new_wxTIFFHandler(PyObject *self, PyObject *args, PyObjec return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxTIFFHandler *)new_wxTIFFHandler(); + _result = (wxTIFFHandler *)new_wxTIFFHandler(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1107,26 +1281,13 @@ static PyObject *_wrap_new_wxImage(PyObject *self, PyObject *args, PyObject *kwa if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|li:new_wxImage",_kwnames,&_obj0,&_arg1,&_arg2)) return NULL; { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) 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_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxImage *)new_wxImage(*_arg0,_arg1,_arg2); + _result = (wxImage *)new_wxImage(*_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1163,7 +1324,7 @@ static PyObject *_wrap_delete_wxImage(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - delete_wxImage(_arg0); + delete_wxImage(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1172,69 +1333,6 @@ static PyObject *_wrap_delete_wxImage(PyObject *self, PyObject *args, PyObject * return _resultobj; } -#define wxImage_ConvertToBitmap(_swigobj) (_swigobj->ConvertToBitmap()) -static PyObject *_wrap_wxImage_ConvertToBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxBitmap * _result; - wxImage * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxImage_ConvertToBitmap",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_ConvertToBitmap. Expected _wxImage_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxBitmap (wxImage_ConvertToBitmap(_arg0)); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -#define wxImage_ConvertToMonoBitmap(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->ConvertToMonoBitmap(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxImage_ConvertToMonoBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxBitmap * _result; - wxImage * _arg0; - unsigned char _arg1; - unsigned char _arg2; - unsigned char _arg3; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","red","green","blue", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Obbb:wxImage_ConvertToMonoBitmap",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_ConvertToMonoBitmap. Expected _wxImage_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxBitmap (wxImage_ConvertToMonoBitmap(_arg0,_arg1,_arg2,_arg3)); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - #define wxImage_Create(_swigobj,_swigarg0,_swigarg1) (_swigobj->Create(_swigarg0,_swigarg1)) static PyObject *_wrap_wxImage_Create(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1256,7 +1354,7 @@ static PyObject *_wrap_wxImage_Create(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_Create(_arg0,_arg1,_arg2); + wxImage_Create(_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1284,7 +1382,7 @@ static PyObject *_wrap_wxImage_Destroy(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_Destroy(_arg0); + wxImage_Destroy(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1316,7 +1414,7 @@ static PyObject *_wrap_wxImage_Scale(PyObject *self, PyObject *args, PyObject *k } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxImage (wxImage_Scale(_arg0,_arg1,_arg2)); + _result = new wxImage (wxImage_Scale(_arg0,_arg1,_arg2)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1348,7 +1446,7 @@ static PyObject *_wrap_wxImage_Rescale(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage & _result_ref = wxImage_Rescale(_arg0,_arg1,_arg2); + wxImage & _result_ref = wxImage_Rescale(_arg0,_arg1,_arg2); _result = (wxImage *) &_result_ref; wxPyEndAllowThreads(__tstate); @@ -1387,7 +1485,7 @@ static PyObject *_wrap_wxImage_SetRGB(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_SetRGB(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5); + wxImage_SetRGB(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1418,7 +1516,7 @@ static PyObject *_wrap_wxImage_GetRed(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (unsigned char )wxImage_GetRed(_arg0,_arg1,_arg2); + _result = (unsigned char )wxImage_GetRed(_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1448,7 +1546,7 @@ static PyObject *_wrap_wxImage_GetGreen(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (unsigned char )wxImage_GetGreen(_arg0,_arg1,_arg2); + _result = (unsigned char )wxImage_GetGreen(_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1478,7 +1576,7 @@ static PyObject *_wrap_wxImage_GetBlue(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (unsigned char )wxImage_GetBlue(_arg0,_arg1,_arg2); + _result = (unsigned char )wxImage_GetBlue(_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1486,6 +1584,107 @@ static PyObject *_wrap_wxImage_GetBlue(PyObject *self, PyObject *args, PyObject return _resultobj; } +#define wxImage_FindFirstUnusedColour(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (_swigobj->FindFirstUnusedColour(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5)) +static PyObject *_wrap_wxImage_FindFirstUnusedColour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxImage * _arg0; + byte * _arg1; + int temp; + byte * _arg2; + int temp0; + byte * _arg3; + int temp1; + byte _arg4 = (byte ) 0; + byte _arg5 = (byte ) 0; + byte _arg6 = (byte ) 0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","startR","startG","startB", NULL }; + + self = self; +{ + _arg1 = (byte*)&temp; +} +{ + _arg2 = (byte*)&temp0; +} +{ + _arg3 = (byte*)&temp1; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|bbb:wxImage_FindFirstUnusedColour",_kwnames,&_argo0,&_arg4,&_arg5,&_arg6)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_FindFirstUnusedColour. Expected _wxImage_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxImage_FindFirstUnusedColour(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg1)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg2)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg3)); + _resultobj = t_output_helper(_resultobj, o); +} + return _resultobj; +} + +#define wxImage_SetMaskFromImage(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->SetMaskFromImage(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxImage_SetMaskFromImage(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxImage * _arg0; + wxImage * _arg1; + byte _arg2; + byte _arg3; + byte _arg4; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","mask","mr","mg","mb", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OObbb:wxImage_SetMaskFromImage",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_arg4)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_SetMaskFromImage. Expected _wxImage_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxImage_SetMaskFromImage. Expected _wxImage_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxImage_SetMaskFromImage(_arg0,*_arg1,_arg2,_arg3,_arg4); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static PyObject *_wrap_wxImage_CanRead(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; @@ -1497,26 +1696,13 @@ static PyObject *_wrap_wxImage_CanRead(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxImage_CanRead",_kwnames,&_obj0)) return NULL; { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage::CanRead(*_arg0); + _result = (bool )wxImage::CanRead(*_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1540,80 +1726,145 @@ static PyObject *_wrap_wxImage_GetImageCount(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|l:wxImage_GetImageCount",_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, wxStringErrorMsg); + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (int )wxImage::GetImageCount(*_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj0) + delete _arg0; +} + return _resultobj; +} + +#define wxImage_LoadFile(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFile(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxImage_LoadFile(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxImage * _arg0; + wxString * _arg1; + long _arg2 = (long ) wxBITMAP_TYPE_ANY; + int _arg3 = (int ) -1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","name","type","index", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|li:wxImage_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2,&_arg3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_LoadFile. Expected _wxImage_p."); + return NULL; + } + } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxImage_LoadFile(_arg0,*_arg1,_arg2,_arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxImage_LoadMimeFile(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFile(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxImage_LoadMimeFile(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxImage * _arg0; + wxString * _arg1; + wxString * _arg2; + int _arg3 = (int ) -1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","name","mimetype","index", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|i:wxImage_LoadMimeFile",_kwnames,&_argo0,&_obj1,&_obj2,&_arg3)) return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_LoadMimeFile. Expected _wxImage_p."); + return NULL; + } } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); +} +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxImage::GetImageCount(*_arg0,_arg1); + _result = (bool )wxImage_LoadMimeFile(_arg0,*_arg1,*_arg2,_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { - if (_obj0) - delete _arg0; + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; } return _resultobj; } -#define wxImage_LoadFile(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFile(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxImage_LoadFile(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxImage_SaveFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->SaveFile(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxImage_SaveFile(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxImage * _arg0; wxString * _arg1; - long _arg2 = (long ) wxBITMAP_TYPE_ANY; - int _arg3 = (int ) -1; + int _arg2; PyObject * _argo0 = 0; PyObject * _obj1 = 0; - char *_kwnames[] = { "self","name","type","index", NULL }; + char *_kwnames[] = { "self","name","type", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|li:wxImage_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxImage_SaveFile",_kwnames,&_argo0,&_obj1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_LoadFile. Expected _wxImage_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_SaveFile. Expected _wxImage_p."); return NULL; } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) 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_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage_LoadFile(_arg0,*_arg1,_arg2,_arg3); + _result = (bool )wxImage_SaveFile(_arg0,*_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1625,68 +1876,41 @@ static PyObject *_wrap_wxImage_LoadFile(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxImage_LoadMimeFile(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFile(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxImage_LoadMimeFile(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxImage_SaveMimeFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->SaveFile(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxImage_SaveMimeFile(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxImage * _arg0; wxString * _arg1; wxString * _arg2; - int _arg3 = (int ) -1; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","name","mimetype","index", NULL }; + char *_kwnames[] = { "self","name","mimetype", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|i:wxImage_LoadMimeFile",_kwnames,&_argo0,&_obj1,&_obj2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxImage_SaveMimeFile",_kwnames,&_argo0,&_obj1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_LoadMimeFile. Expected _wxImage_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_SaveMimeFile. Expected _wxImage_p."); return NULL; } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _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, wxStringErrorMsg); - 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); + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage_LoadMimeFile(_arg0,*_arg1,*_arg2,_arg3); + _result = (bool )wxImage_SaveMimeFile(_arg0,*_arg1,*_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1702,126 +1926,148 @@ static PyObject *_wrap_wxImage_LoadMimeFile(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxImage_SaveFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->SaveFile(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxImage_SaveFile(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_wxImage_CanReadStream(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxInputStream * _arg0; + wxPyInputStream * temp; + bool created; + PyObject * _obj0 = 0; + char *_kwnames[] = { "stream", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxImage_CanReadStream",_kwnames,&_obj0)) + return NULL; +{ + if (SWIG_GetPtrObj(_obj0, (void **) &temp, "_wxPyInputStream_p") == 0) { + _arg0 = temp->m_wxis; + created = FALSE; + } else { + _arg0 = wxPyCBInputStream::create(_obj0, FALSE); + if (_arg0 == NULL) { + PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object."); + return NULL; + } + created = TRUE; + } +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxImage::CanRead(*_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (created) + delete _arg0; +} + return _resultobj; +} + +#define wxImage_LoadStream(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFile(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxImage_LoadStream(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxImage * _arg0; - wxString * _arg1; - int _arg2; + wxInputStream * _arg1; + long _arg2 = (long ) wxBITMAP_TYPE_ANY; + int _arg3 = (int ) -1; PyObject * _argo0 = 0; + wxPyInputStream * temp; + bool created; PyObject * _obj1 = 0; - char *_kwnames[] = { "self","name","type", NULL }; + char *_kwnames[] = { "self","stream","type","index", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxImage_SaveFile",_kwnames,&_argo0,&_obj1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|li:wxImage_LoadStream",_kwnames,&_argo0,&_obj1,&_arg2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_SaveFile. Expected _wxImage_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_LoadStream. Expected _wxImage_p."); return NULL; } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - 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; + if (SWIG_GetPtrObj(_obj1, (void **) &temp, "_wxPyInputStream_p") == 0) { + _arg1 = temp->m_wxis; + created = FALSE; + } else { + _arg1 = wxPyCBInputStream::create(_obj1, FALSE); + if (_arg1 == NULL) { + PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object."); + return NULL; + } + created = TRUE; } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage_SaveFile(_arg0,*_arg1,_arg2); + _result = (bool )wxImage_LoadStream(_arg0,*_arg1,_arg2,_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { - if (_obj1) + if (created) delete _arg1; } return _resultobj; } -#define wxImage_SaveMimeFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->SaveFile(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxImage_SaveMimeFile(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxImage_LoadMimeStream(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->LoadFile(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxImage_LoadMimeStream(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; wxImage * _arg0; - wxString * _arg1; + wxInputStream * _arg1; wxString * _arg2; + int _arg3 = (int ) -1; PyObject * _argo0 = 0; + wxPyInputStream * temp; + bool created; PyObject * _obj1 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","name","mimetype", NULL }; + char *_kwnames[] = { "self","stream","mimetype","index", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxImage_SaveMimeFile",_kwnames,&_argo0,&_obj1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|i:wxImage_LoadMimeStream",_kwnames,&_argo0,&_obj1,&_obj2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_SaveMimeFile. Expected _wxImage_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_LoadMimeStream. Expected _wxImage_p."); return NULL; } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - 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; + if (SWIG_GetPtrObj(_obj1, (void **) &temp, "_wxPyInputStream_p") == 0) { + _arg1 = temp->m_wxis; + created = FALSE; + } else { + _arg1 = wxPyCBInputStream::create(_obj1, FALSE); + if (_arg1 == NULL) { + PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object."); + return NULL; + } + created = TRUE; } - _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, wxStringErrorMsg); + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) 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_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage_SaveMimeFile(_arg0,*_arg1,*_arg2); + _result = (bool )wxImage_LoadMimeStream(_arg0,*_arg1,*_arg2,_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { - if (_obj1) + if (created) delete _arg1; } { @@ -1851,7 +2097,7 @@ static PyObject *_wrap_wxImage_Ok(PyObject *self, PyObject *args, PyObject *kwar } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage_Ok(_arg0); + _result = (bool )wxImage_Ok(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1879,7 +2125,7 @@ static PyObject *_wrap_wxImage_GetWidth(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxImage_GetWidth(_arg0); + _result = (int )wxImage_GetWidth(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1907,7 +2153,7 @@ static PyObject *_wrap_wxImage_GetHeight(PyObject *self, PyObject *args, PyObjec } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxImage_GetHeight(_arg0); + _result = (int )wxImage_GetHeight(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1944,7 +2190,7 @@ static PyObject *_wrap_wxImage_GetSubImage(PyObject *self, PyObject *args, PyObj } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxImage (wxImage_GetSubImage(_arg0,*_arg1)); + _result = new wxImage (wxImage_GetSubImage(_arg0,*_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1974,7 +2220,7 @@ static PyObject *_wrap_wxImage_Copy(PyObject *self, PyObject *args, PyObject *kw } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxImage (wxImage_Copy(_arg0)); + _result = new wxImage (wxImage_Copy(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2013,7 +2259,7 @@ static PyObject *_wrap_wxImage_Paste(PyObject *self, PyObject *args, PyObject *k } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_Paste(_arg0,*_arg1,_arg2,_arg3); + wxImage_Paste(_arg0,*_arg1,_arg2,_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2022,6 +2268,40 @@ static PyObject *_wrap_wxImage_Paste(PyObject *self, PyObject *args, PyObject *k return _resultobj; } +static PyObject * wxImage_GetDataBuffer(wxImage *self) { + unsigned char* data = self->GetData(); + int len = self->GetWidth() * self->GetHeight() * 3; + return PyBuffer_FromReadWriteMemory(data, len); + } +static PyObject *_wrap_wxImage_GetDataBuffer(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + PyObject * _result; + wxImage * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxImage_GetDataBuffer",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_GetDataBuffer. Expected _wxImage_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (PyObject *)wxImage_GetDataBuffer(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = _result; +} + return _resultobj; +} + static PyObject * wxImage_GetData(wxImage *self) { unsigned char* data = self->GetData(); int len = self->GetWidth() * self->GetHeight() * 3; @@ -2046,7 +2326,7 @@ static PyObject *_wrap_wxImage_GetData(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (PyObject *)wxImage_GetData(_arg0); + _result = (PyObject *)wxImage_GetData(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2092,7 +2372,7 @@ static PyObject *_wrap_wxImage_SetData(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_SetData(_arg0,_arg1); + wxImage_SetData(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2123,7 +2403,7 @@ static PyObject *_wrap_wxImage_SetMaskColour(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_SetMaskColour(_arg0,_arg1,_arg2,_arg3); + wxImage_SetMaskColour(_arg0,_arg1,_arg2,_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2152,7 +2432,7 @@ static PyObject *_wrap_wxImage_GetMaskRed(PyObject *self, PyObject *args, PyObje } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (unsigned char )wxImage_GetMaskRed(_arg0); + _result = (unsigned char )wxImage_GetMaskRed(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2180,7 +2460,7 @@ static PyObject *_wrap_wxImage_GetMaskGreen(PyObject *self, PyObject *args, PyOb } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (unsigned char )wxImage_GetMaskGreen(_arg0); + _result = (unsigned char )wxImage_GetMaskGreen(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2208,7 +2488,7 @@ static PyObject *_wrap_wxImage_GetMaskBlue(PyObject *self, PyObject *args, PyObj } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (unsigned char )wxImage_GetMaskBlue(_arg0); + _result = (unsigned char )wxImage_GetMaskBlue(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2238,7 +2518,7 @@ static PyObject *_wrap_wxImage_SetMask(PyObject *self, PyObject *args, PyObject _arg1 = (bool ) tempbool1; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_SetMask(_arg0,_arg1); + wxImage_SetMask(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2267,7 +2547,7 @@ static PyObject *_wrap_wxImage_HasMask(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage_HasMask(_arg0); + _result = (bool )wxImage_HasMask(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2317,7 +2597,7 @@ static PyObject *_wrap_wxImage_Rotate(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxImage (wxImage_Rotate(_arg0,_arg1,*_arg2,_arg3,_arg4)); + _result = new wxImage (wxImage_Rotate(_arg0,_arg1,*_arg2,_arg3,_arg4)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2350,7 +2630,7 @@ static PyObject *_wrap_wxImage_Rotate90(PyObject *self, PyObject *args, PyObject _arg1 = (bool ) tempbool1; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxImage (wxImage_Rotate90(_arg0,_arg1)); + _result = new wxImage (wxImage_Rotate90(_arg0,_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2383,7 +2663,7 @@ static PyObject *_wrap_wxImage_Mirror(PyObject *self, PyObject *args, PyObject * _arg1 = (bool ) tempbool1; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxImage (wxImage_Mirror(_arg0,_arg1)); + _result = new wxImage (wxImage_Mirror(_arg0,_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2417,7 +2697,7 @@ static PyObject *_wrap_wxImage_Replace(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_Replace(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); + wxImage_Replace(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2450,7 +2730,7 @@ static PyObject *_wrap_wxImage_ConvertToMono(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxImage (wxImage_ConvertToMono(_arg0,_arg1,_arg2,_arg3)); + _result = new wxImage (wxImage_ConvertToMono(_arg0,_arg1,_arg2,_arg3)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2481,44 +2761,18 @@ static PyObject *_wrap_wxImage_SetOption(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, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _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, wxStringErrorMsg); - 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); + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_SetOption(_arg0,*_arg1,*_arg2); + wxImage_SetOption(_arg0,*_arg1,*_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2556,26 +2810,13 @@ static PyObject *_wrap_wxImage_SetOptionInt(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, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_SetOptionInt(_arg0,*_arg1,_arg2); + wxImage_SetOptionInt(_arg0,*_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2609,31 +2850,22 @@ static PyObject *_wrap_wxImage_GetOption(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, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxImage_GetOption(_arg0,*_arg1)); + _result = new wxString (wxImage_GetOption(_arg0,*_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif } { if (_obj1) @@ -2666,26 +2898,13 @@ static PyObject *_wrap_wxImage_GetOptionInt(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, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxImage_GetOptionInt(_arg0,*_arg1); + _result = (int )wxImage_GetOptionInt(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2718,26 +2937,13 @@ static PyObject *_wrap_wxImage_HasOption(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, wxStringErrorMsg); - 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); + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage_HasOption(_arg0,*_arg1); + _result = (bool )wxImage_HasOption(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2770,7 +2976,7 @@ static PyObject *_wrap_wxImage_CountColours(PyObject *self, PyObject *args, PyOb } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (unsigned long )wxImage_CountColours(_arg0,_arg1); + _result = (unsigned long )wxImage_CountColours(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2796,7 +3002,7 @@ static PyObject *_wrap_wxImage_AddHandler(PyObject *self, PyObject *args, PyObje } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage::AddHandler(_arg0); + wxImage::AddHandler(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2823,7 +3029,7 @@ static PyObject *_wrap_wxImage_InsertHandler(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage::InsertHandler(_arg0); + wxImage::InsertHandler(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2843,26 +3049,13 @@ static PyObject *_wrap_wxImage_RemoveHandler(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxImage_RemoveHandler",_kwnames,&_obj0)) return NULL; { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - 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); + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxImage::RemoveHandler(*_arg0); + _result = (bool )wxImage::RemoveHandler(*_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2874,7 +3067,79 @@ static PyObject *_wrap_wxImage_RemoveHandler(PyObject *self, PyObject *args, PyO return _resultobj; } +static wxBitmap wxImage_ConvertToBitmap(wxImage *self) { + wxBitmap bitmap(*self); + return bitmap; + } +static PyObject *_wrap_wxImage_ConvertToBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmap * _result; + wxImage * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxImage_ConvertToBitmap",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_ConvertToBitmap. Expected _wxImage_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxBitmap (wxImage_ConvertToBitmap(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +static wxBitmap wxImage_ConvertToMonoBitmap(wxImage *self,unsigned char red,unsigned char green,unsigned char blue) { + wxImage mono = self->ConvertToMono( red, green, blue ); + wxBitmap bitmap( mono, 1 ); + return bitmap; + } +static PyObject *_wrap_wxImage_ConvertToMonoBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmap * _result; + wxImage * _arg0; + unsigned char _arg1; + unsigned char _arg2; + unsigned char _arg3; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","red","green","blue", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Obbb:wxImage_ConvertToMonoBitmap",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_ConvertToMonoBitmap. Expected _wxImage_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxBitmap (wxImage_ConvertToMonoBitmap(_arg0,_arg1,_arg2,_arg3)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + static PyMethodDef imagecMethods[] = { + { "wxImage_ConvertToMonoBitmap", (PyCFunction) _wrap_wxImage_ConvertToMonoBitmap, METH_VARARGS | METH_KEYWORDS }, + { "wxImage_ConvertToBitmap", (PyCFunction) _wrap_wxImage_ConvertToBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxImage_RemoveHandler", (PyCFunction) _wrap_wxImage_RemoveHandler, METH_VARARGS | METH_KEYWORDS }, { "wxImage_InsertHandler", (PyCFunction) _wrap_wxImage_InsertHandler, METH_VARARGS | METH_KEYWORDS }, { "wxImage_AddHandler", (PyCFunction) _wrap_wxImage_AddHandler, METH_VARARGS | METH_KEYWORDS }, @@ -2897,18 +3162,24 @@ static PyMethodDef imagecMethods[] = { { "wxImage_SetMaskColour", (PyCFunction) _wrap_wxImage_SetMaskColour, METH_VARARGS | METH_KEYWORDS }, { "wxImage_SetData", (PyCFunction) _wrap_wxImage_SetData, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetData", (PyCFunction) _wrap_wxImage_GetData, METH_VARARGS | METH_KEYWORDS }, + { "wxImage_GetDataBuffer", (PyCFunction) _wrap_wxImage_GetDataBuffer, METH_VARARGS | METH_KEYWORDS }, { "wxImage_Paste", (PyCFunction) _wrap_wxImage_Paste, METH_VARARGS | METH_KEYWORDS }, { "wxImage_Copy", (PyCFunction) _wrap_wxImage_Copy, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetSubImage", (PyCFunction) _wrap_wxImage_GetSubImage, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetHeight", (PyCFunction) _wrap_wxImage_GetHeight, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetWidth", (PyCFunction) _wrap_wxImage_GetWidth, METH_VARARGS | METH_KEYWORDS }, { "wxImage_Ok", (PyCFunction) _wrap_wxImage_Ok, METH_VARARGS | METH_KEYWORDS }, + { "wxImage_LoadMimeStream", (PyCFunction) _wrap_wxImage_LoadMimeStream, METH_VARARGS | METH_KEYWORDS }, + { "wxImage_LoadStream", (PyCFunction) _wrap_wxImage_LoadStream, METH_VARARGS | METH_KEYWORDS }, + { "wxImage_CanReadStream", (PyCFunction) _wrap_wxImage_CanReadStream, METH_VARARGS | METH_KEYWORDS }, { "wxImage_SaveMimeFile", (PyCFunction) _wrap_wxImage_SaveMimeFile, METH_VARARGS | METH_KEYWORDS }, { "wxImage_SaveFile", (PyCFunction) _wrap_wxImage_SaveFile, METH_VARARGS | METH_KEYWORDS }, { "wxImage_LoadMimeFile", (PyCFunction) _wrap_wxImage_LoadMimeFile, METH_VARARGS | METH_KEYWORDS }, { "wxImage_LoadFile", (PyCFunction) _wrap_wxImage_LoadFile, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetImageCount", (PyCFunction) _wrap_wxImage_GetImageCount, METH_VARARGS | METH_KEYWORDS }, { "wxImage_CanRead", (PyCFunction) _wrap_wxImage_CanRead, METH_VARARGS | METH_KEYWORDS }, + { "wxImage_SetMaskFromImage", (PyCFunction) _wrap_wxImage_SetMaskFromImage, METH_VARARGS | METH_KEYWORDS }, + { "wxImage_FindFirstUnusedColour", (PyCFunction) _wrap_wxImage_FindFirstUnusedColour, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetBlue", (PyCFunction) _wrap_wxImage_GetBlue, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetGreen", (PyCFunction) _wrap_wxImage_GetGreen, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetRed", (PyCFunction) _wrap_wxImage_GetRed, METH_VARARGS | METH_KEYWORDS }, @@ -2917,14 +3188,14 @@ static PyMethodDef imagecMethods[] = { { "wxImage_Scale", (PyCFunction) _wrap_wxImage_Scale, METH_VARARGS | METH_KEYWORDS }, { "wxImage_Destroy", (PyCFunction) _wrap_wxImage_Destroy, METH_VARARGS | METH_KEYWORDS }, { "wxImage_Create", (PyCFunction) _wrap_wxImage_Create, METH_VARARGS | METH_KEYWORDS }, - { "wxImage_ConvertToMonoBitmap", (PyCFunction) _wrap_wxImage_ConvertToMonoBitmap, METH_VARARGS | METH_KEYWORDS }, - { "wxImage_ConvertToBitmap", (PyCFunction) _wrap_wxImage_ConvertToBitmap, METH_VARARGS | METH_KEYWORDS }, { "delete_wxImage", (PyCFunction) _wrap_delete_wxImage, METH_VARARGS | METH_KEYWORDS }, { "new_wxImage", (PyCFunction) _wrap_new_wxImage, METH_VARARGS | METH_KEYWORDS }, { "new_wxTIFFHandler", (PyCFunction) _wrap_new_wxTIFFHandler, METH_VARARGS | METH_KEYWORDS }, { "new_wxPCXHandler", (PyCFunction) _wrap_new_wxPCXHandler, METH_VARARGS | METH_KEYWORDS }, { "new_wxPNMHandler", (PyCFunction) _wrap_new_wxPNMHandler, METH_VARARGS | METH_KEYWORDS }, { "new_wxGIFHandler", (PyCFunction) _wrap_new_wxGIFHandler, METH_VARARGS | METH_KEYWORDS }, + { "new_wxANIHandler", (PyCFunction) _wrap_new_wxANIHandler, METH_VARARGS | METH_KEYWORDS }, + { "new_wxCURHandler", (PyCFunction) _wrap_new_wxCURHandler, METH_VARARGS | METH_KEYWORDS }, { "new_wxICOHandler", (PyCFunction) _wrap_new_wxICOHandler, METH_VARARGS | METH_KEYWORDS }, { "new_wxBMPHandler", (PyCFunction) _wrap_new_wxBMPHandler, METH_VARARGS | METH_KEYWORDS }, { "new_wxJPEGHandler", (PyCFunction) _wrap_new_wxJPEGHandler, METH_VARARGS | METH_KEYWORDS }, @@ -2940,6 +3211,8 @@ static PyMethodDef imagecMethods[] = { { "wxImageHandler_GetName", (PyCFunction) _wrap_wxImageHandler_GetName, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapFromImage", (PyCFunction) _wrap_wxBitmapFromImage, METH_VARARGS | METH_KEYWORDS }, { "wxInitAllImageHandlers", (PyCFunction) _wrap_wxInitAllImageHandlers, METH_VARARGS | METH_KEYWORDS }, + { "wxImageFromStreamMime", (PyCFunction) _wrap_wxImageFromStreamMime, METH_VARARGS | METH_KEYWORDS }, + { "wxImageFromStream", (PyCFunction) _wrap_wxImageFromStream, METH_VARARGS | METH_KEYWORDS }, { "wxImageFromData", (PyCFunction) _wrap_wxImageFromData, METH_VARARGS | METH_KEYWORDS }, { "wxImageFromBitmap", (PyCFunction) _wrap_wxImageFromBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxImageFromMime", (PyCFunction) _wrap_wxImageFromMime, METH_VARARGS | METH_KEYWORDS }, @@ -2954,7 +3227,11 @@ static PyMethodDef imagecMethods[] = { */ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_long","_long",0}, + { "_wxBMPHandler","_wxANIHandler",SwigwxANIHandlerTowxBMPHandler}, + { "_wxBMPHandler","_wxCURHandler",SwigwxCURHandlerTowxBMPHandler}, { "_wxBMPHandler","_wxICOHandler",SwigwxICOHandlerTowxBMPHandler}, + { "_wxICOHandler","_wxANIHandler",SwigwxANIHandlerTowxICOHandler}, + { "_wxICOHandler","_wxCURHandler",SwigwxCURHandlerTowxICOHandler}, { "_wxPrintQuality","_wxCoord",0}, { "_wxPrintQuality","_int",0}, { "_wxPrintQuality","_signed_int",0}, @@ -2968,6 +3245,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxImageHandler","_wxPCXHandler",SwigwxPCXHandlerTowxImageHandler}, { "_wxImageHandler","_wxPNMHandler",SwigwxPNMHandlerTowxImageHandler}, { "_wxImageHandler","_wxGIFHandler",SwigwxGIFHandlerTowxImageHandler}, + { "_wxImageHandler","_wxANIHandler",SwigwxANIHandlerTowxImageHandler}, + { "_wxImageHandler","_wxCURHandler",SwigwxCURHandlerTowxImageHandler}, { "_wxImageHandler","_wxICOHandler",SwigwxICOHandlerTowxImageHandler}, { "_wxImageHandler","_wxBMPHandler",SwigwxBMPHandlerTowxImageHandler}, { "_wxImageHandler","_wxJPEGHandler",SwigwxJPEGHandlerTowxImageHandler}, @@ -3014,6 +3293,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxPCXHandler",SwigwxPCXHandlerTowxObject}, { "_wxObject","_wxPNMHandler",SwigwxPNMHandlerTowxObject}, { "_wxObject","_wxGIFHandler",SwigwxGIFHandlerTowxObject}, + { "_wxObject","_wxANIHandler",SwigwxANIHandlerTowxObject}, + { "_wxObject","_wxCURHandler",SwigwxCURHandlerTowxObject}, { "_wxObject","_wxICOHandler",SwigwxICOHandlerTowxObject}, { "_wxObject","_wxBMPHandler",SwigwxBMPHandlerTowxObject}, { "_wxObject","_wxJPEGHandler",SwigwxJPEGHandlerTowxObject}, @@ -3021,6 +3302,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxImageHandler",SwigwxImageHandlerTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, + { "_wxCURHandler","_wxANIHandler",SwigwxANIHandlerTowxCURHandler}, { "_unsigned_char","_byte",0}, { "_unsigned_int","_wxCoord",0}, { "_unsigned_int","_wxPrintQuality",0},