+
+
+enum {
+ /* event type */
+ wxEVT_END_PROCESS
+};
+
+
+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);
+
+//----------------------------------------------------------------------
+
+%{
+#if !wxUSE_JOYSTICK && !defined(__WXMSW__)
+// A C++ stub class for wxJoystick for platforms that don't have it.
+class wxJoystick : public wxObject {
+public:
+ wxJoystick(int joystick = wxJOYSTICK1) {
+ bool doSave = wxPyRestoreThread();
+ PyErr_SetString(PyExc_NotImplementedError, "wxJoystick is not available on this platform.");
+ wxPySaveThread(doSave);
+ }
+ wxPoint GetPosition() { return wxPoint(-1,-1); }
+ int GetZPosition() { return -1; }
+ int GetButtonState() { return -1; }
+ int GetPOVPosition() { return -1; }
+ int GetPOVCTSPosition() { return -1; }
+ int GetRudderPosition() { return -1; }
+ int GetUPosition() { return -1; }
+ int GetVPosition() { return -1; }
+ int GetMovementThreshold() { return -1; }
+ void SetMovementThreshold(int threshold) {}
+
+ bool IsOk(void) { return FALSE; }
+ int GetNumberJoysticks() { return -1; }
+ int GetManufacturerId() { return -1; }
+ int GetProductId() { return -1; }
+ wxString GetProductName() { return ""; }
+ int GetXMin() { return -1; }
+ int GetYMin() { return -1; }
+ int GetZMin() { return -1; }
+ int GetXMax() { return -1; }
+ int GetYMax() { return -1; }
+ int GetZMax() { return -1; }
+ int GetNumberButtons() { return -1; }
+ int GetNumberAxes() { return -1; }
+ int GetMaxButtons() { return -1; }
+ int GetMaxAxes() { return -1; }
+ int GetPollingMin() { return -1; }
+ int GetPollingMax() { return -1; }
+ int GetRudderMin() { return -1; }
+ int GetRudderMax() { return -1; }
+ int GetUMin() { return -1; }
+ int GetUMax() { return -1; }
+ int GetVMin() { return -1; }
+ int GetVMax() { return -1; }
+
+ bool HasRudder() { return FALSE; }
+ bool HasZ() { return FALSE; }
+ bool HasU() { return FALSE; }
+ bool HasV() { return FALSE; }
+ bool HasPOV() { return FALSE; }
+ bool HasPOV4Dir() { return FALSE; }
+ bool HasPOVCTS() { return FALSE; }
+
+ bool SetCapture(wxWindow* win, int pollingFreq = 0) { return FALSE; }
+ bool ReleaseCapture() { return FALSE; }
+};
+#endif
+%}
+
+
+class wxJoystick : public wxObject {
+public:
+ wxJoystick(int joystick = wxJOYSTICK1);
+ ~wxJoystick();
+
+ wxPoint GetPosition();
+ int GetZPosition();
+ int GetButtonState();
+ int GetPOVPosition();
+ int GetPOVCTSPosition();
+ int GetRudderPosition();
+ int GetUPosition();
+ int GetVPosition();
+ int GetMovementThreshold();
+ void SetMovementThreshold(int threshold) ;
+
+ bool IsOk(void);
+ int GetNumberJoysticks();
+ int GetManufacturerId();
+ int GetProductId();
+ wxString GetProductName();
+ int GetXMin();
+ int GetYMin();
+ int GetZMin();
+ int GetXMax();
+ int GetYMax();
+ int GetZMax();
+ int GetNumberButtons();
+ int GetNumberAxes();
+ int GetMaxButtons();
+ int GetMaxAxes();
+ int GetPollingMin();
+ int GetPollingMax();
+ int GetRudderMin();
+ int GetRudderMax();
+ int GetUMin();
+ int GetUMax();
+ int GetVMin();
+ int GetVMax();
+
+ bool HasRudder();
+ bool HasZ();
+ bool HasU();
+ bool HasV();
+ bool HasPOV();
+ bool HasPOV4Dir();
+ bool HasPOVCTS();
+
+ bool SetCapture(wxWindow* win, int pollingFreq = 0);
+ bool ReleaseCapture();
+};
+
+//----------------------------------------------------------------------
+
+%{
+#if !wxUSE_WAVE
+// A C++ stub class for wxWave for platforms that don't have it.
+class wxWave : public wxObject
+{
+public:
+ wxWave(const wxString& fileName, bool isResource = FALSE) {
+ wxPyTState* state = wxPyBeginBlockThreads();
+ PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
+ wxPyEndBlockThreads(state);
+ }
+ wxWave(int size, const wxByte* data) {
+ wxPyTState* state = wxPyBeginBlockThreads();
+ PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
+ wxPyEndBlockThreads(state);
+ }
+
+ ~wxWave() {}
+
+ bool IsOk() const { return FALSE; }
+ bool Play(bool async = TRUE, bool looped = FALSE) const { return FALSE; }
+};
+
+#endif
+%}
+
+class wxWave : public wxObject
+{
+public:
+ wxWave(const wxString& fileName, bool isResource = FALSE);
+ ~wxWave();
+
+ bool IsOk() const;
+ bool Play(bool async = TRUE, bool looped = FALSE) const;
+};
+
+%new wxWave* wxWaveData(const wxString& data);
+%{ // Implementations of some alternate "constructors"
+ wxWave* wxWaveData(const wxString& data) {
+ return new wxWave(data.Len(), (wxByte*)data.c_str());
+ }
+%}
+
+
+//----------------------------------------------------------------------
+//----------------------------------------------------------------------
+
+
+%init %{
+ wxPyPtrTypeMap_Add("wxFontEnumerator", "wxPyFontEnumerator");
+ wxPyPtrTypeMap_Add("wxDragImage", "wxGenericDragImage");
+ wxPyPtrTypeMap_Add("wxProcess", "wxPyProcess");
+%}
+