]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/my_typemaps.i
use the right number in the tarball filename
[wxWidgets.git] / wxPython / src / my_typemaps.i
index 70cca8ce18f6103439a27b8ef801488b04d64333..8a96849e485e54308b0495e16740dceed8ab40f3 100644 (file)
@@ -243,24 +243,42 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field)
 
 //---------------------------------------------------------------------------
 // Typemaps to convert an array of ints to a list for return values
+// %typemap(out) wxArrayInt& {
+//     $result = PyList_New(0);
+//     size_t idx;
+//     for (idx = 0; idx < $1->GetCount(); idx += 1) {
+//         PyObject* val = PyInt_FromLong( $1->Item(idx) );
+//         PyList_Append($result, val);
+//         Py_DECREF(val);
+//     }
+// }
+
+// %typemap(out) wxArrayInt {
+//     $result = PyList_New(0);
+//     size_t idx;
+//     for (idx = 0; idx < $1.GetCount(); idx += 1) {
+//         PyObject* val = PyInt_FromLong( $1.Item(idx) );
+//         PyList_Append($result, val);
+//         Py_DECREF(val);
+//     }
+// }
+
 %typemap(out) wxArrayInt& {
-    $result = PyList_New(0);
-    size_t idx;
-    for (idx = 0; idx < $1->GetCount(); idx += 1) {
-        PyObject* val = PyInt_FromLong( $1->Item(idx) );
-        PyList_Append($result, val);
-        Py_DECREF(val);
-    }
+    $result = wxArrayInt2PyList_helper(*$1);
 }
 
 %typemap(out) wxArrayInt {
-    $result = PyList_New(0);
-    size_t idx;
-    for (idx = 0; idx < $1.GetCount(); idx += 1) {
-        PyObject* val = PyInt_FromLong( $1.Item(idx) );
-        PyList_Append($result, val);
-        Py_DECREF(val);
-    }
+    $result = wxArrayInt2PyList_helper($1);
+}
+
+
+// convert array of doubles to a Python list
+%typemap(out) wxArrayDouble& {
+    $result = wxArrayDouble2PyList_helper(*$1);
+}
+
+%typemap(out) wxArrayDouble {
+    $result = wxArrayDouble2PyList_helper($1);
 }