]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/streams.i
added carbonaccessors.o
[wxWidgets.git] / wxPython / src / streams.i
index 84020cb3930c8fd28c0915f84671a3eb4b8c8e7d..57daa5183387a6d84440587b608164cd4d6c1fd7 100644 (file)
     if ($source) {
         _ptr = new wxPyInputStream($source);
     }
-    if (_ptr) {
-        char    swigptr[64];
-        SWIG_MakePtr(swigptr, _ptr, "_wxPyInputStream_p");
-
-        PyObject* classobj = PyDict_GetItemString(wxPython_dict, "wxInputStreamPtr");
-        if (! classobj) {
-            Py_INCREF(Py_None);
-            $target = Py_None;
-        } else {
-            PyObject* arg = Py_BuildValue("(s)", swigptr);
-            $target = PyInstance_New(classobj, arg, NULL);
-            Py_DECREF(arg);
-
-            // set ThisOwn
-            PyObject* one = PyInt_FromLong(1);
-            PyObject_SetAttrString($target, "thisown", one);
-            Py_DECREF(one);
-        }
-    } else {
-        Py_INCREF(Py_None);
-        $target = Py_None;
-    }
+    $target = wxPyConstructObject(_ptr, "wxInputStream", TRUE);
 }
 
 //----------------------------------------------------------------------
@@ -505,3 +484,10 @@ public:
 }
 
 
+//----------------------------------------------------------------------
+
+%init %{
+    wxPyPtrTypeMap_Add("wxInputStream", "wxPyInputStream");
+%}
+
+//----------------------------------------------------------------------