X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4268f79856cbe66b8ad31b86ee183879cede98e3..8262f9aecb42cefb62a6c574812a2db3dcc33661:/wxPython/src/my_typemaps.i diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index d6b99441ef..2a2b12e23b 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -282,7 +282,7 @@ for (i=0; iAdd(PyString_AsString(item)); + $target->Add(PyString_AsString(str)); Py_DECREF(item); Py_DECREF(str); } @@ -293,6 +293,31 @@ delete $source; } +//--------------------------------------------------------------------------- +// Typemap for wxArrayInt from Python sequence objects + +%typemap(python,in) wxArrayInt& { + if (! PySequence_Check($source)) { + PyErr_SetString(PyExc_TypeError, "Sequence of integers expected."); + return NULL; + } + $target = new wxArrayInt; + int i, len=PySequence_Length($source); + for (i=0; iAdd(PyInt_AS_LONG(number)); + Py_DECREF(item); + Py_DECREF(number); + } +} + +%typemap(python, freearg) wxArrayInt& { + if ($target) + delete $source; +} + + //--------------------------------------------------------------------------- // Map T_OUTPUTs for floats to return ints. @@ -312,6 +337,39 @@ $target = t_output_helper($target, o); } + +%typemap(python,ignore) bool *T_OUTPUT(int temp) +{ + $target = (bool*)&temp; +} + +%typemap(python,argout) bool *T_OUTPUT +{ + PyObject *o; + o = PyInt_FromLong((long) (*$source)); + $target = t_output_helper($target, o); +} + +%typemap(python,ignore) bool *OUTPUT = bool *T_OUTPUT; +%typemap(python,argout) bool *OUTPUT = bool *T_OUTPUT; + + + +%typemap(python,ignore) byte *T_OUTPUT(int temp) +{ + $target = (byte*)&temp; +} + +%typemap(python,argout) byte *T_OUTPUT +{ + PyObject *o; + o = PyInt_FromLong((long) (*$source)); + $target = t_output_helper($target, o); +} + +%typemap(python,ignore) byte *OUTPUT = byte *T_OUTPUT; +%typemap(python,argout) byte *OUTPUT = byte *T_OUTPUT; + //--------------------------------------------------------------------------- // Typemaps to convert return values that are base class pointers // to the real derived type, if possible. See wxPyMake_wxObject in @@ -349,6 +407,7 @@ %typemap(python, out) wxToolBar* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxToolBarBase* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxWindow* { $target = wxPyMake_wxObject($source); } +%typemap(python, out) wxHtmlWindow* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxSizer* { $target = wxPyMake_wxSizer($source); }