X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f74ff5efa5604fcde3cc5ba9009cb015a6f388cf..b9ac87bc5cbe46227195e32c44e25831f8206e3c:/wxPython/src/filesys.i?ds=sidebyside diff --git a/wxPython/src/filesys.i b/wxPython/src/filesys.i index 9380577a21..69d782e325 100644 --- a/wxPython/src/filesys.i +++ b/wxPython/src/filesys.i @@ -14,6 +14,7 @@ %{ #include "helpers.h" +#include "pyistream.h" #include #include #include @@ -32,7 +33,6 @@ %import streams.i %pragma(python) code = "import wx" -%pragma(python) code = "import string" //--------------------------------------------------------------------------- @@ -86,7 +86,7 @@ public: return wxFileSystemHandler::GetRightLocation(location); } - wxString GetMimeTypeFromExt(const wxString& location){ + wxString GetMimeTypeFromExt(const wxString& location) { return wxFileSystemHandler::GetMimeTypeFromExt(location); } @@ -140,6 +140,12 @@ public: static void AddHandler(wxFileSystemHandler *handler); static void CleanUpHandlers(); + +// // Returns the native path for a file URL +// static wxFileName URLToFileName(const wxString& url); + +// // Returns the file URL for a native path +// static wxString FileNameToURL(const wxFileName& filename); }; //--------------------------------------------------------------------------- @@ -193,15 +199,11 @@ void __wxMemoryFSHandler_AddFile_wxBitmap(const wxString& filename, wxMemoryFSHandler::AddFile(filename, bitmap, type); } -// void __wxMemoryFSHandler_AddFile_wxString(const wxString& filename, -// const wxString& textdata) { -// wxMemoryFSHandler::AddFile(filename, textdata); -// } - void __wxMemoryFSHandler_AddFile_Data(const wxString& filename, PyObject* data) { wxMemoryFSHandler::AddFile(filename, + // TODO: Verify data type (void*)PyString_AsString(data), (size_t)PyString_Size(data)); } @@ -212,9 +214,9 @@ void __wxMemoryFSHandler_AddFile_Data(const wxString& filename, %pragma(python) code = " import types def wxMemoryFSHandler_AddFile(filename, a, b=''): - if isinstance(a, wxImage): + if wx.wxPy_isinstance(a, (wxImage, wxImagePtr)): __wxMemoryFSHandler_AddFile_wxImage(filename, a, b) - elif isinstance(a, wxBitmap): + elif wx.wxPy_isinstance(a, (wxBitmap, wxBitmapPtr)): __wxMemoryFSHandler_AddFile_wxBitmap(filename, a, b) elif type(a) == types.StringType: #__wxMemoryFSHandler_AddFile_wxString(filename, a)