From 066efa7cf1e3062139e71e6bb58a6a76788ee671 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 18 Jun 2007 18:57:24 +0000 Subject: [PATCH] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gtk/_core.py | 16 ++ wxPython/src/gtk/_core_wrap.cpp | 256 +++++++++++++++++++++++++------- wxPython/src/gtk/_gdi.py | 4 +- wxPython/src/mac/_core.py | 16 ++ wxPython/src/mac/_core_wrap.cpp | 256 +++++++++++++++++++++++++------- wxPython/src/mac/_gdi.py | 4 +- wxPython/src/msw/_core.py | 16 ++ wxPython/src/msw/_core_wrap.cpp | 256 +++++++++++++++++++++++++------- wxPython/src/msw/_gdi.py | 4 +- 9 files changed, 654 insertions(+), 174 deletions(-) diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index c067efca10..3e7e437781 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -2920,6 +2920,22 @@ class Image(Object): """ return _core_.Image_SaveMimeFile(*args, **kwargs) + def SaveStream(*args, **kwargs): + """ + SaveStream(self, wxOutputStream stream, int type) -> bool + + Saves an image in the named file. + """ + return _core_.Image_SaveStream(*args, **kwargs) + + def SaveMimeStream(*args, **kwargs): + """ + SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool + + Saves an image in the named file. + """ + return _core_.Image_SaveMimeStream(*args, **kwargs) + def CanReadStream(*args, **kwargs): """ CanReadStream(InputStream stream) -> bool diff --git a/wxPython/src/gtk/_core_wrap.cpp b/wxPython/src/gtk/_core_wrap.cpp index 33d691d154..781055a57e 100644 --- a/wxPython/src/gtk/_core_wrap.cpp +++ b/wxPython/src/gtk/_core_wrap.cpp @@ -2551,62 +2551,63 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_wxNcPaintEvent swig_types[85] #define SWIGTYPE_p_wxNotifyEvent swig_types[86] #define SWIGTYPE_p_wxObject swig_types[87] -#define SWIGTYPE_p_wxPCXHandler swig_types[88] -#define SWIGTYPE_p_wxPNGHandler swig_types[89] -#define SWIGTYPE_p_wxPNMHandler swig_types[90] -#define SWIGTYPE_p_wxPaintEvent swig_types[91] -#define SWIGTYPE_p_wxPaletteChangedEvent swig_types[92] -#define SWIGTYPE_p_wxPaperSize swig_types[93] -#define SWIGTYPE_p_wxPoint swig_types[94] -#define SWIGTYPE_p_wxPoint2D swig_types[95] -#define SWIGTYPE_p_wxPropagateOnce swig_types[96] -#define SWIGTYPE_p_wxPropagationDisabler swig_types[97] -#define SWIGTYPE_p_wxPyApp swig_types[98] -#define SWIGTYPE_p_wxPyCommandEvent swig_types[99] -#define SWIGTYPE_p_wxPyDropTarget swig_types[100] -#define SWIGTYPE_p_wxPyEvent swig_types[101] -#define SWIGTYPE_p_wxPyFileSystemHandler swig_types[102] -#define SWIGTYPE_p_wxPyImageHandler swig_types[103] -#define SWIGTYPE_p_wxPyInputStream swig_types[104] -#define SWIGTYPE_p_wxPyOutputStream swig_types[105] -#define SWIGTYPE_p_wxPySizer swig_types[106] -#define SWIGTYPE_p_wxPyValidator swig_types[107] -#define SWIGTYPE_p_wxQuantize swig_types[108] -#define SWIGTYPE_p_wxQueryNewPaletteEvent swig_types[109] -#define SWIGTYPE_p_wxRealPoint swig_types[110] -#define SWIGTYPE_p_wxRect swig_types[111] -#define SWIGTYPE_p_wxRect2D swig_types[112] -#define SWIGTYPE_p_wxRegion swig_types[113] -#define SWIGTYPE_p_wxScrollEvent swig_types[114] -#define SWIGTYPE_p_wxScrollWinEvent swig_types[115] -#define SWIGTYPE_p_wxSetCursorEvent swig_types[116] -#define SWIGTYPE_p_wxShowEvent swig_types[117] -#define SWIGTYPE_p_wxSize swig_types[118] -#define SWIGTYPE_p_wxSizeEvent swig_types[119] -#define SWIGTYPE_p_wxSizer swig_types[120] -#define SWIGTYPE_p_wxSizerFlags swig_types[121] -#define SWIGTYPE_p_wxSizerItem swig_types[122] -#define SWIGTYPE_p_wxSizerItemList swig_types[123] -#define SWIGTYPE_p_wxSizerItemList_iterator swig_types[124] -#define SWIGTYPE_p_wxStaticBox swig_types[125] -#define SWIGTYPE_p_wxStaticBoxSizer swig_types[126] -#define SWIGTYPE_p_wxStdDialogButtonSizer swig_types[127] -#define SWIGTYPE_p_wxSysColourChangedEvent swig_types[128] -#define SWIGTYPE_p_wxTGAHandler swig_types[129] -#define SWIGTYPE_p_wxTIFFHandler swig_types[130] -#define SWIGTYPE_p_wxToolTip swig_types[131] -#define SWIGTYPE_p_wxUpdateUIEvent swig_types[132] -#define SWIGTYPE_p_wxValidator swig_types[133] -#define SWIGTYPE_p_wxVisualAttributes swig_types[134] -#define SWIGTYPE_p_wxWindow swig_types[135] -#define SWIGTYPE_p_wxWindowCreateEvent swig_types[136] -#define SWIGTYPE_p_wxWindowDestroyEvent swig_types[137] -#define SWIGTYPE_p_wxWindowList swig_types[138] -#define SWIGTYPE_p_wxWindowList_iterator swig_types[139] -#define SWIGTYPE_p_wxXPMHandler swig_types[140] -#define SWIGTYPE_p_wxZipFSHandler swig_types[141] -static swig_type_info *swig_types[143]; -static swig_module_info swig_module = {swig_types, 142, 0, 0, 0, 0}; +#define SWIGTYPE_p_wxOutputStream swig_types[88] +#define SWIGTYPE_p_wxPCXHandler swig_types[89] +#define SWIGTYPE_p_wxPNGHandler swig_types[90] +#define SWIGTYPE_p_wxPNMHandler swig_types[91] +#define SWIGTYPE_p_wxPaintEvent swig_types[92] +#define SWIGTYPE_p_wxPaletteChangedEvent swig_types[93] +#define SWIGTYPE_p_wxPaperSize swig_types[94] +#define SWIGTYPE_p_wxPoint swig_types[95] +#define SWIGTYPE_p_wxPoint2D swig_types[96] +#define SWIGTYPE_p_wxPropagateOnce swig_types[97] +#define SWIGTYPE_p_wxPropagationDisabler swig_types[98] +#define SWIGTYPE_p_wxPyApp swig_types[99] +#define SWIGTYPE_p_wxPyCommandEvent swig_types[100] +#define SWIGTYPE_p_wxPyDropTarget swig_types[101] +#define SWIGTYPE_p_wxPyEvent swig_types[102] +#define SWIGTYPE_p_wxPyFileSystemHandler swig_types[103] +#define SWIGTYPE_p_wxPyImageHandler swig_types[104] +#define SWIGTYPE_p_wxPyInputStream swig_types[105] +#define SWIGTYPE_p_wxPyOutputStream swig_types[106] +#define SWIGTYPE_p_wxPySizer swig_types[107] +#define SWIGTYPE_p_wxPyValidator swig_types[108] +#define SWIGTYPE_p_wxQuantize swig_types[109] +#define SWIGTYPE_p_wxQueryNewPaletteEvent swig_types[110] +#define SWIGTYPE_p_wxRealPoint swig_types[111] +#define SWIGTYPE_p_wxRect swig_types[112] +#define SWIGTYPE_p_wxRect2D swig_types[113] +#define SWIGTYPE_p_wxRegion swig_types[114] +#define SWIGTYPE_p_wxScrollEvent swig_types[115] +#define SWIGTYPE_p_wxScrollWinEvent swig_types[116] +#define SWIGTYPE_p_wxSetCursorEvent swig_types[117] +#define SWIGTYPE_p_wxShowEvent swig_types[118] +#define SWIGTYPE_p_wxSize swig_types[119] +#define SWIGTYPE_p_wxSizeEvent swig_types[120] +#define SWIGTYPE_p_wxSizer swig_types[121] +#define SWIGTYPE_p_wxSizerFlags swig_types[122] +#define SWIGTYPE_p_wxSizerItem swig_types[123] +#define SWIGTYPE_p_wxSizerItemList swig_types[124] +#define SWIGTYPE_p_wxSizerItemList_iterator swig_types[125] +#define SWIGTYPE_p_wxStaticBox swig_types[126] +#define SWIGTYPE_p_wxStaticBoxSizer swig_types[127] +#define SWIGTYPE_p_wxStdDialogButtonSizer swig_types[128] +#define SWIGTYPE_p_wxSysColourChangedEvent swig_types[129] +#define SWIGTYPE_p_wxTGAHandler swig_types[130] +#define SWIGTYPE_p_wxTIFFHandler swig_types[131] +#define SWIGTYPE_p_wxToolTip swig_types[132] +#define SWIGTYPE_p_wxUpdateUIEvent swig_types[133] +#define SWIGTYPE_p_wxValidator swig_types[134] +#define SWIGTYPE_p_wxVisualAttributes swig_types[135] +#define SWIGTYPE_p_wxWindow swig_types[136] +#define SWIGTYPE_p_wxWindowCreateEvent swig_types[137] +#define SWIGTYPE_p_wxWindowDestroyEvent swig_types[138] +#define SWIGTYPE_p_wxWindowList swig_types[139] +#define SWIGTYPE_p_wxWindowList_iterator swig_types[140] +#define SWIGTYPE_p_wxXPMHandler swig_types[141] +#define SWIGTYPE_p_wxZipFSHandler swig_types[142] +static swig_type_info *swig_types[144]; +static swig_module_info swig_module = {swig_types, 143, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -18139,6 +18140,143 @@ fail: } +SWIGINTERN PyObject *_wrap_Image_SaveStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + wxOutputStream *arg2 = 0 ; + int arg3 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + wxPyOutputStream *temp2 ; + bool created2 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "stream",(char *) "type", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_SaveStream",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxImage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Image_SaveStream" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + { + if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyOutputStream"))) { + arg2 = temp2->m_wxos; + created2 = false; + } else { + PyErr_Clear(); // clear the failure of the wxPyConvert above + arg2 = wxPyCBOutputStream_create(obj1, false); + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError, "Expected wx.OutputStream or Python file-like object."); + SWIG_fail; + } + created2 = true; + } + } + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_SaveStream" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->SaveFile(*arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + { + if (created2) delete arg2; + } + return resultobj; +fail: + { + if (created2) delete arg2; + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_SaveMimeStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + wxOutputStream *arg2 = 0 ; + wxString *arg3 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + wxPyOutputStream *temp2 ; + bool created2 ; + bool temp3 = false ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "stream",(char *) "mimetype", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_SaveMimeStream",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxImage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Image_SaveMimeStream" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + { + if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyOutputStream"))) { + arg2 = temp2->m_wxos; + created2 = false; + } else { + PyErr_Clear(); // clear the failure of the wxPyConvert above + arg2 = wxPyCBOutputStream_create(obj1, false); + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError, "Expected wx.OutputStream or Python file-like object."); + SWIG_fail; + } + created2 = true; + } + } + { + arg3 = wxString_in_helper(obj2); + if (arg3 == NULL) SWIG_fail; + temp3 = true; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->SaveFile(*arg2,(wxString const &)*arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + { + if (created2) delete arg2; + } + { + if (temp3) + delete arg3; + } + return resultobj; +fail: + { + if (created2) delete arg2; + } + { + if (temp3) + delete arg3; + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_Image_CanReadStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxInputStream *arg1 = 0 ; @@ -58882,6 +59020,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Image_LoadMimeFile", (PyCFunction) _wrap_Image_LoadMimeFile, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_SaveFile", (PyCFunction) _wrap_Image_SaveFile, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_SaveMimeFile", (PyCFunction) _wrap_Image_SaveMimeFile, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_SaveStream", (PyCFunction) _wrap_Image_SaveStream, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_SaveMimeStream", (PyCFunction) _wrap_Image_SaveMimeStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_CanReadStream", (PyCFunction) _wrap_Image_CanReadStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_LoadStream", (PyCFunction) _wrap_Image_LoadStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_LoadMimeStream", (PyCFunction) _wrap_Image_LoadMimeStream, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -60740,6 +60880,7 @@ static swig_type_info _swigt__p_wxNavigationKeyEvent = {"_p_wxNavigationKeyEvent static swig_type_info _swigt__p_wxNcPaintEvent = {"_p_wxNcPaintEvent", "wxNcPaintEvent *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxNotifyEvent = {"_p_wxNotifyEvent", "wxNotifyEvent *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxObject = {"_p_wxObject", "wxObject *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_wxOutputStream = {"_p_wxOutputStream", "wxOutputStream *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPCXHandler = {"_p_wxPCXHandler", "wxPCXHandler *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPNGHandler = {"_p_wxPNGHandler", "wxPNGHandler *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPNMHandler = {"_p_wxPNMHandler", "wxPNMHandler *", 0, 0, (void*)0, 0}; @@ -60884,6 +61025,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_wxNcPaintEvent, &_swigt__p_wxNotifyEvent, &_swigt__p_wxObject, + &_swigt__p_wxOutputStream, &_swigt__p_wxPCXHandler, &_swigt__p_wxPNGHandler, &_swigt__p_wxPNMHandler, @@ -61028,6 +61170,7 @@ static swig_cast_info _swigc__p_wxNavigationKeyEvent[] = { {&_swigt__p_wxNaviga static swig_cast_info _swigc__p_wxNcPaintEvent[] = { {&_swigt__p_wxNcPaintEvent, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxNotifyEvent[] = { {&_swigt__p_wxNotifyEvent, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxObject[] = { {&_swigt__p_wxLayoutConstraints, _p_wxLayoutConstraintsTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizerItem, _p_wxSizerItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxGBSizerItem, _p_wxGBSizerItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxScrollEvent, _p_wxScrollEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIndividualLayoutConstraint, _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0}, {&_swigt__p_wxStaticBoxSizer, _p_wxStaticBoxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxBoxSizer, _p_wxBoxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizer, _p_wxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGridBagSizer, _p_wxGridBagSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxUpdateUIEvent, _p_wxUpdateUIEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenu, _p_wxMenuTo_p_wxObject, 0, 0}, {&_swigt__p_wxEvent, _p_wxEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFlexGridSizer, _p_wxFlexGridSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGridSizer, _p_wxGridSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxInitDialogEvent, _p_wxInitDialogEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPaintEvent, _p_wxPaintEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxNcPaintEvent, _p_wxNcPaintEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxClipboardTextEvent, _p_wxClipboardTextEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPaletteChangedEvent, _p_wxPaletteChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDisplayChangedEvent, _p_wxDisplayChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseCaptureChangedEvent, _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxSysColourChangedEvent, _p_wxSysColourChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxControl, _p_wxControlTo_p_wxObject, 0, 0}, {&_swigt__p_wxSetCursorEvent, _p_wxSetCursorEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFSFile, _p_wxFSFileTo_p_wxObject, 0, 0}, {&_swigt__p_wxPySizer, _p_wxPySizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxNotifyEvent, _p_wxNotifyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyEvent, _p_wxPyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxShowEvent, _p_wxShowEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuItem, _p_wxMenuItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindowCreateEvent, _p_wxWindowCreateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIdleEvent, _p_wxIdleEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDateEvent, _p_wxDateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMoveEvent, _p_wxMoveEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizeEvent, _p_wxSizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxActivateEvent, _p_wxActivateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIconizeEvent, _p_wxIconizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMaximizeEvent, _p_wxMaximizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxQueryNewPaletteEvent, _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxCURHandler, _p_wxCURHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxANIHandler, _p_wxANIHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPNGHandler, _p_wxPNGHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGIFHandler, _p_wxGIFHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPCXHandler, _p_wxPCXHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxJPEGHandler, _p_wxJPEGHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPNMHandler, _p_wxPNMHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxImageHandler, _p_wxImageHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxXPMHandler, _p_wxXPMHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxTIFFHandler, _p_wxTIFFHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxTGAHandler, _p_wxTGAHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxEvtHandler, _p_wxEvtHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseCaptureLostEvent, _p_wxMouseCaptureLostEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxICOHandler, _p_wxICOHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxBMPHandler, _p_wxBMPHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyImageHandler, _p_wxPyImageHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxStdDialogButtonSizer, _p_wxStdDialogButtonSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxAcceleratorTable, _p_wxAcceleratorTableTo_p_wxObject, 0, 0}, {&_swigt__p_wxImage, _p_wxImageTo_p_wxObject, 0, 0}, {&_swigt__p_wxScrollWinEvent, _p_wxScrollWinEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxObject, 0, 0, 0}, {&_swigt__p_wxKeyEvent, _p_wxKeyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxNavigationKeyEvent, _p_wxNavigationKeyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindowDestroyEvent, _p_wxWindowDestroyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindow, _p_wxWindowTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuBar, _p_wxMenuBarTo_p_wxObject, 0, 0}, {&_swigt__p_wxFileSystem, _p_wxFileSystemTo_p_wxObject, 0, 0}, {&_swigt__p_wxContextMenuEvent, _p_wxContextMenuEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuEvent, _p_wxMenuEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyApp, _p_wxPyAppTo_p_wxObject, 0, 0}, {&_swigt__p_wxCloseEvent, _p_wxCloseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseEvent, _p_wxMouseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxEraseEvent, _p_wxEraseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyCommandEvent, _p_wxPyCommandEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxCommandEvent, _p_wxCommandEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDropFilesEvent, _p_wxDropFilesEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFocusEvent, _p_wxFocusEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxChildFocusEvent, _p_wxChildFocusEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxControlWithItems, _p_wxControlWithItemsTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyValidator, _p_wxPyValidatorTo_p_wxObject, 0, 0}, {&_swigt__p_wxValidator, _p_wxValidatorTo_p_wxObject, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_wxOutputStream[] = { {&_swigt__p_wxOutputStream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPCXHandler[] = { {&_swigt__p_wxPCXHandler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPNGHandler[] = { {&_swigt__p_wxPNGHandler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPNMHandler[] = { {&_swigt__p_wxPNMHandler, 0, 0, 0},{0, 0, 0, 0}}; @@ -61172,6 +61315,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_wxNcPaintEvent, _swigc__p_wxNotifyEvent, _swigc__p_wxObject, + _swigc__p_wxOutputStream, _swigc__p_wxPCXHandler, _swigc__p_wxPNGHandler, _swigc__p_wxPNMHandler, diff --git a/wxPython/src/gtk/_gdi.py b/wxPython/src/gtk/_gdi.py index 3b09aed023..42b50ebd7a 100644 --- a/wxPython/src/gtk/_gdi.py +++ b/wxPython/src/gtk/_gdi.py @@ -223,9 +223,9 @@ class Colour(_core.Object): def Get(*args, **kwargs): """ - Get() -> (r, g, b) + Get(self, bool includeAlpha=False) -> (r,g,b) or (r,g,b,a) - Returns the RGB intensity values as a tuple. + Returns the RGB intensity values as a tuple, optionally the alpha value as well. """ return _gdi_.Colour_Get(*args, **kwargs) diff --git a/wxPython/src/mac/_core.py b/wxPython/src/mac/_core.py index c067efca10..3e7e437781 100644 --- a/wxPython/src/mac/_core.py +++ b/wxPython/src/mac/_core.py @@ -2920,6 +2920,22 @@ class Image(Object): """ return _core_.Image_SaveMimeFile(*args, **kwargs) + def SaveStream(*args, **kwargs): + """ + SaveStream(self, wxOutputStream stream, int type) -> bool + + Saves an image in the named file. + """ + return _core_.Image_SaveStream(*args, **kwargs) + + def SaveMimeStream(*args, **kwargs): + """ + SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool + + Saves an image in the named file. + """ + return _core_.Image_SaveMimeStream(*args, **kwargs) + def CanReadStream(*args, **kwargs): """ CanReadStream(InputStream stream) -> bool diff --git a/wxPython/src/mac/_core_wrap.cpp b/wxPython/src/mac/_core_wrap.cpp index 4a0a4b2c97..1dfeeb31da 100644 --- a/wxPython/src/mac/_core_wrap.cpp +++ b/wxPython/src/mac/_core_wrap.cpp @@ -2551,62 +2551,63 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_wxNcPaintEvent swig_types[85] #define SWIGTYPE_p_wxNotifyEvent swig_types[86] #define SWIGTYPE_p_wxObject swig_types[87] -#define SWIGTYPE_p_wxPCXHandler swig_types[88] -#define SWIGTYPE_p_wxPNGHandler swig_types[89] -#define SWIGTYPE_p_wxPNMHandler swig_types[90] -#define SWIGTYPE_p_wxPaintEvent swig_types[91] -#define SWIGTYPE_p_wxPaletteChangedEvent swig_types[92] -#define SWIGTYPE_p_wxPaperSize swig_types[93] -#define SWIGTYPE_p_wxPoint swig_types[94] -#define SWIGTYPE_p_wxPoint2D swig_types[95] -#define SWIGTYPE_p_wxPropagateOnce swig_types[96] -#define SWIGTYPE_p_wxPropagationDisabler swig_types[97] -#define SWIGTYPE_p_wxPyApp swig_types[98] -#define SWIGTYPE_p_wxPyCommandEvent swig_types[99] -#define SWIGTYPE_p_wxPyDropTarget swig_types[100] -#define SWIGTYPE_p_wxPyEvent swig_types[101] -#define SWIGTYPE_p_wxPyFileSystemHandler swig_types[102] -#define SWIGTYPE_p_wxPyImageHandler swig_types[103] -#define SWIGTYPE_p_wxPyInputStream swig_types[104] -#define SWIGTYPE_p_wxPyOutputStream swig_types[105] -#define SWIGTYPE_p_wxPySizer swig_types[106] -#define SWIGTYPE_p_wxPyValidator swig_types[107] -#define SWIGTYPE_p_wxQuantize swig_types[108] -#define SWIGTYPE_p_wxQueryNewPaletteEvent swig_types[109] -#define SWIGTYPE_p_wxRealPoint swig_types[110] -#define SWIGTYPE_p_wxRect swig_types[111] -#define SWIGTYPE_p_wxRect2D swig_types[112] -#define SWIGTYPE_p_wxRegion swig_types[113] -#define SWIGTYPE_p_wxScrollEvent swig_types[114] -#define SWIGTYPE_p_wxScrollWinEvent swig_types[115] -#define SWIGTYPE_p_wxSetCursorEvent swig_types[116] -#define SWIGTYPE_p_wxShowEvent swig_types[117] -#define SWIGTYPE_p_wxSize swig_types[118] -#define SWIGTYPE_p_wxSizeEvent swig_types[119] -#define SWIGTYPE_p_wxSizer swig_types[120] -#define SWIGTYPE_p_wxSizerFlags swig_types[121] -#define SWIGTYPE_p_wxSizerItem swig_types[122] -#define SWIGTYPE_p_wxSizerItemList swig_types[123] -#define SWIGTYPE_p_wxSizerItemList_iterator swig_types[124] -#define SWIGTYPE_p_wxStaticBox swig_types[125] -#define SWIGTYPE_p_wxStaticBoxSizer swig_types[126] -#define SWIGTYPE_p_wxStdDialogButtonSizer swig_types[127] -#define SWIGTYPE_p_wxSysColourChangedEvent swig_types[128] -#define SWIGTYPE_p_wxTGAHandler swig_types[129] -#define SWIGTYPE_p_wxTIFFHandler swig_types[130] -#define SWIGTYPE_p_wxToolTip swig_types[131] -#define SWIGTYPE_p_wxUpdateUIEvent swig_types[132] -#define SWIGTYPE_p_wxValidator swig_types[133] -#define SWIGTYPE_p_wxVisualAttributes swig_types[134] -#define SWIGTYPE_p_wxWindow swig_types[135] -#define SWIGTYPE_p_wxWindowCreateEvent swig_types[136] -#define SWIGTYPE_p_wxWindowDestroyEvent swig_types[137] -#define SWIGTYPE_p_wxWindowList swig_types[138] -#define SWIGTYPE_p_wxWindowList_iterator swig_types[139] -#define SWIGTYPE_p_wxXPMHandler swig_types[140] -#define SWIGTYPE_p_wxZipFSHandler swig_types[141] -static swig_type_info *swig_types[143]; -static swig_module_info swig_module = {swig_types, 142, 0, 0, 0, 0}; +#define SWIGTYPE_p_wxOutputStream swig_types[88] +#define SWIGTYPE_p_wxPCXHandler swig_types[89] +#define SWIGTYPE_p_wxPNGHandler swig_types[90] +#define SWIGTYPE_p_wxPNMHandler swig_types[91] +#define SWIGTYPE_p_wxPaintEvent swig_types[92] +#define SWIGTYPE_p_wxPaletteChangedEvent swig_types[93] +#define SWIGTYPE_p_wxPaperSize swig_types[94] +#define SWIGTYPE_p_wxPoint swig_types[95] +#define SWIGTYPE_p_wxPoint2D swig_types[96] +#define SWIGTYPE_p_wxPropagateOnce swig_types[97] +#define SWIGTYPE_p_wxPropagationDisabler swig_types[98] +#define SWIGTYPE_p_wxPyApp swig_types[99] +#define SWIGTYPE_p_wxPyCommandEvent swig_types[100] +#define SWIGTYPE_p_wxPyDropTarget swig_types[101] +#define SWIGTYPE_p_wxPyEvent swig_types[102] +#define SWIGTYPE_p_wxPyFileSystemHandler swig_types[103] +#define SWIGTYPE_p_wxPyImageHandler swig_types[104] +#define SWIGTYPE_p_wxPyInputStream swig_types[105] +#define SWIGTYPE_p_wxPyOutputStream swig_types[106] +#define SWIGTYPE_p_wxPySizer swig_types[107] +#define SWIGTYPE_p_wxPyValidator swig_types[108] +#define SWIGTYPE_p_wxQuantize swig_types[109] +#define SWIGTYPE_p_wxQueryNewPaletteEvent swig_types[110] +#define SWIGTYPE_p_wxRealPoint swig_types[111] +#define SWIGTYPE_p_wxRect swig_types[112] +#define SWIGTYPE_p_wxRect2D swig_types[113] +#define SWIGTYPE_p_wxRegion swig_types[114] +#define SWIGTYPE_p_wxScrollEvent swig_types[115] +#define SWIGTYPE_p_wxScrollWinEvent swig_types[116] +#define SWIGTYPE_p_wxSetCursorEvent swig_types[117] +#define SWIGTYPE_p_wxShowEvent swig_types[118] +#define SWIGTYPE_p_wxSize swig_types[119] +#define SWIGTYPE_p_wxSizeEvent swig_types[120] +#define SWIGTYPE_p_wxSizer swig_types[121] +#define SWIGTYPE_p_wxSizerFlags swig_types[122] +#define SWIGTYPE_p_wxSizerItem swig_types[123] +#define SWIGTYPE_p_wxSizerItemList swig_types[124] +#define SWIGTYPE_p_wxSizerItemList_iterator swig_types[125] +#define SWIGTYPE_p_wxStaticBox swig_types[126] +#define SWIGTYPE_p_wxStaticBoxSizer swig_types[127] +#define SWIGTYPE_p_wxStdDialogButtonSizer swig_types[128] +#define SWIGTYPE_p_wxSysColourChangedEvent swig_types[129] +#define SWIGTYPE_p_wxTGAHandler swig_types[130] +#define SWIGTYPE_p_wxTIFFHandler swig_types[131] +#define SWIGTYPE_p_wxToolTip swig_types[132] +#define SWIGTYPE_p_wxUpdateUIEvent swig_types[133] +#define SWIGTYPE_p_wxValidator swig_types[134] +#define SWIGTYPE_p_wxVisualAttributes swig_types[135] +#define SWIGTYPE_p_wxWindow swig_types[136] +#define SWIGTYPE_p_wxWindowCreateEvent swig_types[137] +#define SWIGTYPE_p_wxWindowDestroyEvent swig_types[138] +#define SWIGTYPE_p_wxWindowList swig_types[139] +#define SWIGTYPE_p_wxWindowList_iterator swig_types[140] +#define SWIGTYPE_p_wxXPMHandler swig_types[141] +#define SWIGTYPE_p_wxZipFSHandler swig_types[142] +static swig_type_info *swig_types[144]; +static swig_module_info swig_module = {swig_types, 143, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -18138,6 +18139,143 @@ fail: } +SWIGINTERN PyObject *_wrap_Image_SaveStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + wxOutputStream *arg2 = 0 ; + int arg3 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + wxPyOutputStream *temp2 ; + bool created2 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "stream",(char *) "type", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_SaveStream",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxImage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Image_SaveStream" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + { + if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyOutputStream"))) { + arg2 = temp2->m_wxos; + created2 = false; + } else { + PyErr_Clear(); // clear the failure of the wxPyConvert above + arg2 = wxPyCBOutputStream_create(obj1, false); + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError, "Expected wx.OutputStream or Python file-like object."); + SWIG_fail; + } + created2 = true; + } + } + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_SaveStream" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->SaveFile(*arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + { + if (created2) delete arg2; + } + return resultobj; +fail: + { + if (created2) delete arg2; + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_SaveMimeStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + wxOutputStream *arg2 = 0 ; + wxString *arg3 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + wxPyOutputStream *temp2 ; + bool created2 ; + bool temp3 = false ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "stream",(char *) "mimetype", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_SaveMimeStream",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxImage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Image_SaveMimeStream" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + { + if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyOutputStream"))) { + arg2 = temp2->m_wxos; + created2 = false; + } else { + PyErr_Clear(); // clear the failure of the wxPyConvert above + arg2 = wxPyCBOutputStream_create(obj1, false); + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError, "Expected wx.OutputStream or Python file-like object."); + SWIG_fail; + } + created2 = true; + } + } + { + arg3 = wxString_in_helper(obj2); + if (arg3 == NULL) SWIG_fail; + temp3 = true; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->SaveFile(*arg2,(wxString const &)*arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + { + if (created2) delete arg2; + } + { + if (temp3) + delete arg3; + } + return resultobj; +fail: + { + if (created2) delete arg2; + } + { + if (temp3) + delete arg3; + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_Image_CanReadStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxInputStream *arg1 = 0 ; @@ -58881,6 +59019,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Image_LoadMimeFile", (PyCFunction) _wrap_Image_LoadMimeFile, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_SaveFile", (PyCFunction) _wrap_Image_SaveFile, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_SaveMimeFile", (PyCFunction) _wrap_Image_SaveMimeFile, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_SaveStream", (PyCFunction) _wrap_Image_SaveStream, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_SaveMimeStream", (PyCFunction) _wrap_Image_SaveMimeStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_CanReadStream", (PyCFunction) _wrap_Image_CanReadStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_LoadStream", (PyCFunction) _wrap_Image_LoadStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_LoadMimeStream", (PyCFunction) _wrap_Image_LoadMimeStream, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -60739,6 +60879,7 @@ static swig_type_info _swigt__p_wxNavigationKeyEvent = {"_p_wxNavigationKeyEvent static swig_type_info _swigt__p_wxNcPaintEvent = {"_p_wxNcPaintEvent", "wxNcPaintEvent *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxNotifyEvent = {"_p_wxNotifyEvent", "wxNotifyEvent *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxObject = {"_p_wxObject", "wxObject *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_wxOutputStream = {"_p_wxOutputStream", "wxOutputStream *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPCXHandler = {"_p_wxPCXHandler", "wxPCXHandler *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPNGHandler = {"_p_wxPNGHandler", "wxPNGHandler *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPNMHandler = {"_p_wxPNMHandler", "wxPNMHandler *", 0, 0, (void*)0, 0}; @@ -60883,6 +61024,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_wxNcPaintEvent, &_swigt__p_wxNotifyEvent, &_swigt__p_wxObject, + &_swigt__p_wxOutputStream, &_swigt__p_wxPCXHandler, &_swigt__p_wxPNGHandler, &_swigt__p_wxPNMHandler, @@ -61027,6 +61169,7 @@ static swig_cast_info _swigc__p_wxNavigationKeyEvent[] = { {&_swigt__p_wxNaviga static swig_cast_info _swigc__p_wxNcPaintEvent[] = { {&_swigt__p_wxNcPaintEvent, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxNotifyEvent[] = { {&_swigt__p_wxNotifyEvent, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxObject[] = { {&_swigt__p_wxLayoutConstraints, _p_wxLayoutConstraintsTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizerItem, _p_wxSizerItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxGBSizerItem, _p_wxGBSizerItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxScrollEvent, _p_wxScrollEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIndividualLayoutConstraint, _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0}, {&_swigt__p_wxStaticBoxSizer, _p_wxStaticBoxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxBoxSizer, _p_wxBoxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizer, _p_wxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGridBagSizer, _p_wxGridBagSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxUpdateUIEvent, _p_wxUpdateUIEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenu, _p_wxMenuTo_p_wxObject, 0, 0}, {&_swigt__p_wxEvent, _p_wxEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFlexGridSizer, _p_wxFlexGridSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGridSizer, _p_wxGridSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxInitDialogEvent, _p_wxInitDialogEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPaintEvent, _p_wxPaintEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxNcPaintEvent, _p_wxNcPaintEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxClipboardTextEvent, _p_wxClipboardTextEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPaletteChangedEvent, _p_wxPaletteChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDisplayChangedEvent, _p_wxDisplayChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseCaptureChangedEvent, _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxSysColourChangedEvent, _p_wxSysColourChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxControl, _p_wxControlTo_p_wxObject, 0, 0}, {&_swigt__p_wxSetCursorEvent, _p_wxSetCursorEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFSFile, _p_wxFSFileTo_p_wxObject, 0, 0}, {&_swigt__p_wxPySizer, _p_wxPySizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxNotifyEvent, _p_wxNotifyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyEvent, _p_wxPyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxShowEvent, _p_wxShowEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuItem, _p_wxMenuItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindowCreateEvent, _p_wxWindowCreateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIdleEvent, _p_wxIdleEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDateEvent, _p_wxDateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMoveEvent, _p_wxMoveEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizeEvent, _p_wxSizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxActivateEvent, _p_wxActivateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIconizeEvent, _p_wxIconizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMaximizeEvent, _p_wxMaximizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxQueryNewPaletteEvent, _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxCURHandler, _p_wxCURHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxANIHandler, _p_wxANIHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPNGHandler, _p_wxPNGHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGIFHandler, _p_wxGIFHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPCXHandler, _p_wxPCXHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxJPEGHandler, _p_wxJPEGHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPNMHandler, _p_wxPNMHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxImageHandler, _p_wxImageHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxXPMHandler, _p_wxXPMHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxTIFFHandler, _p_wxTIFFHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxTGAHandler, _p_wxTGAHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxEvtHandler, _p_wxEvtHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseCaptureLostEvent, _p_wxMouseCaptureLostEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxICOHandler, _p_wxICOHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxBMPHandler, _p_wxBMPHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyImageHandler, _p_wxPyImageHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxStdDialogButtonSizer, _p_wxStdDialogButtonSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxAcceleratorTable, _p_wxAcceleratorTableTo_p_wxObject, 0, 0}, {&_swigt__p_wxImage, _p_wxImageTo_p_wxObject, 0, 0}, {&_swigt__p_wxScrollWinEvent, _p_wxScrollWinEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxObject, 0, 0, 0}, {&_swigt__p_wxKeyEvent, _p_wxKeyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxNavigationKeyEvent, _p_wxNavigationKeyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindowDestroyEvent, _p_wxWindowDestroyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindow, _p_wxWindowTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuBar, _p_wxMenuBarTo_p_wxObject, 0, 0}, {&_swigt__p_wxFileSystem, _p_wxFileSystemTo_p_wxObject, 0, 0}, {&_swigt__p_wxContextMenuEvent, _p_wxContextMenuEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuEvent, _p_wxMenuEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyApp, _p_wxPyAppTo_p_wxObject, 0, 0}, {&_swigt__p_wxCloseEvent, _p_wxCloseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseEvent, _p_wxMouseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxEraseEvent, _p_wxEraseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyCommandEvent, _p_wxPyCommandEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxCommandEvent, _p_wxCommandEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDropFilesEvent, _p_wxDropFilesEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFocusEvent, _p_wxFocusEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxChildFocusEvent, _p_wxChildFocusEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxControlWithItems, _p_wxControlWithItemsTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyValidator, _p_wxPyValidatorTo_p_wxObject, 0, 0}, {&_swigt__p_wxValidator, _p_wxValidatorTo_p_wxObject, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_wxOutputStream[] = { {&_swigt__p_wxOutputStream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPCXHandler[] = { {&_swigt__p_wxPCXHandler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPNGHandler[] = { {&_swigt__p_wxPNGHandler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPNMHandler[] = { {&_swigt__p_wxPNMHandler, 0, 0, 0},{0, 0, 0, 0}}; @@ -61171,6 +61314,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_wxNcPaintEvent, _swigc__p_wxNotifyEvent, _swigc__p_wxObject, + _swigc__p_wxOutputStream, _swigc__p_wxPCXHandler, _swigc__p_wxPNGHandler, _swigc__p_wxPNMHandler, diff --git a/wxPython/src/mac/_gdi.py b/wxPython/src/mac/_gdi.py index 8ea7c71ff2..d66663a3b9 100644 --- a/wxPython/src/mac/_gdi.py +++ b/wxPython/src/mac/_gdi.py @@ -223,9 +223,9 @@ class Colour(_core.Object): def Get(*args, **kwargs): """ - Get() -> (r, g, b) + Get(self, bool includeAlpha=False) -> (r,g,b) or (r,g,b,a) - Returns the RGB intensity values as a tuple. + Returns the RGB intensity values as a tuple, optionally the alpha value as well. """ return _gdi_.Colour_Get(*args, **kwargs) diff --git a/wxPython/src/msw/_core.py b/wxPython/src/msw/_core.py index fed0b9e77d..5a5a76ea41 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_core.py @@ -2920,6 +2920,22 @@ class Image(Object): """ return _core_.Image_SaveMimeFile(*args, **kwargs) + def SaveStream(*args, **kwargs): + """ + SaveStream(self, wxOutputStream stream, int type) -> bool + + Saves an image in the named file. + """ + return _core_.Image_SaveStream(*args, **kwargs) + + def SaveMimeStream(*args, **kwargs): + """ + SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool + + Saves an image in the named file. + """ + return _core_.Image_SaveMimeStream(*args, **kwargs) + def CanReadStream(*args, **kwargs): """ CanReadStream(InputStream stream) -> bool diff --git a/wxPython/src/msw/_core_wrap.cpp b/wxPython/src/msw/_core_wrap.cpp index 4df2375871..f2dac014f4 100644 --- a/wxPython/src/msw/_core_wrap.cpp +++ b/wxPython/src/msw/_core_wrap.cpp @@ -2551,62 +2551,63 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_wxNcPaintEvent swig_types[85] #define SWIGTYPE_p_wxNotifyEvent swig_types[86] #define SWIGTYPE_p_wxObject swig_types[87] -#define SWIGTYPE_p_wxPCXHandler swig_types[88] -#define SWIGTYPE_p_wxPNGHandler swig_types[89] -#define SWIGTYPE_p_wxPNMHandler swig_types[90] -#define SWIGTYPE_p_wxPaintEvent swig_types[91] -#define SWIGTYPE_p_wxPaletteChangedEvent swig_types[92] -#define SWIGTYPE_p_wxPaperSize swig_types[93] -#define SWIGTYPE_p_wxPoint swig_types[94] -#define SWIGTYPE_p_wxPoint2D swig_types[95] -#define SWIGTYPE_p_wxPropagateOnce swig_types[96] -#define SWIGTYPE_p_wxPropagationDisabler swig_types[97] -#define SWIGTYPE_p_wxPyApp swig_types[98] -#define SWIGTYPE_p_wxPyCommandEvent swig_types[99] -#define SWIGTYPE_p_wxPyDropTarget swig_types[100] -#define SWIGTYPE_p_wxPyEvent swig_types[101] -#define SWIGTYPE_p_wxPyFileSystemHandler swig_types[102] -#define SWIGTYPE_p_wxPyImageHandler swig_types[103] -#define SWIGTYPE_p_wxPyInputStream swig_types[104] -#define SWIGTYPE_p_wxPyOutputStream swig_types[105] -#define SWIGTYPE_p_wxPySizer swig_types[106] -#define SWIGTYPE_p_wxPyValidator swig_types[107] -#define SWIGTYPE_p_wxQuantize swig_types[108] -#define SWIGTYPE_p_wxQueryNewPaletteEvent swig_types[109] -#define SWIGTYPE_p_wxRealPoint swig_types[110] -#define SWIGTYPE_p_wxRect swig_types[111] -#define SWIGTYPE_p_wxRect2D swig_types[112] -#define SWIGTYPE_p_wxRegion swig_types[113] -#define SWIGTYPE_p_wxScrollEvent swig_types[114] -#define SWIGTYPE_p_wxScrollWinEvent swig_types[115] -#define SWIGTYPE_p_wxSetCursorEvent swig_types[116] -#define SWIGTYPE_p_wxShowEvent swig_types[117] -#define SWIGTYPE_p_wxSize swig_types[118] -#define SWIGTYPE_p_wxSizeEvent swig_types[119] -#define SWIGTYPE_p_wxSizer swig_types[120] -#define SWIGTYPE_p_wxSizerFlags swig_types[121] -#define SWIGTYPE_p_wxSizerItem swig_types[122] -#define SWIGTYPE_p_wxSizerItemList swig_types[123] -#define SWIGTYPE_p_wxSizerItemList_iterator swig_types[124] -#define SWIGTYPE_p_wxStaticBox swig_types[125] -#define SWIGTYPE_p_wxStaticBoxSizer swig_types[126] -#define SWIGTYPE_p_wxStdDialogButtonSizer swig_types[127] -#define SWIGTYPE_p_wxSysColourChangedEvent swig_types[128] -#define SWIGTYPE_p_wxTGAHandler swig_types[129] -#define SWIGTYPE_p_wxTIFFHandler swig_types[130] -#define SWIGTYPE_p_wxToolTip swig_types[131] -#define SWIGTYPE_p_wxUpdateUIEvent swig_types[132] -#define SWIGTYPE_p_wxValidator swig_types[133] -#define SWIGTYPE_p_wxVisualAttributes swig_types[134] -#define SWIGTYPE_p_wxWindow swig_types[135] -#define SWIGTYPE_p_wxWindowCreateEvent swig_types[136] -#define SWIGTYPE_p_wxWindowDestroyEvent swig_types[137] -#define SWIGTYPE_p_wxWindowList swig_types[138] -#define SWIGTYPE_p_wxWindowList_iterator swig_types[139] -#define SWIGTYPE_p_wxXPMHandler swig_types[140] -#define SWIGTYPE_p_wxZipFSHandler swig_types[141] -static swig_type_info *swig_types[143]; -static swig_module_info swig_module = {swig_types, 142, 0, 0, 0, 0}; +#define SWIGTYPE_p_wxOutputStream swig_types[88] +#define SWIGTYPE_p_wxPCXHandler swig_types[89] +#define SWIGTYPE_p_wxPNGHandler swig_types[90] +#define SWIGTYPE_p_wxPNMHandler swig_types[91] +#define SWIGTYPE_p_wxPaintEvent swig_types[92] +#define SWIGTYPE_p_wxPaletteChangedEvent swig_types[93] +#define SWIGTYPE_p_wxPaperSize swig_types[94] +#define SWIGTYPE_p_wxPoint swig_types[95] +#define SWIGTYPE_p_wxPoint2D swig_types[96] +#define SWIGTYPE_p_wxPropagateOnce swig_types[97] +#define SWIGTYPE_p_wxPropagationDisabler swig_types[98] +#define SWIGTYPE_p_wxPyApp swig_types[99] +#define SWIGTYPE_p_wxPyCommandEvent swig_types[100] +#define SWIGTYPE_p_wxPyDropTarget swig_types[101] +#define SWIGTYPE_p_wxPyEvent swig_types[102] +#define SWIGTYPE_p_wxPyFileSystemHandler swig_types[103] +#define SWIGTYPE_p_wxPyImageHandler swig_types[104] +#define SWIGTYPE_p_wxPyInputStream swig_types[105] +#define SWIGTYPE_p_wxPyOutputStream swig_types[106] +#define SWIGTYPE_p_wxPySizer swig_types[107] +#define SWIGTYPE_p_wxPyValidator swig_types[108] +#define SWIGTYPE_p_wxQuantize swig_types[109] +#define SWIGTYPE_p_wxQueryNewPaletteEvent swig_types[110] +#define SWIGTYPE_p_wxRealPoint swig_types[111] +#define SWIGTYPE_p_wxRect swig_types[112] +#define SWIGTYPE_p_wxRect2D swig_types[113] +#define SWIGTYPE_p_wxRegion swig_types[114] +#define SWIGTYPE_p_wxScrollEvent swig_types[115] +#define SWIGTYPE_p_wxScrollWinEvent swig_types[116] +#define SWIGTYPE_p_wxSetCursorEvent swig_types[117] +#define SWIGTYPE_p_wxShowEvent swig_types[118] +#define SWIGTYPE_p_wxSize swig_types[119] +#define SWIGTYPE_p_wxSizeEvent swig_types[120] +#define SWIGTYPE_p_wxSizer swig_types[121] +#define SWIGTYPE_p_wxSizerFlags swig_types[122] +#define SWIGTYPE_p_wxSizerItem swig_types[123] +#define SWIGTYPE_p_wxSizerItemList swig_types[124] +#define SWIGTYPE_p_wxSizerItemList_iterator swig_types[125] +#define SWIGTYPE_p_wxStaticBox swig_types[126] +#define SWIGTYPE_p_wxStaticBoxSizer swig_types[127] +#define SWIGTYPE_p_wxStdDialogButtonSizer swig_types[128] +#define SWIGTYPE_p_wxSysColourChangedEvent swig_types[129] +#define SWIGTYPE_p_wxTGAHandler swig_types[130] +#define SWIGTYPE_p_wxTIFFHandler swig_types[131] +#define SWIGTYPE_p_wxToolTip swig_types[132] +#define SWIGTYPE_p_wxUpdateUIEvent swig_types[133] +#define SWIGTYPE_p_wxValidator swig_types[134] +#define SWIGTYPE_p_wxVisualAttributes swig_types[135] +#define SWIGTYPE_p_wxWindow swig_types[136] +#define SWIGTYPE_p_wxWindowCreateEvent swig_types[137] +#define SWIGTYPE_p_wxWindowDestroyEvent swig_types[138] +#define SWIGTYPE_p_wxWindowList swig_types[139] +#define SWIGTYPE_p_wxWindowList_iterator swig_types[140] +#define SWIGTYPE_p_wxXPMHandler swig_types[141] +#define SWIGTYPE_p_wxZipFSHandler swig_types[142] +static swig_type_info *swig_types[144]; +static swig_module_info swig_module = {swig_types, 143, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -18123,6 +18124,143 @@ fail: } +SWIGINTERN PyObject *_wrap_Image_SaveStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + wxOutputStream *arg2 = 0 ; + int arg3 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + wxPyOutputStream *temp2 ; + bool created2 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "stream",(char *) "type", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_SaveStream",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxImage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Image_SaveStream" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + { + if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyOutputStream"))) { + arg2 = temp2->m_wxos; + created2 = false; + } else { + PyErr_Clear(); // clear the failure of the wxPyConvert above + arg2 = wxPyCBOutputStream_create(obj1, false); + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError, "Expected wx.OutputStream or Python file-like object."); + SWIG_fail; + } + created2 = true; + } + } + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_SaveStream" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->SaveFile(*arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + { + if (created2) delete arg2; + } + return resultobj; +fail: + { + if (created2) delete arg2; + } + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_SaveMimeStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + wxOutputStream *arg2 = 0 ; + wxString *arg3 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + wxPyOutputStream *temp2 ; + bool created2 ; + bool temp3 = false ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "stream",(char *) "mimetype", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_SaveMimeStream",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxImage, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Image_SaveMimeStream" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + { + if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyOutputStream"))) { + arg2 = temp2->m_wxos; + created2 = false; + } else { + PyErr_Clear(); // clear the failure of the wxPyConvert above + arg2 = wxPyCBOutputStream_create(obj1, false); + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError, "Expected wx.OutputStream or Python file-like object."); + SWIG_fail; + } + created2 = true; + } + } + { + arg3 = wxString_in_helper(obj2); + if (arg3 == NULL) SWIG_fail; + temp3 = true; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->SaveFile(*arg2,(wxString const &)*arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + { + if (created2) delete arg2; + } + { + if (temp3) + delete arg3; + } + return resultobj; +fail: + { + if (created2) delete arg2; + } + { + if (temp3) + delete arg3; + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_Image_CanReadStream(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxInputStream *arg1 = 0 ; @@ -58907,6 +59045,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Image_LoadMimeFile", (PyCFunction) _wrap_Image_LoadMimeFile, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_SaveFile", (PyCFunction) _wrap_Image_SaveFile, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_SaveMimeFile", (PyCFunction) _wrap_Image_SaveMimeFile, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_SaveStream", (PyCFunction) _wrap_Image_SaveStream, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_SaveMimeStream", (PyCFunction) _wrap_Image_SaveMimeStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_CanReadStream", (PyCFunction) _wrap_Image_CanReadStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_LoadStream", (PyCFunction) _wrap_Image_LoadStream, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_LoadMimeStream", (PyCFunction) _wrap_Image_LoadMimeStream, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -60766,6 +60906,7 @@ static swig_type_info _swigt__p_wxNavigationKeyEvent = {"_p_wxNavigationKeyEvent static swig_type_info _swigt__p_wxNcPaintEvent = {"_p_wxNcPaintEvent", "wxNcPaintEvent *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxNotifyEvent = {"_p_wxNotifyEvent", "wxNotifyEvent *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxObject = {"_p_wxObject", "wxObject *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_wxOutputStream = {"_p_wxOutputStream", "wxOutputStream *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPCXHandler = {"_p_wxPCXHandler", "wxPCXHandler *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPNGHandler = {"_p_wxPNGHandler", "wxPNGHandler *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_wxPNMHandler = {"_p_wxPNMHandler", "wxPNMHandler *", 0, 0, (void*)0, 0}; @@ -60910,6 +61051,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_wxNcPaintEvent, &_swigt__p_wxNotifyEvent, &_swigt__p_wxObject, + &_swigt__p_wxOutputStream, &_swigt__p_wxPCXHandler, &_swigt__p_wxPNGHandler, &_swigt__p_wxPNMHandler, @@ -61054,6 +61196,7 @@ static swig_cast_info _swigc__p_wxNavigationKeyEvent[] = { {&_swigt__p_wxNaviga static swig_cast_info _swigc__p_wxNcPaintEvent[] = { {&_swigt__p_wxNcPaintEvent, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxNotifyEvent[] = { {&_swigt__p_wxNotifyEvent, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxObject[] = { {&_swigt__p_wxLayoutConstraints, _p_wxLayoutConstraintsTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizerItem, _p_wxSizerItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxGBSizerItem, _p_wxGBSizerItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxScrollEvent, _p_wxScrollEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIndividualLayoutConstraint, _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0}, {&_swigt__p_wxStaticBoxSizer, _p_wxStaticBoxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxBoxSizer, _p_wxBoxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizer, _p_wxSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGridBagSizer, _p_wxGridBagSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxUpdateUIEvent, _p_wxUpdateUIEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenu, _p_wxMenuTo_p_wxObject, 0, 0}, {&_swigt__p_wxEvent, _p_wxEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFlexGridSizer, _p_wxFlexGridSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGridSizer, _p_wxGridSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxInitDialogEvent, _p_wxInitDialogEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPaintEvent, _p_wxPaintEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxNcPaintEvent, _p_wxNcPaintEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxClipboardTextEvent, _p_wxClipboardTextEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPaletteChangedEvent, _p_wxPaletteChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDisplayChangedEvent, _p_wxDisplayChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseCaptureChangedEvent, _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxSysColourChangedEvent, _p_wxSysColourChangedEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxControl, _p_wxControlTo_p_wxObject, 0, 0}, {&_swigt__p_wxSetCursorEvent, _p_wxSetCursorEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFSFile, _p_wxFSFileTo_p_wxObject, 0, 0}, {&_swigt__p_wxPySizer, _p_wxPySizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxNotifyEvent, _p_wxNotifyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyEvent, _p_wxPyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxShowEvent, _p_wxShowEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuItem, _p_wxMenuItemTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindowCreateEvent, _p_wxWindowCreateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIdleEvent, _p_wxIdleEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDateEvent, _p_wxDateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMoveEvent, _p_wxMoveEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxSizeEvent, _p_wxSizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxActivateEvent, _p_wxActivateEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxIconizeEvent, _p_wxIconizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMaximizeEvent, _p_wxMaximizeEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxQueryNewPaletteEvent, _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxCURHandler, _p_wxCURHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxANIHandler, _p_wxANIHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPNGHandler, _p_wxPNGHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxGIFHandler, _p_wxGIFHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPCXHandler, _p_wxPCXHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxJPEGHandler, _p_wxJPEGHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPNMHandler, _p_wxPNMHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxImageHandler, _p_wxImageHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxXPMHandler, _p_wxXPMHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxTIFFHandler, _p_wxTIFFHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxTGAHandler, _p_wxTGAHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxEvtHandler, _p_wxEvtHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseCaptureLostEvent, _p_wxMouseCaptureLostEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxICOHandler, _p_wxICOHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxBMPHandler, _p_wxBMPHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyImageHandler, _p_wxPyImageHandlerTo_p_wxObject, 0, 0}, {&_swigt__p_wxStdDialogButtonSizer, _p_wxStdDialogButtonSizerTo_p_wxObject, 0, 0}, {&_swigt__p_wxAcceleratorTable, _p_wxAcceleratorTableTo_p_wxObject, 0, 0}, {&_swigt__p_wxImage, _p_wxImageTo_p_wxObject, 0, 0}, {&_swigt__p_wxScrollWinEvent, _p_wxScrollWinEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxObject, 0, 0, 0}, {&_swigt__p_wxKeyEvent, _p_wxKeyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxNavigationKeyEvent, _p_wxNavigationKeyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindowDestroyEvent, _p_wxWindowDestroyEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxWindow, _p_wxWindowTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuBar, _p_wxMenuBarTo_p_wxObject, 0, 0}, {&_swigt__p_wxFileSystem, _p_wxFileSystemTo_p_wxObject, 0, 0}, {&_swigt__p_wxContextMenuEvent, _p_wxContextMenuEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMenuEvent, _p_wxMenuEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyApp, _p_wxPyAppTo_p_wxObject, 0, 0}, {&_swigt__p_wxCloseEvent, _p_wxCloseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxMouseEvent, _p_wxMouseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxEraseEvent, _p_wxEraseEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyCommandEvent, _p_wxPyCommandEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxCommandEvent, _p_wxCommandEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxDropFilesEvent, _p_wxDropFilesEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxFocusEvent, _p_wxFocusEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxChildFocusEvent, _p_wxChildFocusEventTo_p_wxObject, 0, 0}, {&_swigt__p_wxControlWithItems, _p_wxControlWithItemsTo_p_wxObject, 0, 0}, {&_swigt__p_wxPyValidator, _p_wxPyValidatorTo_p_wxObject, 0, 0}, {&_swigt__p_wxValidator, _p_wxValidatorTo_p_wxObject, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_wxOutputStream[] = { {&_swigt__p_wxOutputStream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPCXHandler[] = { {&_swigt__p_wxPCXHandler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPNGHandler[] = { {&_swigt__p_wxPNGHandler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_wxPNMHandler[] = { {&_swigt__p_wxPNMHandler, 0, 0, 0},{0, 0, 0, 0}}; @@ -61198,6 +61341,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_wxNcPaintEvent, _swigc__p_wxNotifyEvent, _swigc__p_wxObject, + _swigc__p_wxOutputStream, _swigc__p_wxPCXHandler, _swigc__p_wxPNGHandler, _swigc__p_wxPNMHandler, diff --git a/wxPython/src/msw/_gdi.py b/wxPython/src/msw/_gdi.py index f85a8d805c..5cd7031920 100644 --- a/wxPython/src/msw/_gdi.py +++ b/wxPython/src/msw/_gdi.py @@ -223,9 +223,9 @@ class Colour(_core.Object): def Get(*args, **kwargs): """ - Get() -> (r, g, b) + Get(self, bool includeAlpha=False) -> (r,g,b) or (r,g,b,a) - Returns the RGB intensity values as a tuple. + Returns the RGB intensity values as a tuple, optionally the alpha value as well. """ return _gdi_.Colour_Get(*args, **kwargs)