2011-03-20 18:05:19 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/unix/apptbase.h
|
|
|
|
// Purpose: declaration of wxAppTraits for Unix systems
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 23.06.2003
|
|
|
|
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_UNIX_APPTBASE_H_
|
|
|
|
#define _WX_UNIX_APPTBASE_H_
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
#include "wx/evtloop.h"
|
|
|
|
#include "wx/evtloopsrc.h"
|
|
|
|
|
|
|
|
class wxExecuteData;
|
2011-03-20 18:05:19 +00:00
|
|
|
class wxFDIOManager;
|
2013-09-22 22:44:55 +00:00
|
|
|
class wxEventLoopSourcesManagerBase;
|
2011-03-20 18:05:19 +00:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxAppTraits: the Unix version adds extra hooks needed by Unix code
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// wxExecute() support methods
|
|
|
|
// ---------------------------
|
|
|
|
|
2013-09-22 22:44:55 +00:00
|
|
|
// Wait for the process termination and return its exit code or -1 on error.
|
2011-03-20 18:05:19 +00:00
|
|
|
//
|
2013-09-22 22:44:55 +00:00
|
|
|
// Notice that this is only used when execData.flags contains wxEXEC_SYNC
|
|
|
|
// and does not contain wxEXEC_NOEVENTS, i.e. when we need to really wait
|
|
|
|
// until the child process exit and dispatch the events while doing it.
|
2011-03-20 18:05:19 +00:00
|
|
|
virtual int WaitForChild(wxExecuteData& execData);
|
|
|
|
|
|
|
|
#if wxUSE_SOCKETS
|
|
|
|
// return a pointer to the object which should be used to integrate
|
|
|
|
// monitoring of the file descriptors to the event loop (currently this is
|
|
|
|
// used for the sockets only but should be used for arbitrary event loop
|
|
|
|
// sources in the future)
|
|
|
|
//
|
|
|
|
// this object may be different for the console and GUI applications
|
|
|
|
//
|
|
|
|
// the pointer is not deleted by the caller as normally it points to a
|
|
|
|
// static variable
|
|
|
|
virtual wxFDIOManager *GetFDIOManager();
|
|
|
|
#endif // wxUSE_SOCKETS
|
|
|
|
|
2016-06-26 05:25:29 +00:00
|
|
|
#if wxUSE_EVENTLOOP_SOURCE
|
2013-09-22 22:44:55 +00:00
|
|
|
// 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
|
|
|
|
|
2011-03-20 18:05:19 +00:00
|
|
|
protected:
|
2013-09-22 22:44:55 +00:00
|
|
|
// Wait for the process termination by running the given event loop until
|
|
|
|
// this happens.
|
|
|
|
//
|
|
|
|
// This is used by the public WaitForChild() after creating the event loop
|
|
|
|
// of the appropriate kind.
|
|
|
|
int RunLoopUntilChildExit(wxExecuteData& execData, wxEventLoopBase& loop);
|
2011-03-20 18:05:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_UNIX_APPTBASE_H_
|
|
|
|
|