X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5a446332930f51af5c85fb9b73e26f87fc65cd2c..7a27cf7c183dd1a089af96832d66b2467e274556:/wxPython/src/mac/_gdi_wrap.cpp diff --git a/wxPython/src/mac/_gdi_wrap.cpp b/wxPython/src/mac/_gdi_wrap.cpp index 6dd1ebb91b..6865ca595f 100644 --- a/wxPython/src/mac/_gdi_wrap.cpp +++ b/wxPython/src/mac/_gdi_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } @@ -3663,6 +3664,39 @@ static PyObject *_wrap_new_Brush(PyObject *, PyObject *args, PyObject *kwargs) { } +static PyObject *_wrap_new_BrushFromBitmap(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxBitmap *arg1 = 0 ; + wxBrush *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "stippleBitmap", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_BrushFromBitmap",kwnames,&obj0)) goto fail; + { + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxBitmap, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + if (arg1 == NULL) { + SWIG_null_ref("wxBitmap"); + } + if (SWIG_arg_fail(1)) SWIG_fail; + } + { + if (!wxPyCheckForApp()) SWIG_fail; + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (wxBrush *)new wxBrush((wxBitmap const &)*arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxBrush, 1); + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_delete_Brush(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxBrush *arg1 = (wxBrush *) 0 ; @@ -19608,7 +19642,7 @@ static PyObject *_wrap_BrushList_FindOrCreateBrush(PyObject *, PyObject *args, P PyObject *resultobj; wxBrushList *arg1 = (wxBrushList *) 0 ; wxColour *arg2 = 0 ; - int arg3 ; + int arg3 = (int) wxSOLID ; wxBrush *result; wxColour temp2 ; PyObject * obj0 = 0 ; @@ -19618,16 +19652,18 @@ static PyObject *_wrap_BrushList_FindOrCreateBrush(PyObject *, PyObject *args, P (char *) "self",(char *) "colour",(char *) "style", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:BrushList_FindOrCreateBrush",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:BrushList_FindOrCreateBrush",kwnames,&obj0,&obj1,&obj2)) goto fail; SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxBrushList, SWIG_POINTER_EXCEPTION | 0); if (SWIG_arg_fail(1)) SWIG_fail; { arg2 = &temp2; if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail; } - { - arg3 = (int)(SWIG_As_int(obj2)); - if (SWIG_arg_fail(3)) SWIG_fail; + if (obj2) { + { + arg3 = (int)(SWIG_As_int(obj2)); + if (SWIG_arg_fail(3)) SWIG_fail; + } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -20743,6 +20779,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Pen___ne__", (PyCFunction) _wrap_Pen___ne__, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Pen_swigregister", Pen_swigregister, METH_VARARGS, NULL}, { (char *)"new_Brush", (PyCFunction) _wrap_new_Brush, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"new_BrushFromBitmap", (PyCFunction) _wrap_new_BrushFromBitmap, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"delete_Brush", (PyCFunction) _wrap_delete_Brush, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Brush_SetColour", (PyCFunction) _wrap_Brush_SetColour, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Brush_SetStyle", (PyCFunction) _wrap_Brush_SetStyle, METH_VARARGS | METH_KEYWORDS, NULL},