]>
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 void wxProcess::Init(wxEvtHandler
*parent
, int id
, bool redirect
)
35 SetNextHandler(parent
);
38 m_redirect
= redirect
;
40 m_outputStream
= NULL
;
43 wxProcess::~wxProcess()
46 delete m_outputStream
;
49 void wxProcess::OnTerminate(int pid
, int status
)
51 wxProcessEvent
event(m_id
, pid
, status
);
53 if ( !ProcessEvent(event
) )
55 //else: the object which processed the event is responsible for deleting
59 void wxProcess::Detach()
64 void wxProcess::SetPipeStreams(wxInputStream
*in_stream
, wxOutputStream
*out_stream
)
66 m_inputStream
= in_stream
;
67 m_outputStream
= out_stream
;