dolphin-emulator/Externals/wxWidgets3/src/unix/apptraits.cpp
Soren Jorvang d14efe561b Import r67258 of the wxWidgets trunk, which I expect will before
long become wxWidgets 2.9.2, which in turn is expected to be the
last 2.9 release before the 3.0 stable release.

Since the full wxWidgets distribution is rather large, I have
imported only the parts that we use, on a subdirectory basis:

art
include/wx/*.*
include/wx/aui
include/wx/cocoa
include/wx/generic
include/wx/gtk
include/wx/meta
include/wx/msw
include/wx/osx
include/wx/persist
include/wx/private
include/wx/protocol
include/wx/unix
src/aui
src/common
src/generic
src/gtk
src/msw
src/osx
src/unix


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7380 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-03-20 18:05:19 +00:00

83 lines
2.7 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: src/unix/apptraits.cpp
// Purpose: implementation of wxGUIAppTraits for Unix systems
// Author: Vadim Zeitlin
// Created: 2008-03-22
// RCS-ID: $Id: apptraits.cpp 52742 2008-03-23 18:24:27Z PC $
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/apptrait.h"
#ifndef WX_PRECOMP
#include "wx/utils.h"
#endif // WX_PRECOMP
#include "wx/unix/execute.h"
// ============================================================================
// implementation
// ============================================================================
int wxGUIAppTraits::WaitForChild(wxExecuteData& execData)
{
const int flags = execData.flags;
if ( !(flags & wxEXEC_SYNC) || (flags & wxEXEC_NOEVENTS) )
{
// async or blocking sync cases are already handled by the base class
// just fine, no need to duplicate its code here
return wxAppTraits::WaitForChild(execData);
}
// here we're dealing with the case of synchronous execution when we want
// to process the GUI events while waiting for the child termination
wxEndProcessData endProcData;
endProcData.pid = execData.pid;
endProcData.tag = AddProcessCallback
(
&endProcData,
execData.GetEndProcReadFD()
);
endProcData.async = false;
// prepare to wait for the child termination: show to the user that we're
// busy and refuse all input unless explicitly told otherwise
wxBusyCursor bc;
wxWindowDisabler wd(!(flags & wxEXEC_NODISABLE));
// endProcData.pid will be set to 0 from wxHandleProcessTermination() when
// the process terminates
while ( endProcData.pid != 0 )
{
// don't consume 100% of the CPU while we're sitting in this
// loop
if ( !CheckForRedirectedIO(execData) )
wxMilliSleep(1);
// give the toolkit a chance to call wxHandleProcessTermination() here
// and also repaint the GUI and handle other accumulated events
wxYield();
}
return endProcData.exitcode;
}