X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/84a81942dd0a64d7dbbf6f1ad7127c2de16c1363..abb69c6c82d61cf18f14270650a68896a3d8ed47:/wxPython/src/gtk/gdi.cpp diff --git a/wxPython/src/gtk/gdi.cpp b/wxPython/src/gtk/gdi.cpp index d467aae2e0..67dcd634ac 100644 --- a/wxPython/src/gtk/gdi.cpp +++ b/wxPython/src/gtk/gdi.cpp @@ -120,6 +120,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return cArray; } + wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings) { char** cArray = NULL; wxBitmap* bmp; @@ -138,18 +139,21 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } + wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 ) { + return new wxBitmap(bits, width, height, depth); + } -#ifdef __WXMSW__ - wxBitmap* wxBitmapFromData(PyObject* data, long type, - int width, int height, int depth = 1) { - if (! PyString_Check(data)) { - PyErr_SetString(PyExc_TypeError, "Expected string object"); - return NULL; - } - return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth); - } -#endif +// #ifdef __WXMSW__ +// wxBitmap* wxBitmapFromData(PyObject* data, long type, +// int width, int height, int depth = 1) { +// if (! PyString_Check(data)) { +// PyErr_SetString(PyExc_TypeError, "Expected string object"); +// return NULL; +// } +// return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth); +// } +// #endif wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour) { return new wxMask(bitmap, colour); @@ -335,6 +339,35 @@ static PyObject *_wrap_wxBitmapFromIcon(PyObject *self, PyObject *args, PyObject return _resultobj; } +static PyObject *_wrap_wxBitmapFromBits(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmap * _result; + char * _arg0; + int _arg1; + int _arg2; + int _arg3 = (int ) 1; + char *_kwnames[] = { "bits","width","height","depth", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"sii|i:wxBitmapFromBits",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxBitmap *)wxBitmapFromBits(_arg0,_arg1,_arg2,_arg3); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + static PyObject *_wrap_wxMaskColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMask * _result; @@ -10124,6 +10157,7 @@ static PyMethodDef gdicMethods[] = { { "wxIconFromXPMData", (PyCFunction) _wrap_wxIconFromXPMData, METH_VARARGS | METH_KEYWORDS }, { "wxEmptyIcon", (PyCFunction) _wrap_wxEmptyIcon, METH_VARARGS | METH_KEYWORDS }, { "wxMaskColour", (PyCFunction) _wrap_wxMaskColour, METH_VARARGS | METH_KEYWORDS }, + { "wxBitmapFromBits", (PyCFunction) _wrap_wxBitmapFromBits, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapFromIcon", (PyCFunction) _wrap_wxBitmapFromIcon, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapFromXPMData", (PyCFunction) _wrap_wxBitmapFromXPMData, METH_VARARGS | METH_KEYWORDS }, { "wxEmptyBitmap", (PyCFunction) _wrap_wxEmptyBitmap, METH_VARARGS | METH_KEYWORDS },