]>
git.saurik.com Git - wxWidgets.git/blob - src/common/process.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Process termination classes
4 // Author: Guilhem Lavaux
5 // Modified by: Vadim Zeitlin to check error codes, added Detach() method
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "process.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
27 #include "wx/process.h"
29 IMPLEMENT_DYNAMIC_CLASS(wxProcess
, wxEvtHandler
)
30 IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent
, wxEvent
)
32 wxProcess::wxProcess(wxEvtHandler
*parent
, bool needPipe
, int id
)
35 SetNextHandler(parent
);
38 m_needPipe
= needPipe
;
43 wxProcess::~wxProcess()
51 void wxProcess::OnTerminate(int pid
, int status
)
53 wxProcessEvent
event(m_id
, pid
, status
);
55 if ( !ProcessEvent(event
) )
57 //else: the object which processed the event is responsible for deleting
61 void wxProcess::Detach()
66 void wxProcess::SetPipeStreams(wxInputStream
*in_stream
, wxOutputStream
*out_stream
)
68 m_in_stream
= in_stream
;
69 m_out_stream
= out_stream
;
72 wxInputStream
*wxProcess::GetInputStream() const
77 wxOutputStream
*wxProcess::GetOutputStream() const
82 bool wxProcess::NeedPipe() const