virtual wxFDIOManager *GetFDIOManager();
#endif // wxUSE_SOCKETS
+#if wxUSE_CONSOLE_EVENTLOOP
// Return a non-NULL pointer to the object responsible for managing the
// event loop sources in this kind of application.
virtual wxEventLoopSourcesManagerBase* GetEventLoopSourcesManager();
+#endif // wxUSE_CONSOLE_EVENTLOOP
protected:
// Wait for the process termination by running the given event loop until
wxEventLoopSourceHandler *handler,
int flags)
{
+#if wxUSE_CONSOLE_EVENTLOOP
// Delegate to the event loop sources manager defined by it.
wxEventLoopSourcesManagerBase* const
manager = wxApp::GetValidTraits().GetEventLoopSourcesManager();
wxCHECK_MSG( manager, NULL, wxS("Must have wxEventLoopSourcesManager") );
return manager->AddSourceForFD(fd, handler, flags);
+#else // !wxUSE_CONSOLE_EVENTLOOP
+ return NULL;
+#endif // wxUSE_CONSOLE_EVENTLOOP/!wxUSE_CONSOLE_EVENTLOOP
}
#endif // wxUSE_EVENTLOOP_SOURCE
#include "wx/private/selectdispatcher.h"
#include "wx/private/fdiodispatcher.h"
#include "wx/unix/execute.h"
+#include "wx/unix/pipe.h"
#include "wx/unix/private.h"
#include "wx/evtloop.h"
wxCHECK_MSG( wxTheApp, -1,
wxS("Can't block until child exit without wxTheApp") );
+#if wxUSE_SELECT_DISPATCHER
+
// Even if we don't want to dispatch events, we still need to handle
// child IO notifications and process termination concurrently, i.e.
// we can't simply block waiting for the child to terminate as we would
}
return execData.exitcode;
+#else // !wxUSE_SELECT_DISPATCHER
+ wxFAIL_MSG( wxS("Can't block until child exit without wxSelectDispatcher") );
+
+ return -1;
+#endif // wxUSE_SELECT_DISPATCHER/!wxUSE_SELECT_DISPATCHER
}
} // anonymous namespace
int wxAppTraits::WaitForChild(wxExecuteData& execData)
{
+#if wxUSE_CONSOLE_EVENTLOOP
wxConsoleEventLoop loop;
return RunLoopUntilChildExit(execData, loop);
+#else // !wxUSE_CONSOLE_EVENTLOOP
+ wxFAIL_MSG( wxS("Can't wait for child process without wxConsoleEventLoop") );
+
+ return -1;
+#endif // wxUSE_CONSOLE_EVENTLOOP/!wxUSE_CONSOLE_EVENTLOOP
}
// This function is common code for both console and GUI applications and used