class wxFSFile : public wxObject
{
public:
- %pythonAppend wxFSFile
- "self.thisown = 0 # It will normally be deleted by the user of the wxFileSystem";
-
+ %typemap(out) wxFSFile*; // turn off this typemap
+
wxFSFile(wxInputStream *stream, const wxString& loc,
const wxString& mimetype, const wxString& anchor,
wxDateTime modif);
-
- ~wxFSFile();
+
+ // Turn it back on.
+ %typemap(out) wxFSFile* { $result = wxPyMake_wxObject($1, $owner); }
+
+ ~wxFSFile();
wxInputStream *GetStream();
const wxString& GetMimeType();
-%name(CPPFileSystemHandler) class wxFileSystemHandler //: public wxObject
+%rename(CPPFileSystemHandler) wxFileSystemHandler;
+class wxFileSystemHandler //: public wxObject
{
public:
//wxFileSystemHandler();
+ ~wxFileSystemHandler();
};
-%name(FileSystemHandler) class wxPyFileSystemHandler : public wxFileSystemHandler
+%rename(FileSystemHandler) wxPyFileSystemHandler;
+class wxPyFileSystemHandler : public wxFileSystemHandler
{
public:
%pythonAppend wxPyFileSystemHandler "self._setCallbackInfo(self, FileSystemHandler)";
-
+
wxPyFileSystemHandler();
void _setCallbackInfo(PyObject* self, PyObject* _class);
wxFileSystem();
~wxFileSystem();
- void ChangePathTo(const wxString& location, bool is_dir = False);
+ void ChangePathTo(const wxString& location, bool is_dir = false);
wxString GetPath();
%newobject OpenFile;
wxString FindFirst(const wxString& spec, int flags = 0);
wxString FindNext();
+ %disownarg(wxFileSystemHandler *handler);
static void AddHandler(wxFileSystemHandler *handler);
+ %cleardisown(wxFileSystemHandler *handler);
+
static void CleanUpHandlers();
// Returns the file URL for a native path
wxFileName fname = wxFileSystem::URLToFileName(url);
return fname.GetFullPath();
}
- }
+ }
};
return;
}
- bool blocked = wxPyBeginBlockThreads();
+ wxPyBlock_t blocked = wxPyBeginBlockThreads();
void* ptr = (void*)PyString_AsString(data);
size_t size = PyString_Size(data);
wxPyEndBlockThreads(blocked);
// Add a file to the memory FS
%pythoncode { AddFile = staticmethod(MemoryFSHandler_AddFile) }
-
+
bool CanOpen(const wxString& location);
%newobject OpenFile;
wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);