]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/misc2.i
Changed main ftp address to ftp://biolpc22.york.ac.uk/pub
[wxWidgets.git] / wxPython / src / misc2.i
index 70ccce4f4a7223035618b1353544399e95636261..5e080982f0def9c7df05324a640b78fd0b6553de 100644 (file)
@@ -468,6 +468,9 @@ IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
 class wxPyTipProvider : public wxTipProvider {
 public:
     wxPyTipProvider(size_t currentTip);
+
+    void _setCallbackInfo(PyObject* self, PyObject* _class);
+    %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyTipProvider)"
 };
 
 
@@ -763,12 +766,47 @@ public:
 //----------------------------------------------------------------------
 
 
+enum wxKillError
+{
+    wxKILL_OK,              // no error
+    wxKILL_BAD_SIGNAL,      // no such signal
+    wxKILL_ACCESS_DENIED,   // permission denied
+    wxKILL_NO_PROCESS,      // no such process
+    wxKILL_ERROR            // another, unspecified error
+};
+
+enum wxSignal
+{
+    wxSIGNONE = 0,  // verify if the process exists under Unix
+    wxSIGHUP,
+    wxSIGINT,
+    wxSIGQUIT,
+    wxSIGILL,
+    wxSIGTRAP,
+    wxSIGABRT,
+    wxSIGIOT = wxSIGABRT,   // another name
+    wxSIGEMT,
+    wxSIGFPE,
+    wxSIGKILL,
+    wxSIGBUS,
+    wxSIGSEGV,
+    wxSIGSYS,
+    wxSIGPIPE,
+    wxSIGALRM,
+    wxSIGTERM
+
+    // further signals are different in meaning between different Unix systems
+};
+
+
+
 enum {
     /* event type */
     wxEVT_END_PROCESS
 };
 
 
+
 class wxProcessEvent : public wxEvent {
 public:
     wxProcessEvent(int id = 0, int pid = 0, int exitcode = 0);
@@ -800,6 +838,23 @@ IMP_PYCALLBACK_VOID_INTINT( wxPyProcess, wxProcess, OnTerminate);
 
 %name(wxProcess)class wxPyProcess : public wxEvtHandler {
 public:
+    // kill the process with the given PID
+    static wxKillError Kill(int pid, wxSignal sig = wxSIGTERM);
+
+    // test if the given process exists
+    static bool Exists(int pid);
+
+    // this function replaces the standard popen() one: it launches a process
+    // asynchronously and allows the caller to get the streams connected to its
+    // std{in|out|err}
+    //
+    // on error NULL is returned, in any case the process object will be
+    // deleted automatically when the process terminates and should *not* be
+    // deleted by the caller
+    static wxPyProcess *Open(const wxString& cmd, int flags = wxEXEC_ASYNC);
+
+
+
     wxPyProcess(wxEvtHandler *parent = NULL, int id = -1);
     %addmethods { void Destroy() { delete self; } }
 
@@ -844,6 +899,25 @@ long wxExecute(const wxString& command,
 
 //----------------------------------------------------------------------
 
+
+// Which joystick? Same as Windows ids so no conversion necessary.
+enum
+{
+    wxJOYSTICK1,
+    wxJOYSTICK2
+};
+
+// Which button is down?
+enum
+{
+    wxJOY_BUTTON_ANY,
+    wxJOY_BUTTON1,
+    wxJOY_BUTTON2,
+    wxJOY_BUTTON3,
+    wxJOY_BUTTON4,
+};
+
+
 %{
 #if !wxUSE_JOYSTICK && !defined(__WXMSW__)
 // A C++ stub class for wxJoystick for platforms that don't have it.