X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/424752bc36fdcca4fbe9f00b45895b86e34300a1..6517912d808bcf0752879c98c339cf628d14a4fb:/wxPython/src/my_typemaps.i diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 788da5f7b7..70cca8ce18 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -191,15 +191,6 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) $1 = wxColour_typecheck($input); } -%typemap(in) wxColour* (wxColour temp) { - $1 = &temp; - if ( ! wxColour_helper($input, &$1)) SWIG_fail; -} -%typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) wxColour* { - $1 = wxColour_typecheck($input); -} - - //--------------------------------------------------------------------------- // Typemap for wxArrayString from Python sequence objects @@ -324,6 +315,26 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) } +//--------------------------------------------------------------------------- +// Typemaps for loading a image or bitmap from an object that implements the +// buffer interface + +%typemap(in) (buffer data, int DATASIZE) (Py_ssize_t temp) +{ + if (PyObject_AsReadBuffer($input, (const void**)(&$1), &temp) == -1) SWIG_fail; + $2 = (int)temp; +} + +%typemap(in) (buffer alpha, int ALPHASIZE) (Py_ssize_t temp) +{ + if ($input != Py_None) { + if (PyObject_AsReadBuffer($input, (const void**)(&$1), &temp) == -1) SWIG_fail; + $2 = (int)temp; + } +} + + + //--------------------------------------------------------------------------- // Typemaps to convert return values that are base class pointers // to the real derived type, if possible. See wxPyMake_wxObject in