X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da00a8bb164dd1f58dd0bb211475538a375867b4..31ad423e4fb556ec225a63b161154d3bf3445c1b:/include/wx/process.h diff --git a/include/wx/process.h b/include/wx/process.h index 67ac9c258f..2089c497ac 100644 --- a/include/wx/process.h +++ b/include/wx/process.h @@ -6,13 +6,13 @@ // Created: 24/06/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Guilhem Lavaux -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROCESSH__ #define _WX_PROCESSH__ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "process.h" #endif @@ -39,7 +39,7 @@ enum // function will be called when the process terminates. // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxProcess : public wxEvtHandler +class WXDLLIMPEXP_BASE wxProcess : public wxEvtHandler { public: // kill the process with the given PID @@ -55,7 +55,7 @@ public: // 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 wxProcess *Open(const wxString& cmd); + static wxProcess *Open(const wxString& cmd, int flags = wxEXEC_ASYNC); // ctors @@ -88,6 +88,13 @@ public: // close the output stream indicating that nothing more will be written void CloseOutput() { delete m_outputStream; m_outputStream = NULL; } + // return TRUE if the child process stdout is not closed + bool IsInputOpened() const; + + // return TRUE if any input is available on the child process stdout/err + bool IsInputAvailable() const; + bool IsErrorAvailable() const; + // implementation only (for wxExecute) // // NB: the streams passed here should correspond to the child process @@ -121,6 +128,7 @@ protected: bool m_redirect; DECLARE_DYNAMIC_CLASS(wxProcess) + DECLARE_NO_COPY_CLASS(wxProcess) }; // ---------------------------------------------------------------------------- @@ -128,10 +136,10 @@ protected: // ---------------------------------------------------------------------------- BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_END_PROCESS, 440) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_END_PROCESS, 440) END_DECLARE_EVENT_TYPES() -class WXDLLEXPORT wxProcessEvent : public wxEvent +class WXDLLIMPEXP_BASE wxProcessEvent : public wxEvent { public: wxProcessEvent(int id = 0, int pid = 0, int exitcode = 0) : wxEvent(id) @@ -155,7 +163,7 @@ public: int m_pid, m_exitcode; - DECLARE_DYNAMIC_CLASS(wxProcessEvent) + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxProcessEvent) }; typedef void (wxEvtHandler::*wxProcessEventFunction)(wxProcessEvent&); @@ -163,9 +171,7 @@ typedef void (wxEvtHandler::*wxProcessEventFunction)(wxProcessEvent&); #define EVT_END_PROCESS(id, func) \ DECLARE_EVENT_TABLE_ENTRY( \ wxEVT_END_PROCESS, id, -1, \ - (wxObjectEventFunction) \ - (wxEventFunction) \ - (wxProcessEventFunction) & func, NULL), + (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxProcessEventFunction, & func ), NULL), #endif // _WX_PROCESSH__