]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/my_typemaps.i
Allow compiling when _WIN32_IE < 0x300
[wxWidgets.git] / wxPython / src / my_typemaps.i
index 1c712edc4f308bbe2e13db9655151ded15b069cd..91fb0ada9600bb03569f0012d065e3b5cdc63fbe 100644 (file)
@@ -188,6 +188,32 @@ $function
 
 
 
+//---------------------------------------------------------------------------
+
+
+%typemap(python, in) wxMemoryBuffer& {
+    if (!PyString_Check($source)) {
+        PyErr_SetString(PyExc_TypeError, "String buffer expected");
+        return NULL;
+    }
+    char* str = PyString_AS_STRING($source);
+    int   len = PyString_GET_SIZE($source);
+    $target = new wxMemoryBuffer(len);
+    memcpy($target->GetData(), str, len);
+}
+
+%typemap(python, freearg) wxMemoryBuffer& {
+    if ($target)
+        delete $source;
+}
+
+%typemap(python, out) wxMemoryBuffer {
+    $target = PyString_FromStringAndSize((char*)$source->GetData(), $source->GetDataLen());
+}
+
+%typemap(python, ret) wxMemoryBuffer {
+    delete $source;
+}
 
 
 //---------------------------------------------------------------------------
@@ -357,10 +383,12 @@ $function
 %typemap(python, out) wxToolTip*                { $target = wxPyMake_wxObject($source); }
 
 
+%typemap(python, out) wxBitmapButton*           { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxButton*                 { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxControl*                { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxFrame*                  { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxGrid*                   { $target = wxPyMake_wxObject($source); }
+%typemap(python, out) wxListCtrl*               { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxMDIChildFrame*          { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxMDIClientWindow*        { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxMenuBar*                { $target = wxPyMake_wxObject($source); }
@@ -370,6 +398,7 @@ $function
 %typemap(python, out) wxTextCtrl*               { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxToolBar*                { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxToolBarBase*            { $target = wxPyMake_wxObject($source); }
+%typemap(python, out) wxTreeCtrl*               { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxWindow*                 { $target = wxPyMake_wxObject($source); }
 %typemap(python, out) wxHtmlWindow*             { $target = wxPyMake_wxObject($source); }