X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/15817c7e824ca7c04df062ae6dab1598aa520d75..015fd9ef4833ec3d8b0043a1c7e448c8be4f734a:/wxPython/src/mac/_gdi_wrap.cpp?ds=inline diff --git a/wxPython/src/mac/_gdi_wrap.cpp b/wxPython/src/mac/_gdi_wrap.cpp index 9047f5ead4..0b0b6927df 100644 --- a/wxPython/src/mac/_gdi_wrap.cpp +++ b/wxPython/src/mac/_gdi_wrap.cpp @@ -535,8 +535,11 @@ PyObject *wxPen_GetDashes(wxPen *self){ int count = self->GetDashes(&dashes); bool blocked = wxPyBeginBlockThreads(); PyObject* retval = PyList_New(0); - for (int x=0; xUnion((wxBitmap const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Region_UnionBitmapColour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxRegion *arg1 = (wxRegion *) 0 ; + wxBitmap *arg2 = 0 ; + wxColour *arg3 = 0 ; int arg4 = (int) 0 ; bool result; wxColour temp3 ; @@ -5463,7 +5553,7 @@ static PyObject *_wrap_Region_UnionBitmap(PyObject *self, PyObject *args, PyObje (char *) "self",(char *) "bmp",(char *) "transColour",(char *) "tolerance", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:Region_UnionBitmap",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Region_UnionBitmapColour",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxRegion, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_wxBitmap, @@ -5473,11 +5563,9 @@ static PyObject *_wrap_Region_UnionBitmap(PyObject *self, PyObject *args, PyObje PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; } - if (obj2) { - { - arg3 = &temp3; - if ( ! wxColour_helper(obj2, &arg3)) SWIG_fail; - } + { + arg3 = &temp3; + if ( ! wxColour_helper(obj2, &arg3)) SWIG_fail; } if (obj3) { arg4 = (int) SWIG_AsInt(obj3); @@ -5524,11 +5612,12 @@ static PyObject *_wrap_new_RegionIterator(PyObject *self, PyObject *args, PyObje SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxRegionIterator *)new wxRegionIterator((wxRegion const &)*arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxRegionIterator, 1); return resultobj; @@ -7474,11 +7563,12 @@ static PyObject *_wrap_new_Font(PyObject *self, PyObject *args, PyObject *kwargs if (PyErr_Occurred()) SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxFont *)new wxFont(arg1,arg2,arg3,arg4,arg5,(wxString const &)*arg6,(wxFontEncoding )arg7); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFont, 1); { @@ -7538,11 +7628,12 @@ static PyObject *_wrap_new_FontFromNativeInfo(PyObject *self, PyObject *args, Py SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxFont *)new wxFont((wxNativeFontInfo const &)*arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFont, 1); return resultobj; @@ -7568,11 +7659,12 @@ static PyObject *_wrap_new_FontFromNativeInfoString(PyObject *self, PyObject *ar temp1 = True; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxFont *)new_wxFont((wxString const &)*arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFont, 1); { @@ -7629,11 +7721,12 @@ static PyObject *_wrap_new_Font2(PyObject *self, PyObject *args, PyObject *kwarg if (PyErr_Occurred()) SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxFont *)new_wxFont(arg1,(wxFontFamily )arg2,arg3,(wxString const &)*arg4,(wxFontEncoding )arg5); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFont, 1); { @@ -8545,11 +8638,12 @@ static PyObject *_wrap_Font_GetDefaultEncoding(PyObject *self, PyObject *args, P if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":Font_GetDefaultEncoding",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (int)wxFont::GetDefaultEncoding(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_FromInt((int)result); return resultobj; @@ -8570,11 +8664,12 @@ static PyObject *_wrap_Font_SetDefaultEncoding(PyObject *self, PyObject *args, P arg1 = (wxFontEncoding) SWIG_AsInt(obj0); if (PyErr_Occurred()) SWIG_fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); wxFont::SetDefaultEncoding((wxFontEncoding )arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } Py_INCREF(Py_None); resultobj = Py_None; return resultobj; @@ -8599,11 +8694,12 @@ static PyObject *_wrap_new_FontEnumerator(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_FontEnumerator",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxPyFontEnumerator *)new wxPyFontEnumerator(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPyFontEnumerator, 1); return resultobj; @@ -14918,11 +15014,12 @@ static PyObject *_wrap_new_MemoryDC(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_MemoryDC",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxMemoryDC *)new wxMemoryDC(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxMemoryDC, 1); return resultobj; @@ -14944,11 +15041,12 @@ static PyObject *_wrap_new_MemoryDCFromDC(PyObject *self, PyObject *args, PyObje if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxMemoryDC *)new wxMemoryDC(arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxMemoryDC, 1); return resultobj; @@ -15017,11 +15115,12 @@ static PyObject *_wrap_new_BufferedDC__SWIG_0(PyObject *self, PyObject *args) { SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxBufferedDC *)new wxBufferedDC(arg1,(wxBitmap const &)*arg2); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBufferedDC, 1); return resultobj; @@ -15047,11 +15146,12 @@ static PyObject *_wrap_new_BufferedDC__SWIG_1(PyObject *self, PyObject *args) { if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxBufferedDC *)new wxBufferedDC(arg1,(wxSize const &)*arg2); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBufferedDC, 1); return resultobj; @@ -15138,11 +15238,12 @@ static PyObject *_wrap_new_BufferedDCInternalBuffer(PyObject *self, PyObject *ar if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxBufferedDC *)new wxBufferedDC(arg1,(wxSize const &)*arg2); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBufferedDC, 1); return resultobj; @@ -15233,11 +15334,12 @@ static PyObject *_wrap_new_BufferedPaintDC(PyObject *self, PyObject *args, PyObj } } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxBufferedPaintDC *)new wxBufferedPaintDC(arg1,(wxBitmap const &)*arg2); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBufferedPaintDC, 1); return resultobj; @@ -15262,11 +15364,12 @@ static PyObject *_wrap_new_ScreenDC(PyObject *self, PyObject *args, PyObject *kw if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_ScreenDC",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxScreenDC *)new wxScreenDC(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxScreenDC, 1); return resultobj; @@ -15389,11 +15492,12 @@ static PyObject *_wrap_new_ClientDC(PyObject *self, PyObject *args, PyObject *kw if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxClientDC *)new wxClientDC(arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxClientDC, 1); return resultobj; @@ -15422,11 +15526,12 @@ static PyObject *_wrap_new_PaintDC(PyObject *self, PyObject *args, PyObject *kwa if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxPaintDC *)new wxPaintDC(arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPaintDC, 1); return resultobj; @@ -15455,11 +15560,12 @@ static PyObject *_wrap_new_WindowDC(PyObject *self, PyObject *args, PyObject *kw if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxWindowDC *)new wxWindowDC(arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxWindowDC, 1); return resultobj; @@ -15497,11 +15603,12 @@ static PyObject *_wrap_new_MirrorDC(PyObject *self, PyObject *args, PyObject *kw arg2 = (bool) SWIG_AsBool(obj1); if (PyErr_Occurred()) SWIG_fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxMirrorDC *)new wxMirrorDC(*arg1,arg2); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxMirrorDC, 1); return resultobj; @@ -15535,11 +15642,12 @@ static PyObject *_wrap_new_PostScriptDC(PyObject *self, PyObject *args, PyObject SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxPostScriptDC *)new wxPostScriptDC((wxPrintData const &)*arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPostScriptDC, 1); return resultobj; @@ -15685,11 +15793,12 @@ static PyObject *_wrap_new_MetaFile(PyObject *self, PyObject *args, PyObject *kw } } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxMetaFile *)new wxMetaFile((wxString const &)*arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxMetaFile, 1); { @@ -15931,11 +16040,12 @@ static PyObject *_wrap_new_MetaFileDC(PyObject *self, PyObject *args, PyObject * } } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxMetaFileDC *)new wxMetaFileDC((wxString const &)*arg1,arg2,arg3,(wxString const &)*arg4); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxMetaFileDC, 1); { @@ -16011,11 +16121,12 @@ static PyObject *_wrap_new_PrinterDC(PyObject *self, PyObject *args, PyObject *k SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxPrinterDC *)new wxPrinterDC((wxPrintData const &)*arg1); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPrinterDC, 1); return resultobj; @@ -16060,11 +16171,12 @@ static PyObject *_wrap_new_ImageList(PyObject *self, PyObject *args, PyObject *k if (PyErr_Occurred()) SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxImageList *)new wxImageList(arg1,arg2,arg3,arg4); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } { resultobj = wxPyMake_wxObject(result); @@ -17319,11 +17431,12 @@ static PyObject *_wrap_new_ColourDatabase(PyObject *self, PyObject *args, PyObje if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_ColourDatabase",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxColourDatabase *)new wxColourDatabase(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxColourDatabase, 1); return resultobj; @@ -18398,6 +18511,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Cursor_swigregister", Cursor_swigregister, METH_VARARGS }, { (char *)"new_Region", (PyCFunction) _wrap_new_Region, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_RegionFromBitmap", (PyCFunction) _wrap_new_RegionFromBitmap, METH_VARARGS | METH_KEYWORDS }, + { (char *)"new_RegionFromBitmapColour", (PyCFunction) _wrap_new_RegionFromBitmapColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_RegionFromPoints", (PyCFunction) _wrap_new_RegionFromPoints, METH_VARARGS | METH_KEYWORDS }, { (char *)"delete_Region", (PyCFunction) _wrap_delete_Region, METH_VARARGS | METH_KEYWORDS }, { (char *)"Region_Clear", (PyCFunction) _wrap_Region_Clear, METH_VARARGS | METH_KEYWORDS }, @@ -18421,6 +18535,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Region_XorRegion", (PyCFunction) _wrap_Region_XorRegion, METH_VARARGS | METH_KEYWORDS }, { (char *)"Region_ConvertToBitmap", (PyCFunction) _wrap_Region_ConvertToBitmap, METH_VARARGS | METH_KEYWORDS }, { (char *)"Region_UnionBitmap", (PyCFunction) _wrap_Region_UnionBitmap, METH_VARARGS | METH_KEYWORDS }, + { (char *)"Region_UnionBitmapColour", (PyCFunction) _wrap_Region_UnionBitmapColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"Region_swigregister", Region_swigregister, METH_VARARGS }, { (char *)"new_RegionIterator", (PyCFunction) _wrap_new_RegionIterator, METH_VARARGS | METH_KEYWORDS }, { (char *)"delete_RegionIterator", (PyCFunction) _wrap_delete_RegionIterator, METH_VARARGS | METH_KEYWORDS },