From f5263701c22ed4dfff59a47b0d8a3f8ab1396688 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 25 Sep 2006 20:22:58 +0000 Subject: [PATCH] various changes to get up to date with CVS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/docs/CHANGES.txt | 7 + wxPython/src/_gdicmn.i | 15 ++ wxPython/src/_image.i | 54 ++++- wxPython/src/_region.i | 30 ++- wxPython/src/_textctrl.i | 8 +- wxPython/src/gtk/_controls.py | 5 +- wxPython/src/gtk/_controls_wrap.cpp | 35 ++- wxPython/src/gtk/_core.py | 58 ++++- wxPython/src/gtk/_core_wrap.cpp | 350 +++++++++++++++++++++++++++- wxPython/src/gtk/_gdi.py | 4 + wxPython/src/gtk/_gdi_wrap.cpp | 45 ++++ wxPython/src/mac/_controls.py | 5 +- wxPython/src/mac/_controls_wrap.cpp | 35 ++- wxPython/src/mac/_core.py | 58 ++++- wxPython/src/mac/_core_wrap.cpp | 350 +++++++++++++++++++++++++++- wxPython/src/mac/_gdi.py | 4 + wxPython/src/mac/_gdi_wrap.cpp | 45 ++++ wxPython/src/msw/_controls.py | 5 +- wxPython/src/msw/_controls_wrap.cpp | 35 ++- wxPython/src/msw/_core.py | 58 ++++- wxPython/src/msw/_core_wrap.cpp | 350 +++++++++++++++++++++++++++- wxPython/src/msw/_gdi.py | 4 + wxPython/src/msw/_gdi_wrap.cpp | 45 ++++ 23 files changed, 1547 insertions(+), 58 deletions(-) diff --git a/wxPython/docs/CHANGES.txt b/wxPython/docs/CHANGES.txt index 428e13daa2..2d3ba3b317 100644 --- a/wxPython/docs/CHANGES.txt +++ b/wxPython/docs/CHANGES.txt @@ -252,6 +252,13 @@ Added wx.lib.delayedresult from Oliver Schoenborn. Added wx.lib.expando, a multi-line textctrl that exands as more lines are needed. +wx.Image.Scale and Rescale methods now take an extra parameter +specifying type of method to use for resampling the image. It +defaults to the current behavior of just replicating pixels, if +wx.IMAGE_QUALITY_HIGH is passed then it uses bicubic and box averaging +resampling methods for upsampling and downsampling respectively. + + diff --git a/wxPython/src/_gdicmn.i b/wxPython/src/_gdicmn.i index d5a4a83771..61f99c065f 100644 --- a/wxPython/src/_gdicmn.i +++ b/wxPython/src/_gdicmn.i @@ -176,6 +176,21 @@ than the corresponding dimensions of the size.", ""); "Decrements this object so that both of its dimensions are not greater than the corresponding dimensions of the size.", ""); + + DocDeclStr( + void , IncBy(int dx, int dy), + "", ""); + + + DocDeclStr( + void , DecBy(int dx, int dy), + "", ""); + +// TODO: handle these overloads too? +// void IncBy(const wxSize& sz); +// void IncBy(int d); +// void DecBy(const wxSize& sz); +// void DecBy(int d); DocDeclStr( void , Scale(float xscale, float yscale), diff --git a/wxPython/src/_image.i b/wxPython/src/_image.i index f083ba0d17..0c28784711 100644 --- a/wxPython/src/_image.i +++ b/wxPython/src/_image.i @@ -28,6 +28,13 @@ enum { }; +// Constants for wxImage::Scale() for determining the level of quality +enum +{ + wxIMAGE_QUALITY_NORMAL = 0, + wxIMAGE_QUALITY_HIGH = 1 +}; + //--------------------------------------------------------------------------- %newgroup @@ -399,19 +406,60 @@ initialized to black. Otherwise, the image data will be uninitialized.", ""); DocDeclStr( - wxImage , Scale( int width, int height ), + wxImage , Scale( int width, int height, int quality = wxIMAGE_QUALITY_NORMAL ), "Returns a scaled version of the image. This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a -`wx.MemoryDC` into another `wx.MemoryDC`.", " +`wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter +specifies what method to use for resampling the image. It can be +either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling +method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses +bicubic and box averaging resampling methods for upsampling and +downsampling respectively.", " + +It should be noted that although using wx.IMAGE_QUALITY_HIGH produces +much nicer looking results it is a slower method. Downsampling will +use the box averaging method which seems to operate very fast. If you +are upsampling larger images using this method you will most likely +notice that it is a bit slower and in extreme cases it will be quite +substantially slower as the bicubic algorithm has to process a lot of +data. + +It should also be noted that the high quality scaling may not work as +expected when using a single mask colour for transparency, as the +scaling will blur the image and will therefore remove the mask +partially. Using the alpha channel will work. :see: `Rescale`"); + + + wxImage ResampleBox(int width, int height) const; + wxImage ResampleBicubic(int width, int height) const; + + DocDeclStr( + wxImage , Blur(int radius), + "Blurs the image in both horizontal and vertical directions by the +specified pixel ``radius``. This should not be used when using a +single mask colour for transparency.", ""); + + DocDeclStr( + wxImage , BlurHorizontal(int radius), + "Blurs the image in the horizontal direction only. This should not be +used when using a single mask colour for transparency. +", ""); + + DocDeclStr( + wxImage , BlurVertical(int radius), + "Blurs the image in the vertical direction only. This should not be +used when using a single mask colour for transparency.", ""); + + DocDeclStr( wxImage , ShrinkBy( int xFactor , int yFactor ) const , "Return a version of the image scaled smaller by the given factors.", ""); DocDeclStr( - wxImage& , Rescale(int width, int height), + wxImage& , Rescale(int width, int height, int quality = wxIMAGE_QUALITY_NORMAL), "Changes the size of the image in-place by scaling it: after a call to this function, the image will have the given width and height. diff --git a/wxPython/src/_region.i b/wxPython/src/_region.i index 25fc06628b..779e9deaae 100644 --- a/wxPython/src/_region.i +++ b/wxPython/src/_region.i @@ -40,6 +40,27 @@ enum wxRegionContain }; +// // these constants are used with wxRegion::Combine() in the ports which have +// // this method +// enum wxRegionOp +// { +// // Creates the intersection of the two combined regions. +// wxRGN_AND, + +// // Creates a copy of the region +// wxRGN_COPY, + +// // Combines the parts of first region that are not in the second one +// wxRGN_DIFF, + +// // Creates the union of two combined regions. +// wxRGN_OR, + +// // Creates the union of two regions except for any overlapping areas. +// wxRGN_XOR +// }; + + MustHaveApp(wxRegion); @@ -72,6 +93,9 @@ public: bool IsEmpty(); + // Is region equal (i.e. covers the same area as another one)? + bool IsEqual(const wxRegion& region) const; + bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height); %Rename(UnionRect, bool, Union(const wxRect& rect)); %Rename(UnionRegion, bool, Union(const wxRegion& region)); @@ -97,8 +121,12 @@ public: const wxColour& transColour, int tolerance = 0)); + +// bool Combine(wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxRegionOp op); +// %Rename(CombineRect, bool , Combine(const wxRect& rect, wxRegionOp op)); +// %Rename(CombineRegion, bool , Combine(const wxRegion& region, wxRegionOp op)); - %property(Box, GetBox, doc="See `GetBox`"); + %property(Box, GetBox, doc="See `GetBox`"); }; diff --git a/wxPython/src/_textctrl.i b/wxPython/src/_textctrl.i index d5ccdbab89..20b89a9a23 100644 --- a/wxPython/src/_textctrl.i +++ b/wxPython/src/_textctrl.i @@ -110,7 +110,9 @@ enum wxTextCtrlHitTestResult enum { wxOutOfRangeTextCoord, - wxInvalidTextCoord + wxInvalidTextCoord, + + wxTEXT_TYPE_ANY }; //--------------------------------------------------------------------------- @@ -253,8 +255,8 @@ public: virtual void Remove(long from, long to); // load/save the controls contents from/to the file - virtual bool LoadFile(const wxString& file); - virtual bool SaveFile(const wxString& file = wxPyEmptyString); + virtual bool LoadFile(const wxString& file, int fileType = wxTEXT_TYPE_ANY); + virtual bool SaveFile(const wxString& file = wxPyEmptyString, int fileType = wxTEXT_TYPE_ANY); // sets/clears the dirty flag virtual void MarkDirty(); diff --git a/wxPython/src/gtk/_controls.py b/wxPython/src/gtk/_controls.py index 62f2e997c7..b44cec19f5 100644 --- a/wxPython/src/gtk/_controls.py +++ b/wxPython/src/gtk/_controls.py @@ -1532,6 +1532,7 @@ TE_HT_BELOW = _controls_.TE_HT_BELOW TE_HT_BEYOND = _controls_.TE_HT_BEYOND OutOfRangeTextCoord = _controls_.OutOfRangeTextCoord InvalidTextCoord = _controls_.InvalidTextCoord +TEXT_TYPE_ANY = _controls_.TEXT_TYPE_ANY class TextAttr(object): """Proxy of C++ TextAttr class""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -1770,11 +1771,11 @@ class TextCtrl(_core.Control): return _controls_.TextCtrl_Remove(*args, **kwargs) def LoadFile(*args, **kwargs): - """LoadFile(self, String file) -> bool""" + """LoadFile(self, String file, int fileType=TEXT_TYPE_ANY) -> bool""" return _controls_.TextCtrl_LoadFile(*args, **kwargs) def SaveFile(*args, **kwargs): - """SaveFile(self, String file=EmptyString) -> bool""" + """SaveFile(self, String file=EmptyString, int fileType=TEXT_TYPE_ANY) -> bool""" return _controls_.TextCtrl_SaveFile(*args, **kwargs) def MarkDirty(*args, **kwargs): diff --git a/wxPython/src/gtk/_controls_wrap.cpp b/wxPython/src/gtk/_controls_wrap.cpp index 4a6892cd36..51e5c23d2b 100644 --- a/wxPython/src/gtk/_controls_wrap.cpp +++ b/wxPython/src/gtk/_controls_wrap.cpp @@ -12472,17 +12472,21 @@ SWIGINTERN PyObject *_wrap_TextCtrl_LoadFile(PyObject *SWIGUNUSEDPARM(self), PyO PyObject *resultobj = 0; wxTextCtrl *arg1 = (wxTextCtrl *) 0 ; wxString *arg2 = 0 ; + int arg3 = (int) wxTEXT_TYPE_ANY ; bool result; void *argp1 = 0 ; int res1 = 0 ; bool temp2 = false ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "file", NULL + (char *) "self",(char *) "file",(char *) "fileType", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TextCtrl_LoadFile",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:TextCtrl_LoadFile",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxTextCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TextCtrl_LoadFile" "', expected argument " "1"" of type '" "wxTextCtrl *""'"); @@ -12493,9 +12497,16 @@ SWIGINTERN PyObject *_wrap_TextCtrl_LoadFile(PyObject *SWIGUNUSEDPARM(self), PyO if (arg2 == NULL) SWIG_fail; temp2 = true; } + if (obj2) { + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "TextCtrl_LoadFile" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->LoadFile((wxString const &)*arg2); + result = (bool)(arg1)->LoadFile((wxString const &)*arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -12521,17 +12532,21 @@ SWIGINTERN PyObject *_wrap_TextCtrl_SaveFile(PyObject *SWIGUNUSEDPARM(self), PyO wxTextCtrl *arg1 = (wxTextCtrl *) 0 ; wxString const &arg2_defvalue = wxPyEmptyString ; wxString *arg2 = (wxString *) &arg2_defvalue ; + int arg3 = (int) wxTEXT_TYPE_ANY ; bool result; void *argp1 = 0 ; int res1 = 0 ; bool temp2 = false ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "file", NULL + (char *) "self",(char *) "file",(char *) "fileType", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:TextCtrl_SaveFile",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OO:TextCtrl_SaveFile",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxTextCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TextCtrl_SaveFile" "', expected argument " "1"" of type '" "wxTextCtrl *""'"); @@ -12544,9 +12559,16 @@ SWIGINTERN PyObject *_wrap_TextCtrl_SaveFile(PyObject *SWIGUNUSEDPARM(self), PyO temp2 = true; } } + if (obj2) { + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "TextCtrl_SaveFile" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->SaveFile((wxString const &)*arg2); + result = (bool)(arg1)->SaveFile((wxString const &)*arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -48709,6 +48731,7 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "TE_HT_BEYOND",SWIG_From_int(static_cast< int >(wxTE_HT_BEYOND))); SWIG_Python_SetConstant(d, "OutOfRangeTextCoord",SWIG_From_int(static_cast< int >(wxOutOfRangeTextCoord))); SWIG_Python_SetConstant(d, "InvalidTextCoord",SWIG_From_int(static_cast< int >(wxInvalidTextCoord))); + SWIG_Python_SetConstant(d, "TEXT_TYPE_ANY",SWIG_From_int(static_cast< int >(wxTEXT_TYPE_ANY))); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_UPDATED", PyInt_FromLong(wxEVT_COMMAND_TEXT_UPDATED)); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_ENTER", PyInt_FromLong(wxEVT_COMMAND_TEXT_ENTER)); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_URL", PyInt_FromLong(wxEVT_COMMAND_TEXT_URL)); diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index 1138962a0b..8f06644198 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -841,6 +841,14 @@ class Size(object): """ return _core_.Size_DecTo(*args, **kwargs) + def IncBy(*args, **kwargs): + """IncBy(self, int dx, int dy)""" + return _core_.Size_IncBy(*args, **kwargs) + + def DecBy(*args, **kwargs): + """DecBy(self, int dx, int dy)""" + return _core_.Size_DecBy(*args, **kwargs) + def Scale(*args, **kwargs): """ Scale(self, float xscale, float yscale) @@ -2028,6 +2036,8 @@ def MemoryFSHandler_RemoveFile(*args, **kwargs): IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE +IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL +IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH #--------------------------------------------------------------------------- class ImageHandler(Object): @@ -2312,14 +2322,56 @@ class Image(Object): def Scale(*args, **kwargs): """ - Scale(self, int width, int height) -> Image + Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image Returns a scaled version of the image. This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a - `wx.MemoryDC` into another `wx.MemoryDC`. + `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter + specifies what method to use for resampling the image. It can be + either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling + method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses + bicubic and box averaging resampling methods for upsampling and + downsampling respectively. """ return _core_.Image_Scale(*args, **kwargs) + def ResampleBox(*args, **kwargs): + """ResampleBox(self, int width, int height) -> Image""" + return _core_.Image_ResampleBox(*args, **kwargs) + + def ResampleBicubic(*args, **kwargs): + """ResampleBicubic(self, int width, int height) -> Image""" + return _core_.Image_ResampleBicubic(*args, **kwargs) + + def Blur(*args, **kwargs): + """ + Blur(self, int radius) -> Image + + Blurs the image in both horizontal and vertical directions by the + specified pixel ``radius``. This should not be used when using a + single mask colour for transparency. + """ + return _core_.Image_Blur(*args, **kwargs) + + def BlurHorizontal(*args, **kwargs): + """ + BlurHorizontal(self, int radius) -> Image + + Blurs the image in the horizontal direction only. This should not be + used when using a single mask colour for transparency. + + """ + return _core_.Image_BlurHorizontal(*args, **kwargs) + + def BlurVertical(*args, **kwargs): + """ + BlurVertical(self, int radius) -> Image + + Blurs the image in the vertical direction only. This should not be + used when using a single mask colour for transparency. + """ + return _core_.Image_BlurVertical(*args, **kwargs) + def ShrinkBy(*args, **kwargs): """ ShrinkBy(self, int xFactor, int yFactor) -> Image @@ -2330,7 +2382,7 @@ class Image(Object): def Rescale(*args, **kwargs): """ - Rescale(self, int width, int height) -> Image + Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image Changes the size of the image in-place by scaling it: after a call to this function, the image will have the given width and height. diff --git a/wxPython/src/gtk/_core_wrap.cpp b/wxPython/src/gtk/_core_wrap.cpp index 0d29af571e..95f7a28f7c 100644 --- a/wxPython/src/gtk/_core_wrap.cpp +++ b/wxPython/src/gtk/_core_wrap.cpp @@ -4867,6 +4867,100 @@ fail: } +SWIGINTERN PyObject *_wrap_Size_IncBy(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxSize *arg1 = (wxSize *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "dx",(char *) "dy", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Size_IncBy",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSize, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Size_IncBy" "', expected argument " "1"" of type '" "wxSize *""'"); + } + arg1 = reinterpret_cast< wxSize * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Size_IncBy" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Size_IncBy" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->IncBy(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Size_DecBy(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxSize *arg1 = (wxSize *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "dx",(char *) "dy", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Size_DecBy",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSize, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Size_DecBy" "', expected argument " "1"" of type '" "wxSize *""'"); + } + arg1 = reinterpret_cast< wxSize * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Size_DecBy" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Size_DecBy" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->DecBy(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Size_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxSize *arg1 = (wxSize *) 0 ; @@ -13779,6 +13873,7 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject wxImage *arg1 = (wxImage *) 0 ; int arg2 ; int arg3 ; + int arg4 = (int) wxIMAGE_QUALITY_NORMAL ; SwigValueWrapper result; void *argp1 = 0 ; int res1 = 0 ; @@ -13786,14 +13881,17 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "width",(char *) "height", NULL + (char *) "self",(char *) "width",(char *) "height",(char *) "quality", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_Scale",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_Scale",kwnames,&obj0,&obj1,&obj2,&obj3)) 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_Scale" "', expected argument " "1"" of type '" "wxImage *""'"); @@ -13809,9 +13907,229 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_Scale" "', expected argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); + if (obj3) { + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Image_Scale" "', expected argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (arg1)->Scale(arg2,arg3); + result = (arg1)->Scale(arg2,arg3,arg4); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_ResampleBox(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + int arg3 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "width",(char *) "height", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_ResampleBox",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_ResampleBox" "', expected argument " "1"" of type '" "wxImage const *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_ResampleBox" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_ResampleBox" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxImage const *)arg1)->ResampleBox(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_ResampleBicubic(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + int arg3 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "width",(char *) "height", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_ResampleBicubic",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_ResampleBicubic" "', expected argument " "1"" of type '" "wxImage const *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_ResampleBicubic" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_ResampleBicubic" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxImage const *)arg1)->ResampleBicubic(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_Blur(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_Blur",kwnames,&obj0,&obj1)) 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_Blur" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_Blur" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->Blur(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_BlurHorizontal(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_BlurHorizontal",kwnames,&obj0,&obj1)) 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_BlurHorizontal" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_BlurHorizontal" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->BlurHorizontal(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_BlurVertical(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_BlurVertical",kwnames,&obj0,&obj1)) 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_BlurVertical" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_BlurVertical" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->BlurVertical(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -13875,6 +14193,7 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec wxImage *arg1 = (wxImage *) 0 ; int arg2 ; int arg3 ; + int arg4 = (int) wxIMAGE_QUALITY_NORMAL ; wxImage *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -13882,14 +14201,17 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "width",(char *) "height", NULL + (char *) "self",(char *) "width",(char *) "height",(char *) "quality", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_Rescale",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_Rescale",kwnames,&obj0,&obj1,&obj2,&obj3)) 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_Rescale" "', expected argument " "1"" of type '" "wxImage *""'"); @@ -13905,10 +14227,17 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_Rescale" "', expected argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); + if (obj3) { + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Image_Rescale" "', expected argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); { - wxImage &_result_ref = (arg1)->Rescale(arg2,arg3); + wxImage &_result_ref = (arg1)->Rescale(arg2,arg3,arg4); result = (wxImage *) &_result_ref; } wxPyEndAllowThreads(__tstate); @@ -53866,6 +54195,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Size___sub__", (PyCFunction) _wrap_Size___sub__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_IncTo", (PyCFunction) _wrap_Size_IncTo, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_DecTo", (PyCFunction) _wrap_Size_DecTo, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Size_IncBy", (PyCFunction) _wrap_Size_IncBy, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Size_DecBy", (PyCFunction) _wrap_Size_DecBy, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_Scale", (PyCFunction) _wrap_Size_Scale, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_Set", (PyCFunction) _wrap_Size_Set, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_SetWidth", (PyCFunction) _wrap_Size_SetWidth, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -54135,6 +54466,11 @@ static PyMethodDef SwigMethods[] = { { (char *)"Image_Create", (PyCFunction) _wrap_Image_Create, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Destroy", (PyCFunction)_wrap_Image_Destroy, METH_O, NULL}, { (char *)"Image_Scale", (PyCFunction) _wrap_Image_Scale, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_ResampleBox", (PyCFunction) _wrap_Image_ResampleBox, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_ResampleBicubic", (PyCFunction) _wrap_Image_ResampleBicubic, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_Blur", (PyCFunction) _wrap_Image_Blur, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_BlurHorizontal", (PyCFunction) _wrap_Image_BlurHorizontal, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_BlurVertical", (PyCFunction) _wrap_Image_BlurVertical, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_ShrinkBy", (PyCFunction) _wrap_Image_ShrinkBy, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Rescale", (PyCFunction) _wrap_Image_Rescale, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Resize", (PyCFunction) _wrap_Image_Resize, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -57580,6 +57916,8 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "IMAGE_ALPHA_TRANSPARENT",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_TRANSPARENT))); SWIG_Python_SetConstant(d, "IMAGE_ALPHA_THRESHOLD",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_THRESHOLD))); SWIG_Python_SetConstant(d, "IMAGE_ALPHA_OPAQUE",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_OPAQUE))); + SWIG_Python_SetConstant(d, "IMAGE_QUALITY_NORMAL",SWIG_From_int(static_cast< int >(wxIMAGE_QUALITY_NORMAL))); + SWIG_Python_SetConstant(d, "IMAGE_QUALITY_HIGH",SWIG_From_int(static_cast< int >(wxIMAGE_QUALITY_HIGH))); SWIG_addvarlink(SWIG_globals(),(char*)"NullImage",NullImage_get, NullImage_set); SWIG_addvarlink(SWIG_globals(),(char*)"IMAGE_OPTION_FILENAME",IMAGE_OPTION_FILENAME_get, IMAGE_OPTION_FILENAME_set); SWIG_addvarlink(SWIG_globals(),(char*)"IMAGE_OPTION_BMP_FORMAT",IMAGE_OPTION_BMP_FORMAT_get, IMAGE_OPTION_BMP_FORMAT_set); diff --git a/wxPython/src/gtk/_gdi.py b/wxPython/src/gtk/_gdi.py index d2882c2a47..a8d27a608d 100644 --- a/wxPython/src/gtk/_gdi.py +++ b/wxPython/src/gtk/_gdi.py @@ -1339,6 +1339,10 @@ class Region(GDIObject): """IsEmpty(self) -> bool""" return _gdi_.Region_IsEmpty(*args, **kwargs) + def IsEqual(*args, **kwargs): + """IsEqual(self, Region region) -> bool""" + return _gdi_.Region_IsEqual(*args, **kwargs) + def Union(*args, **kwargs): """Union(self, int x, int y, int width, int height) -> bool""" return _gdi_.Region_Union(*args, **kwargs) diff --git a/wxPython/src/gtk/_gdi_wrap.cpp b/wxPython/src/gtk/_gdi_wrap.cpp index 77da6603ec..c5b601d26e 100644 --- a/wxPython/src/gtk/_gdi_wrap.cpp +++ b/wxPython/src/gtk/_gdi_wrap.cpp @@ -10528,6 +10528,50 @@ fail: } +SWIGINTERN PyObject *_wrap_Region_IsEqual(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxRegion *arg1 = (wxRegion *) 0 ; + wxRegion *arg2 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "region", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Region_IsEqual",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxRegion, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Region_IsEqual" "', expected argument " "1"" of type '" "wxRegion const *""'"); + } + arg1 = reinterpret_cast< wxRegion * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_wxRegion, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Region_IsEqual" "', expected argument " "2"" of type '" "wxRegion const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Region_IsEqual" "', expected argument " "2"" of type '" "wxRegion const &""'"); + } + arg2 = reinterpret_cast< wxRegion * >(argp2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxRegion const *)arg1)->IsEqual((wxRegion const &)*arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Region_Union(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxRegion *arg1 = (wxRegion *) 0 ; @@ -31344,6 +31388,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Region_IntersectRect", (PyCFunction) _wrap_Region_IntersectRect, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_IntersectRegion", (PyCFunction) _wrap_Region_IntersectRegion, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_IsEmpty", (PyCFunction)_wrap_Region_IsEmpty, METH_O, NULL}, + { (char *)"Region_IsEqual", (PyCFunction) _wrap_Region_IsEqual, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_Union", (PyCFunction) _wrap_Region_Union, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_UnionRect", (PyCFunction) _wrap_Region_UnionRect, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_UnionRegion", (PyCFunction) _wrap_Region_UnionRegion, METH_VARARGS | METH_KEYWORDS, NULL}, diff --git a/wxPython/src/mac/_controls.py b/wxPython/src/mac/_controls.py index e477c0d8df..6d08c33acd 100644 --- a/wxPython/src/mac/_controls.py +++ b/wxPython/src/mac/_controls.py @@ -1525,6 +1525,7 @@ TE_HT_BELOW = _controls_.TE_HT_BELOW TE_HT_BEYOND = _controls_.TE_HT_BEYOND OutOfRangeTextCoord = _controls_.OutOfRangeTextCoord InvalidTextCoord = _controls_.InvalidTextCoord +TEXT_TYPE_ANY = _controls_.TEXT_TYPE_ANY class TextAttr(object): """Proxy of C++ TextAttr class""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -1763,11 +1764,11 @@ class TextCtrl(_core.Control): return _controls_.TextCtrl_Remove(*args, **kwargs) def LoadFile(*args, **kwargs): - """LoadFile(self, String file) -> bool""" + """LoadFile(self, String file, int fileType=TEXT_TYPE_ANY) -> bool""" return _controls_.TextCtrl_LoadFile(*args, **kwargs) def SaveFile(*args, **kwargs): - """SaveFile(self, String file=EmptyString) -> bool""" + """SaveFile(self, String file=EmptyString, int fileType=TEXT_TYPE_ANY) -> bool""" return _controls_.TextCtrl_SaveFile(*args, **kwargs) def MarkDirty(*args, **kwargs): diff --git a/wxPython/src/mac/_controls_wrap.cpp b/wxPython/src/mac/_controls_wrap.cpp index 2cebe72bba..1fa74ff7f9 100644 --- a/wxPython/src/mac/_controls_wrap.cpp +++ b/wxPython/src/mac/_controls_wrap.cpp @@ -12397,17 +12397,21 @@ SWIGINTERN PyObject *_wrap_TextCtrl_LoadFile(PyObject *SWIGUNUSEDPARM(self), PyO PyObject *resultobj = 0; wxTextCtrl *arg1 = (wxTextCtrl *) 0 ; wxString *arg2 = 0 ; + int arg3 = (int) wxTEXT_TYPE_ANY ; bool result; void *argp1 = 0 ; int res1 = 0 ; bool temp2 = false ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "file", NULL + (char *) "self",(char *) "file",(char *) "fileType", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TextCtrl_LoadFile",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:TextCtrl_LoadFile",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxTextCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TextCtrl_LoadFile" "', expected argument " "1"" of type '" "wxTextCtrl *""'"); @@ -12418,9 +12422,16 @@ SWIGINTERN PyObject *_wrap_TextCtrl_LoadFile(PyObject *SWIGUNUSEDPARM(self), PyO if (arg2 == NULL) SWIG_fail; temp2 = true; } + if (obj2) { + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "TextCtrl_LoadFile" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->LoadFile((wxString const &)*arg2); + result = (bool)(arg1)->LoadFile((wxString const &)*arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -12446,17 +12457,21 @@ SWIGINTERN PyObject *_wrap_TextCtrl_SaveFile(PyObject *SWIGUNUSEDPARM(self), PyO wxTextCtrl *arg1 = (wxTextCtrl *) 0 ; wxString const &arg2_defvalue = wxPyEmptyString ; wxString *arg2 = (wxString *) &arg2_defvalue ; + int arg3 = (int) wxTEXT_TYPE_ANY ; bool result; void *argp1 = 0 ; int res1 = 0 ; bool temp2 = false ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "file", NULL + (char *) "self",(char *) "file",(char *) "fileType", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:TextCtrl_SaveFile",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OO:TextCtrl_SaveFile",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxTextCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TextCtrl_SaveFile" "', expected argument " "1"" of type '" "wxTextCtrl *""'"); @@ -12469,9 +12484,16 @@ SWIGINTERN PyObject *_wrap_TextCtrl_SaveFile(PyObject *SWIGUNUSEDPARM(self), PyO temp2 = true; } } + if (obj2) { + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "TextCtrl_SaveFile" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->SaveFile((wxString const &)*arg2); + result = (bool)(arg1)->SaveFile((wxString const &)*arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -48632,6 +48654,7 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "TE_HT_BEYOND",SWIG_From_int(static_cast< int >(wxTE_HT_BEYOND))); SWIG_Python_SetConstant(d, "OutOfRangeTextCoord",SWIG_From_int(static_cast< int >(wxOutOfRangeTextCoord))); SWIG_Python_SetConstant(d, "InvalidTextCoord",SWIG_From_int(static_cast< int >(wxInvalidTextCoord))); + SWIG_Python_SetConstant(d, "TEXT_TYPE_ANY",SWIG_From_int(static_cast< int >(wxTEXT_TYPE_ANY))); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_UPDATED", PyInt_FromLong(wxEVT_COMMAND_TEXT_UPDATED)); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_ENTER", PyInt_FromLong(wxEVT_COMMAND_TEXT_ENTER)); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_URL", PyInt_FromLong(wxEVT_COMMAND_TEXT_URL)); diff --git a/wxPython/src/mac/_core.py b/wxPython/src/mac/_core.py index 1138962a0b..8f06644198 100644 --- a/wxPython/src/mac/_core.py +++ b/wxPython/src/mac/_core.py @@ -841,6 +841,14 @@ class Size(object): """ return _core_.Size_DecTo(*args, **kwargs) + def IncBy(*args, **kwargs): + """IncBy(self, int dx, int dy)""" + return _core_.Size_IncBy(*args, **kwargs) + + def DecBy(*args, **kwargs): + """DecBy(self, int dx, int dy)""" + return _core_.Size_DecBy(*args, **kwargs) + def Scale(*args, **kwargs): """ Scale(self, float xscale, float yscale) @@ -2028,6 +2036,8 @@ def MemoryFSHandler_RemoveFile(*args, **kwargs): IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE +IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL +IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH #--------------------------------------------------------------------------- class ImageHandler(Object): @@ -2312,14 +2322,56 @@ class Image(Object): def Scale(*args, **kwargs): """ - Scale(self, int width, int height) -> Image + Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image Returns a scaled version of the image. This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a - `wx.MemoryDC` into another `wx.MemoryDC`. + `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter + specifies what method to use for resampling the image. It can be + either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling + method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses + bicubic and box averaging resampling methods for upsampling and + downsampling respectively. """ return _core_.Image_Scale(*args, **kwargs) + def ResampleBox(*args, **kwargs): + """ResampleBox(self, int width, int height) -> Image""" + return _core_.Image_ResampleBox(*args, **kwargs) + + def ResampleBicubic(*args, **kwargs): + """ResampleBicubic(self, int width, int height) -> Image""" + return _core_.Image_ResampleBicubic(*args, **kwargs) + + def Blur(*args, **kwargs): + """ + Blur(self, int radius) -> Image + + Blurs the image in both horizontal and vertical directions by the + specified pixel ``radius``. This should not be used when using a + single mask colour for transparency. + """ + return _core_.Image_Blur(*args, **kwargs) + + def BlurHorizontal(*args, **kwargs): + """ + BlurHorizontal(self, int radius) -> Image + + Blurs the image in the horizontal direction only. This should not be + used when using a single mask colour for transparency. + + """ + return _core_.Image_BlurHorizontal(*args, **kwargs) + + def BlurVertical(*args, **kwargs): + """ + BlurVertical(self, int radius) -> Image + + Blurs the image in the vertical direction only. This should not be + used when using a single mask colour for transparency. + """ + return _core_.Image_BlurVertical(*args, **kwargs) + def ShrinkBy(*args, **kwargs): """ ShrinkBy(self, int xFactor, int yFactor) -> Image @@ -2330,7 +2382,7 @@ class Image(Object): def Rescale(*args, **kwargs): """ - Rescale(self, int width, int height) -> Image + Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image Changes the size of the image in-place by scaling it: after a call to this function, the image will have the given width and height. diff --git a/wxPython/src/mac/_core_wrap.cpp b/wxPython/src/mac/_core_wrap.cpp index deec045029..47a8d48d05 100644 --- a/wxPython/src/mac/_core_wrap.cpp +++ b/wxPython/src/mac/_core_wrap.cpp @@ -4866,6 +4866,100 @@ fail: } +SWIGINTERN PyObject *_wrap_Size_IncBy(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxSize *arg1 = (wxSize *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "dx",(char *) "dy", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Size_IncBy",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSize, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Size_IncBy" "', expected argument " "1"" of type '" "wxSize *""'"); + } + arg1 = reinterpret_cast< wxSize * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Size_IncBy" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Size_IncBy" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->IncBy(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Size_DecBy(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxSize *arg1 = (wxSize *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "dx",(char *) "dy", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Size_DecBy",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSize, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Size_DecBy" "', expected argument " "1"" of type '" "wxSize *""'"); + } + arg1 = reinterpret_cast< wxSize * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Size_DecBy" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Size_DecBy" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->DecBy(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Size_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxSize *arg1 = (wxSize *) 0 ; @@ -13778,6 +13872,7 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject wxImage *arg1 = (wxImage *) 0 ; int arg2 ; int arg3 ; + int arg4 = (int) wxIMAGE_QUALITY_NORMAL ; SwigValueWrapper result; void *argp1 = 0 ; int res1 = 0 ; @@ -13785,14 +13880,17 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "width",(char *) "height", NULL + (char *) "self",(char *) "width",(char *) "height",(char *) "quality", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_Scale",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_Scale",kwnames,&obj0,&obj1,&obj2,&obj3)) 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_Scale" "', expected argument " "1"" of type '" "wxImage *""'"); @@ -13808,9 +13906,229 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_Scale" "', expected argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); + if (obj3) { + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Image_Scale" "', expected argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (arg1)->Scale(arg2,arg3); + result = (arg1)->Scale(arg2,arg3,arg4); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_ResampleBox(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + int arg3 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "width",(char *) "height", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_ResampleBox",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_ResampleBox" "', expected argument " "1"" of type '" "wxImage const *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_ResampleBox" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_ResampleBox" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxImage const *)arg1)->ResampleBox(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_ResampleBicubic(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + int arg3 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "width",(char *) "height", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_ResampleBicubic",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_ResampleBicubic" "', expected argument " "1"" of type '" "wxImage const *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_ResampleBicubic" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_ResampleBicubic" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxImage const *)arg1)->ResampleBicubic(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_Blur(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_Blur",kwnames,&obj0,&obj1)) 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_Blur" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_Blur" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->Blur(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_BlurHorizontal(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_BlurHorizontal",kwnames,&obj0,&obj1)) 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_BlurHorizontal" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_BlurHorizontal" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->BlurHorizontal(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_BlurVertical(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_BlurVertical",kwnames,&obj0,&obj1)) 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_BlurVertical" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_BlurVertical" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->BlurVertical(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -13874,6 +14192,7 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec wxImage *arg1 = (wxImage *) 0 ; int arg2 ; int arg3 ; + int arg4 = (int) wxIMAGE_QUALITY_NORMAL ; wxImage *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -13881,14 +14200,17 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "width",(char *) "height", NULL + (char *) "self",(char *) "width",(char *) "height",(char *) "quality", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_Rescale",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_Rescale",kwnames,&obj0,&obj1,&obj2,&obj3)) 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_Rescale" "', expected argument " "1"" of type '" "wxImage *""'"); @@ -13904,10 +14226,17 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_Rescale" "', expected argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); + if (obj3) { + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Image_Rescale" "', expected argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); { - wxImage &_result_ref = (arg1)->Rescale(arg2,arg3); + wxImage &_result_ref = (arg1)->Rescale(arg2,arg3,arg4); result = (wxImage *) &_result_ref; } wxPyEndAllowThreads(__tstate); @@ -53865,6 +54194,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Size___sub__", (PyCFunction) _wrap_Size___sub__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_IncTo", (PyCFunction) _wrap_Size_IncTo, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_DecTo", (PyCFunction) _wrap_Size_DecTo, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Size_IncBy", (PyCFunction) _wrap_Size_IncBy, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Size_DecBy", (PyCFunction) _wrap_Size_DecBy, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_Scale", (PyCFunction) _wrap_Size_Scale, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_Set", (PyCFunction) _wrap_Size_Set, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_SetWidth", (PyCFunction) _wrap_Size_SetWidth, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -54134,6 +54465,11 @@ static PyMethodDef SwigMethods[] = { { (char *)"Image_Create", (PyCFunction) _wrap_Image_Create, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Destroy", (PyCFunction)_wrap_Image_Destroy, METH_O, NULL}, { (char *)"Image_Scale", (PyCFunction) _wrap_Image_Scale, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_ResampleBox", (PyCFunction) _wrap_Image_ResampleBox, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_ResampleBicubic", (PyCFunction) _wrap_Image_ResampleBicubic, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_Blur", (PyCFunction) _wrap_Image_Blur, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_BlurHorizontal", (PyCFunction) _wrap_Image_BlurHorizontal, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_BlurVertical", (PyCFunction) _wrap_Image_BlurVertical, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_ShrinkBy", (PyCFunction) _wrap_Image_ShrinkBy, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Rescale", (PyCFunction) _wrap_Image_Rescale, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Resize", (PyCFunction) _wrap_Image_Resize, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -57579,6 +57915,8 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "IMAGE_ALPHA_TRANSPARENT",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_TRANSPARENT))); SWIG_Python_SetConstant(d, "IMAGE_ALPHA_THRESHOLD",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_THRESHOLD))); SWIG_Python_SetConstant(d, "IMAGE_ALPHA_OPAQUE",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_OPAQUE))); + SWIG_Python_SetConstant(d, "IMAGE_QUALITY_NORMAL",SWIG_From_int(static_cast< int >(wxIMAGE_QUALITY_NORMAL))); + SWIG_Python_SetConstant(d, "IMAGE_QUALITY_HIGH",SWIG_From_int(static_cast< int >(wxIMAGE_QUALITY_HIGH))); SWIG_addvarlink(SWIG_globals(),(char*)"NullImage",NullImage_get, NullImage_set); SWIG_addvarlink(SWIG_globals(),(char*)"IMAGE_OPTION_FILENAME",IMAGE_OPTION_FILENAME_get, IMAGE_OPTION_FILENAME_set); SWIG_addvarlink(SWIG_globals(),(char*)"IMAGE_OPTION_BMP_FORMAT",IMAGE_OPTION_BMP_FORMAT_get, IMAGE_OPTION_BMP_FORMAT_set); diff --git a/wxPython/src/mac/_gdi.py b/wxPython/src/mac/_gdi.py index c0ede485dd..22daacf9bb 100644 --- a/wxPython/src/mac/_gdi.py +++ b/wxPython/src/mac/_gdi.py @@ -1338,6 +1338,10 @@ class Region(GDIObject): """IsEmpty(self) -> bool""" return _gdi_.Region_IsEmpty(*args, **kwargs) + def IsEqual(*args, **kwargs): + """IsEqual(self, Region region) -> bool""" + return _gdi_.Region_IsEqual(*args, **kwargs) + def Union(*args, **kwargs): """Union(self, int x, int y, int width, int height) -> bool""" return _gdi_.Region_Union(*args, **kwargs) diff --git a/wxPython/src/mac/_gdi_wrap.cpp b/wxPython/src/mac/_gdi_wrap.cpp index fa9a7b0197..2dd0c0fb87 100644 --- a/wxPython/src/mac/_gdi_wrap.cpp +++ b/wxPython/src/mac/_gdi_wrap.cpp @@ -10513,6 +10513,50 @@ fail: } +SWIGINTERN PyObject *_wrap_Region_IsEqual(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxRegion *arg1 = (wxRegion *) 0 ; + wxRegion *arg2 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "region", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Region_IsEqual",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxRegion, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Region_IsEqual" "', expected argument " "1"" of type '" "wxRegion const *""'"); + } + arg1 = reinterpret_cast< wxRegion * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_wxRegion, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Region_IsEqual" "', expected argument " "2"" of type '" "wxRegion const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Region_IsEqual" "', expected argument " "2"" of type '" "wxRegion const &""'"); + } + arg2 = reinterpret_cast< wxRegion * >(argp2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxRegion const *)arg1)->IsEqual((wxRegion const &)*arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Region_Union(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxRegion *arg1 = (wxRegion *) 0 ; @@ -31553,6 +31597,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Region_IntersectRect", (PyCFunction) _wrap_Region_IntersectRect, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_IntersectRegion", (PyCFunction) _wrap_Region_IntersectRegion, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_IsEmpty", (PyCFunction)_wrap_Region_IsEmpty, METH_O, NULL}, + { (char *)"Region_IsEqual", (PyCFunction) _wrap_Region_IsEqual, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_Union", (PyCFunction) _wrap_Region_Union, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_UnionRect", (PyCFunction) _wrap_Region_UnionRect, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_UnionRegion", (PyCFunction) _wrap_Region_UnionRegion, METH_VARARGS | METH_KEYWORDS, NULL}, diff --git a/wxPython/src/msw/_controls.py b/wxPython/src/msw/_controls.py index 6b3845d939..84f31a7dc3 100644 --- a/wxPython/src/msw/_controls.py +++ b/wxPython/src/msw/_controls.py @@ -1532,6 +1532,7 @@ TE_HT_BELOW = _controls_.TE_HT_BELOW TE_HT_BEYOND = _controls_.TE_HT_BEYOND OutOfRangeTextCoord = _controls_.OutOfRangeTextCoord InvalidTextCoord = _controls_.InvalidTextCoord +TEXT_TYPE_ANY = _controls_.TEXT_TYPE_ANY class TextAttr(object): """Proxy of C++ TextAttr class""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -1770,11 +1771,11 @@ class TextCtrl(_core.Control): return _controls_.TextCtrl_Remove(*args, **kwargs) def LoadFile(*args, **kwargs): - """LoadFile(self, String file) -> bool""" + """LoadFile(self, String file, int fileType=TEXT_TYPE_ANY) -> bool""" return _controls_.TextCtrl_LoadFile(*args, **kwargs) def SaveFile(*args, **kwargs): - """SaveFile(self, String file=EmptyString) -> bool""" + """SaveFile(self, String file=EmptyString, int fileType=TEXT_TYPE_ANY) -> bool""" return _controls_.TextCtrl_SaveFile(*args, **kwargs) def MarkDirty(*args, **kwargs): diff --git a/wxPython/src/msw/_controls_wrap.cpp b/wxPython/src/msw/_controls_wrap.cpp index 0fb94e2d56..8e2ed0cf4e 100644 --- a/wxPython/src/msw/_controls_wrap.cpp +++ b/wxPython/src/msw/_controls_wrap.cpp @@ -12472,17 +12472,21 @@ SWIGINTERN PyObject *_wrap_TextCtrl_LoadFile(PyObject *SWIGUNUSEDPARM(self), PyO PyObject *resultobj = 0; wxTextCtrl *arg1 = (wxTextCtrl *) 0 ; wxString *arg2 = 0 ; + int arg3 = (int) wxTEXT_TYPE_ANY ; bool result; void *argp1 = 0 ; int res1 = 0 ; bool temp2 = false ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "file", NULL + (char *) "self",(char *) "file",(char *) "fileType", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TextCtrl_LoadFile",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:TextCtrl_LoadFile",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxTextCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TextCtrl_LoadFile" "', expected argument " "1"" of type '" "wxTextCtrl *""'"); @@ -12493,9 +12497,16 @@ SWIGINTERN PyObject *_wrap_TextCtrl_LoadFile(PyObject *SWIGUNUSEDPARM(self), PyO if (arg2 == NULL) SWIG_fail; temp2 = true; } + if (obj2) { + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "TextCtrl_LoadFile" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->LoadFile((wxString const &)*arg2); + result = (bool)(arg1)->LoadFile((wxString const &)*arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -12521,17 +12532,21 @@ SWIGINTERN PyObject *_wrap_TextCtrl_SaveFile(PyObject *SWIGUNUSEDPARM(self), PyO wxTextCtrl *arg1 = (wxTextCtrl *) 0 ; wxString const &arg2_defvalue = wxPyEmptyString ; wxString *arg2 = (wxString *) &arg2_defvalue ; + int arg3 = (int) wxTEXT_TYPE_ANY ; bool result; void *argp1 = 0 ; int res1 = 0 ; bool temp2 = false ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "file", NULL + (char *) "self",(char *) "file",(char *) "fileType", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:TextCtrl_SaveFile",kwnames,&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OO:TextCtrl_SaveFile",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxTextCtrl, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TextCtrl_SaveFile" "', expected argument " "1"" of type '" "wxTextCtrl *""'"); @@ -12544,9 +12559,16 @@ SWIGINTERN PyObject *_wrap_TextCtrl_SaveFile(PyObject *SWIGUNUSEDPARM(self), PyO temp2 = true; } } + if (obj2) { + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "TextCtrl_SaveFile" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->SaveFile((wxString const &)*arg2); + result = (bool)(arg1)->SaveFile((wxString const &)*arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -48932,6 +48954,7 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "TE_HT_BEYOND",SWIG_From_int(static_cast< int >(wxTE_HT_BEYOND))); SWIG_Python_SetConstant(d, "OutOfRangeTextCoord",SWIG_From_int(static_cast< int >(wxOutOfRangeTextCoord))); SWIG_Python_SetConstant(d, "InvalidTextCoord",SWIG_From_int(static_cast< int >(wxInvalidTextCoord))); + SWIG_Python_SetConstant(d, "TEXT_TYPE_ANY",SWIG_From_int(static_cast< int >(wxTEXT_TYPE_ANY))); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_UPDATED", PyInt_FromLong(wxEVT_COMMAND_TEXT_UPDATED)); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_ENTER", PyInt_FromLong(wxEVT_COMMAND_TEXT_ENTER)); PyDict_SetItemString(d, "wxEVT_COMMAND_TEXT_URL", PyInt_FromLong(wxEVT_COMMAND_TEXT_URL)); diff --git a/wxPython/src/msw/_core.py b/wxPython/src/msw/_core.py index e91dc1f2c3..40f94cdb62 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_core.py @@ -841,6 +841,14 @@ class Size(object): """ return _core_.Size_DecTo(*args, **kwargs) + def IncBy(*args, **kwargs): + """IncBy(self, int dx, int dy)""" + return _core_.Size_IncBy(*args, **kwargs) + + def DecBy(*args, **kwargs): + """DecBy(self, int dx, int dy)""" + return _core_.Size_DecBy(*args, **kwargs) + def Scale(*args, **kwargs): """ Scale(self, float xscale, float yscale) @@ -2028,6 +2036,8 @@ def MemoryFSHandler_RemoveFile(*args, **kwargs): IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE +IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL +IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH #--------------------------------------------------------------------------- class ImageHandler(Object): @@ -2312,14 +2322,56 @@ class Image(Object): def Scale(*args, **kwargs): """ - Scale(self, int width, int height) -> Image + Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image Returns a scaled version of the image. This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a - `wx.MemoryDC` into another `wx.MemoryDC`. + `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter + specifies what method to use for resampling the image. It can be + either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling + method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses + bicubic and box averaging resampling methods for upsampling and + downsampling respectively. """ return _core_.Image_Scale(*args, **kwargs) + def ResampleBox(*args, **kwargs): + """ResampleBox(self, int width, int height) -> Image""" + return _core_.Image_ResampleBox(*args, **kwargs) + + def ResampleBicubic(*args, **kwargs): + """ResampleBicubic(self, int width, int height) -> Image""" + return _core_.Image_ResampleBicubic(*args, **kwargs) + + def Blur(*args, **kwargs): + """ + Blur(self, int radius) -> Image + + Blurs the image in both horizontal and vertical directions by the + specified pixel ``radius``. This should not be used when using a + single mask colour for transparency. + """ + return _core_.Image_Blur(*args, **kwargs) + + def BlurHorizontal(*args, **kwargs): + """ + BlurHorizontal(self, int radius) -> Image + + Blurs the image in the horizontal direction only. This should not be + used when using a single mask colour for transparency. + + """ + return _core_.Image_BlurHorizontal(*args, **kwargs) + + def BlurVertical(*args, **kwargs): + """ + BlurVertical(self, int radius) -> Image + + Blurs the image in the vertical direction only. This should not be + used when using a single mask colour for transparency. + """ + return _core_.Image_BlurVertical(*args, **kwargs) + def ShrinkBy(*args, **kwargs): """ ShrinkBy(self, int xFactor, int yFactor) -> Image @@ -2330,7 +2382,7 @@ class Image(Object): def Rescale(*args, **kwargs): """ - Rescale(self, int width, int height) -> Image + Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image Changes the size of the image in-place by scaling it: after a call to this function, the image will have the given width and height. diff --git a/wxPython/src/msw/_core_wrap.cpp b/wxPython/src/msw/_core_wrap.cpp index 5f73987f0b..c897f90d12 100644 --- a/wxPython/src/msw/_core_wrap.cpp +++ b/wxPython/src/msw/_core_wrap.cpp @@ -4851,6 +4851,100 @@ fail: } +SWIGINTERN PyObject *_wrap_Size_IncBy(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxSize *arg1 = (wxSize *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "dx",(char *) "dy", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Size_IncBy",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSize, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Size_IncBy" "', expected argument " "1"" of type '" "wxSize *""'"); + } + arg1 = reinterpret_cast< wxSize * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Size_IncBy" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Size_IncBy" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->IncBy(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Size_DecBy(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxSize *arg1 = (wxSize *) 0 ; + int arg2 ; + int arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "dx",(char *) "dy", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Size_DecBy",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxSize, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Size_DecBy" "', expected argument " "1"" of type '" "wxSize *""'"); + } + arg1 = reinterpret_cast< wxSize * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Size_DecBy" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Size_DecBy" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->DecBy(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Size_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxSize *arg1 = (wxSize *) 0 ; @@ -13763,6 +13857,7 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject wxImage *arg1 = (wxImage *) 0 ; int arg2 ; int arg3 ; + int arg4 = (int) wxIMAGE_QUALITY_NORMAL ; SwigValueWrapper result; void *argp1 = 0 ; int res1 = 0 ; @@ -13770,14 +13865,17 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "width",(char *) "height", NULL + (char *) "self",(char *) "width",(char *) "height",(char *) "quality", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_Scale",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_Scale",kwnames,&obj0,&obj1,&obj2,&obj3)) 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_Scale" "', expected argument " "1"" of type '" "wxImage *""'"); @@ -13793,9 +13891,229 @@ SWIGINTERN PyObject *_wrap_Image_Scale(PyObject *SWIGUNUSEDPARM(self), PyObject SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_Scale" "', expected argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); + if (obj3) { + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Image_Scale" "', expected argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (arg1)->Scale(arg2,arg3); + result = (arg1)->Scale(arg2,arg3,arg4); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_ResampleBox(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + int arg3 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "width",(char *) "height", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_ResampleBox",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_ResampleBox" "', expected argument " "1"" of type '" "wxImage const *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_ResampleBox" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_ResampleBox" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxImage const *)arg1)->ResampleBox(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_ResampleBicubic(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + int arg3 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "width",(char *) "height", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_ResampleBicubic",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_ResampleBicubic" "', expected argument " "1"" of type '" "wxImage const *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_ResampleBicubic" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_ResampleBicubic" "', expected argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = ((wxImage const *)arg1)->ResampleBicubic(arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_Blur(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_Blur",kwnames,&obj0,&obj1)) 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_Blur" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_Blur" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->Blur(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_BlurHorizontal(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_BlurHorizontal",kwnames,&obj0,&obj1)) 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_BlurHorizontal" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_BlurHorizontal" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->BlurHorizontal(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((new wxImage(static_cast< const wxImage& >(result))), SWIGTYPE_p_wxImage, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Image_BlurVertical(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxImage *arg1 = (wxImage *) 0 ; + int arg2 ; + SwigValueWrapper result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "radius", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Image_BlurVertical",kwnames,&obj0,&obj1)) 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_BlurVertical" "', expected argument " "1"" of type '" "wxImage *""'"); + } + arg1 = reinterpret_cast< wxImage * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Image_BlurVertical" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->BlurVertical(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } @@ -13859,6 +14177,7 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec wxImage *arg1 = (wxImage *) 0 ; int arg2 ; int arg3 ; + int arg4 = (int) wxIMAGE_QUALITY_NORMAL ; wxImage *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; @@ -13866,14 +14185,17 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char * kwnames[] = { - (char *) "self",(char *) "width",(char *) "height", NULL + (char *) "self",(char *) "width",(char *) "height",(char *) "quality", NULL }; - if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Image_Rescale",kwnames,&obj0,&obj1,&obj2)) SWIG_fail; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_Rescale",kwnames,&obj0,&obj1,&obj2,&obj3)) 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_Rescale" "', expected argument " "1"" of type '" "wxImage *""'"); @@ -13889,10 +14211,17 @@ SWIGINTERN PyObject *_wrap_Image_Rescale(PyObject *SWIGUNUSEDPARM(self), PyObjec SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Image_Rescale" "', expected argument " "3"" of type '" "int""'"); } arg3 = static_cast< int >(val3); + if (obj3) { + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Image_Rescale" "', expected argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); { - wxImage &_result_ref = (arg1)->Rescale(arg2,arg3); + wxImage &_result_ref = (arg1)->Rescale(arg2,arg3,arg4); result = (wxImage *) &_result_ref; } wxPyEndAllowThreads(__tstate); @@ -53891,6 +54220,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Size___sub__", (PyCFunction) _wrap_Size___sub__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_IncTo", (PyCFunction) _wrap_Size_IncTo, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_DecTo", (PyCFunction) _wrap_Size_DecTo, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Size_IncBy", (PyCFunction) _wrap_Size_IncBy, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Size_DecBy", (PyCFunction) _wrap_Size_DecBy, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_Scale", (PyCFunction) _wrap_Size_Scale, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_Set", (PyCFunction) _wrap_Size_Set, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Size_SetWidth", (PyCFunction) _wrap_Size_SetWidth, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -54160,6 +54491,11 @@ static PyMethodDef SwigMethods[] = { { (char *)"Image_Create", (PyCFunction) _wrap_Image_Create, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Destroy", (PyCFunction)_wrap_Image_Destroy, METH_O, NULL}, { (char *)"Image_Scale", (PyCFunction) _wrap_Image_Scale, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_ResampleBox", (PyCFunction) _wrap_Image_ResampleBox, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_ResampleBicubic", (PyCFunction) _wrap_Image_ResampleBicubic, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_Blur", (PyCFunction) _wrap_Image_Blur, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_BlurHorizontal", (PyCFunction) _wrap_Image_BlurHorizontal, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"Image_BlurVertical", (PyCFunction) _wrap_Image_BlurVertical, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_ShrinkBy", (PyCFunction) _wrap_Image_ShrinkBy, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Rescale", (PyCFunction) _wrap_Image_Rescale, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Image_Resize", (PyCFunction) _wrap_Image_Resize, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -57606,6 +57942,8 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "IMAGE_ALPHA_TRANSPARENT",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_TRANSPARENT))); SWIG_Python_SetConstant(d, "IMAGE_ALPHA_THRESHOLD",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_THRESHOLD))); SWIG_Python_SetConstant(d, "IMAGE_ALPHA_OPAQUE",SWIG_From_int(static_cast< int >(wxIMAGE_ALPHA_OPAQUE))); + SWIG_Python_SetConstant(d, "IMAGE_QUALITY_NORMAL",SWIG_From_int(static_cast< int >(wxIMAGE_QUALITY_NORMAL))); + SWIG_Python_SetConstant(d, "IMAGE_QUALITY_HIGH",SWIG_From_int(static_cast< int >(wxIMAGE_QUALITY_HIGH))); SWIG_addvarlink(SWIG_globals(),(char*)"NullImage",NullImage_get, NullImage_set); SWIG_addvarlink(SWIG_globals(),(char*)"IMAGE_OPTION_FILENAME",IMAGE_OPTION_FILENAME_get, IMAGE_OPTION_FILENAME_set); SWIG_addvarlink(SWIG_globals(),(char*)"IMAGE_OPTION_BMP_FORMAT",IMAGE_OPTION_BMP_FORMAT_get, IMAGE_OPTION_BMP_FORMAT_set); diff --git a/wxPython/src/msw/_gdi.py b/wxPython/src/msw/_gdi.py index fb88b49deb..87a691b65a 100644 --- a/wxPython/src/msw/_gdi.py +++ b/wxPython/src/msw/_gdi.py @@ -1420,6 +1420,10 @@ class Region(GDIObject): """IsEmpty(self) -> bool""" return _gdi_.Region_IsEmpty(*args, **kwargs) + def IsEqual(*args, **kwargs): + """IsEqual(self, Region region) -> bool""" + return _gdi_.Region_IsEqual(*args, **kwargs) + def Union(*args, **kwargs): """Union(self, int x, int y, int width, int height) -> bool""" return _gdi_.Region_Union(*args, **kwargs) diff --git a/wxPython/src/msw/_gdi_wrap.cpp b/wxPython/src/msw/_gdi_wrap.cpp index 9bfb56981e..3c5ff32cec 100644 --- a/wxPython/src/msw/_gdi_wrap.cpp +++ b/wxPython/src/msw/_gdi_wrap.cpp @@ -11124,6 +11124,50 @@ fail: } +SWIGINTERN PyObject *_wrap_Region_IsEqual(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxRegion *arg1 = (wxRegion *) 0 ; + wxRegion *arg2 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "region", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Region_IsEqual",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxRegion, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Region_IsEqual" "', expected argument " "1"" of type '" "wxRegion const *""'"); + } + arg1 = reinterpret_cast< wxRegion * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_wxRegion, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Region_IsEqual" "', expected argument " "2"" of type '" "wxRegion const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Region_IsEqual" "', expected argument " "2"" of type '" "wxRegion const &""'"); + } + arg2 = reinterpret_cast< wxRegion * >(argp2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxRegion const *)arg1)->IsEqual((wxRegion const &)*arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Region_Union(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxRegion *arg1 = (wxRegion *) 0 ; @@ -32311,6 +32355,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Region_IntersectRect", (PyCFunction) _wrap_Region_IntersectRect, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_IntersectRegion", (PyCFunction) _wrap_Region_IntersectRegion, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_IsEmpty", (PyCFunction)_wrap_Region_IsEmpty, METH_O, NULL}, + { (char *)"Region_IsEqual", (PyCFunction) _wrap_Region_IsEqual, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_Union", (PyCFunction) _wrap_Region_Union, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_UnionRect", (PyCFunction) _wrap_Region_UnionRect, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Region_UnionRegion", (PyCFunction) _wrap_Region_UnionRegion, METH_VARARGS | METH_KEYWORDS, NULL}, -- 2.45.2