]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/misc2.i
*** empty log message ***
[wxWidgets.git] / wxPython / src / misc2.i
index 7a7f49ad580a2009c3b129c873658f5740613113..8e80dd6a2a58ae704279a3e4952ba96148322589 100644 (file)
@@ -21,6 +21,7 @@
 #include <wx/caret.h>
 #include <wx/fontenum.h>
 #include <wx/tipdlg.h>
+#include <wx/process.h>
 %}
 
 //----------------------------------------------------------------------
@@ -34,6 +35,7 @@
 %import misc.i
 %import gdi.i
 %import events.i
+%import streams.i
 
 //---------------------------------------------------------------------------
 // Dialog Functions
@@ -353,9 +355,19 @@ public:
 
 //----------------------------------------------------------------------
 
+class wxWindowDisabler {
+public:
+    wxWindowDisabler(wxWindow *winToSkip = NULL);
+    ~wxWindowDisabler();
+};
+
+//----------------------------------------------------------------------
+
 void wxPostEvent(wxEvtHandler *dest, wxEvent& event);
 void wxWakeUpIdle();
 
+bool wxSafeYield(wxWindow* win=NULL);
+
 //----------------------------------------------------------------------
 
 
@@ -597,6 +609,64 @@ void wxLogStatus(const char *szFormat);
 void wxLogSysError(const char *szFormat);
 
 
+
+//----------------------------------------------------------------------
+
+class wxProcessEvent : public wxEvent {
+public:
+    wxProcessEvent(int id = 0, int pid = 0, int exitcode = 0);
+    int GetPid();
+    int GetExitCode();
+    int m_pid, m_exitcode;
+};
+
+
+
+
+%{ // C++ version of wxProcess derived class
+
+class wxPyProcess : public wxProcess {
+public:
+    wxPyProcess(wxEvtHandler *parent = NULL, int id = -1)
+        : wxProcess(parent, id)
+        {}
+
+    DEC_PYCALLBACK_VOID_INTINT(OnTerminate);
+
+    PYPRIVATE;
+};
+
+IMP_PYCALLBACK_VOID_INTINT( wxPyProcess, wxProcess, OnTerminate);
+%}
+
+
+%name(wxProcess)class wxPyProcess : public wxEvtHandler {
+public:
+    wxPyProcess(wxEvtHandler *parent = NULL, int id = -1);
+    %addmethods { void Destroy() { delete self; } }
+
+    void _setSelf(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setSelf(self, wxProcess)"
+
+    void base_OnTerminate(int pid, int status);
+
+    void Redirect();
+    bool IsRedirected();
+    void Detach();
+
+    wxInputStream *GetInputStream();
+    wxInputStream *GetErrorStream();
+    wxOutputStream *GetOutputStream();
+
+    void CloseOutput();
+};
+
+
+
+long wxExecute(const wxString& command,
+               int sync = FALSE,
+               wxPyProcess *process = NULL);
+
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------