mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Upgrade WX to r74856, mainly to support @2x.
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
// Authors: Lukasz Michalski
|
||||
// Created: April 2007
|
||||
// Copyright: (c) Lukasz Michalski
|
||||
// RCS-ID: $Id: epolldispatcher.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
136
Externals/wxWidgets3/include/wx/unix/private/executeiohandler.h
vendored
Normal file
136
Externals/wxWidgets3/include/wx/unix/private/executeiohandler.h
vendored
Normal file
@ -0,0 +1,136 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/unix/private/executeiohandler.h
|
||||
// Purpose: IO handler class for the FD used by wxExecute() under Unix
|
||||
// Author: Rob Bresalier, Vadim Zeitlin
|
||||
// Created: 2013-01-06
|
||||
// Copyright: (c) 2013 Rob Bresalier, Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_UNIX_PRIVATE_EXECUTEIOHANDLER_H_
|
||||
#define _WX_UNIX_PRIVATE_EXECUTEIOHANDLER_H_
|
||||
|
||||
#include "wx/private/streamtempinput.h"
|
||||
|
||||
// This class handles IO events on the pipe FD connected to the child process
|
||||
// stdout/stderr and is used by wxExecute().
|
||||
//
|
||||
// Currently it can derive from either wxEventLoopSourceHandler or
|
||||
// wxFDIOHandler depending on the kind of dispatcher/event loop it is used
|
||||
// with. In the future, when we get rid of wxFDIOHandler entirely, it will
|
||||
// derive from wxEventLoopSourceHandler only.
|
||||
template <class T>
|
||||
class wxExecuteIOHandlerBase : public T
|
||||
{
|
||||
public:
|
||||
wxExecuteIOHandlerBase(int fd, wxStreamTempInputBuffer& buf)
|
||||
: m_fd(fd),
|
||||
m_buf(buf)
|
||||
{
|
||||
m_callbackDisabled = false;
|
||||
}
|
||||
|
||||
// Called when the associated descriptor is available for reading.
|
||||
virtual void OnReadWaiting()
|
||||
{
|
||||
// Sync process, process all data coming at us from the pipe so that
|
||||
// the pipe does not get full and cause a deadlock situation.
|
||||
m_buf.Update();
|
||||
|
||||
if ( m_buf.Eof() )
|
||||
DisableCallback();
|
||||
}
|
||||
|
||||
// These methods are never called as we only monitor the associated FD for
|
||||
// reading, but we still must implement them as they're pure virtual in the
|
||||
// base class.
|
||||
virtual void OnWriteWaiting() { }
|
||||
virtual void OnExceptionWaiting() { }
|
||||
|
||||
// Disable any future calls to our OnReadWaiting(), can be called when
|
||||
// we're sure that no more input is forthcoming.
|
||||
void DisableCallback()
|
||||
{
|
||||
if ( !m_callbackDisabled )
|
||||
{
|
||||
m_callbackDisabled = true;
|
||||
|
||||
DoDisable();
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
const int m_fd;
|
||||
|
||||
private:
|
||||
virtual void DoDisable() = 0;
|
||||
|
||||
wxStreamTempInputBuffer& m_buf;
|
||||
|
||||
// If true, DisableCallback() had been already called.
|
||||
bool m_callbackDisabled;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxExecuteIOHandlerBase);
|
||||
};
|
||||
|
||||
// This is the version used with wxFDIODispatcher, which must be passed to the
|
||||
// ctor in order to register this handler with it.
|
||||
class wxExecuteFDIOHandler : public wxExecuteIOHandlerBase<wxFDIOHandler>
|
||||
{
|
||||
public:
|
||||
wxExecuteFDIOHandler(wxFDIODispatcher& dispatcher,
|
||||
int fd,
|
||||
wxStreamTempInputBuffer& buf)
|
||||
: wxExecuteIOHandlerBase<wxFDIOHandler>(fd, buf),
|
||||
m_dispatcher(dispatcher)
|
||||
{
|
||||
dispatcher.RegisterFD(fd, this, wxFDIO_INPUT);
|
||||
}
|
||||
|
||||
virtual ~wxExecuteFDIOHandler()
|
||||
{
|
||||
DisableCallback();
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void DoDisable()
|
||||
{
|
||||
m_dispatcher.UnregisterFD(m_fd);
|
||||
}
|
||||
|
||||
wxFDIODispatcher& m_dispatcher;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxExecuteFDIOHandler);
|
||||
};
|
||||
|
||||
// And this is the version used with an event loop. As AddSourceForFD() is
|
||||
// static, we don't require passing the event loop to the ctor but an event
|
||||
// loop must be running to handle our events.
|
||||
class wxExecuteEventLoopSourceHandler
|
||||
: public wxExecuteIOHandlerBase<wxEventLoopSourceHandler>
|
||||
{
|
||||
public:
|
||||
wxExecuteEventLoopSourceHandler(int fd, wxStreamTempInputBuffer& buf)
|
||||
: wxExecuteIOHandlerBase<wxEventLoopSourceHandler>(fd, buf)
|
||||
{
|
||||
m_source = wxEventLoop::AddSourceForFD(fd, this, wxEVENT_SOURCE_INPUT);
|
||||
}
|
||||
|
||||
virtual ~wxExecuteEventLoopSourceHandler()
|
||||
{
|
||||
DisableCallback();
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void DoDisable()
|
||||
{
|
||||
delete m_source;
|
||||
m_source = NULL;
|
||||
}
|
||||
|
||||
wxEventLoopSource* m_source;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxExecuteEventLoopSourceHandler);
|
||||
};
|
||||
|
||||
#endif // _WX_UNIX_PRIVATE_EXECUTEIOHANDLER_H_
|
@ -3,7 +3,6 @@
|
||||
// Purpose: wxFDIOManagerUnix class used by console Unix applications
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-08-17
|
||||
// RCS-ID: $Id: fdiounix.h 64140 2010-04-25 21:33:16Z FM $
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: File system watcher impl classes
|
||||
// Author: Bartosz Bekier
|
||||
// Created: 2009-05-26
|
||||
// RCS-ID: $Id: fswatcher_inotify.h 62475 2009-10-22 11:36:35Z VZ $
|
||||
// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: File system watcher impl classes
|
||||
// Author: Bartosz Bekier
|
||||
// Created: 2009-05-26
|
||||
// RCS-ID: $Id: fswatcher_kqueue.h 62475 2009-10-22 11:36:35Z VZ $
|
||||
// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
37
Externals/wxWidgets3/include/wx/unix/private/pipestream.h
vendored
Normal file
37
Externals/wxWidgets3/include/wx/unix/private/pipestream.h
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/unix/private/pipestream.h
|
||||
// Purpose: Unix wxPipeInputStream and wxPipeOutputStream declarations
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2013-06-08 (extracted from wx/unix/pipe.h)
|
||||
// Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_UNIX_PRIVATE_PIPESTREAM_H_
|
||||
#define _WX_UNIX_PRIVATE_PIPESTREAM_H_
|
||||
|
||||
#include "wx/wfstream.h"
|
||||
|
||||
class wxPipeInputStream : public wxFileInputStream
|
||||
{
|
||||
public:
|
||||
wxEXPLICIT wxPipeInputStream(int fd) : wxFileInputStream(fd) { }
|
||||
|
||||
// return true if the pipe is still opened
|
||||
bool IsOpened() const { return !Eof(); }
|
||||
|
||||
// return true if we have anything to read, don't block
|
||||
virtual bool CanRead() const;
|
||||
};
|
||||
|
||||
class wxPipeOutputStream : public wxFileOutputStream
|
||||
{
|
||||
public:
|
||||
wxPipeOutputStream(int fd) : wxFileOutputStream(fd) { }
|
||||
|
||||
// Override the base class version to ignore "pipe full" errors: this is
|
||||
// not an error for this class.
|
||||
size_t OnSysWrite(const void *buffer, size_t size);
|
||||
};
|
||||
|
||||
#endif // _WX_UNIX_PRIVATE_PIPESTREAM_H_
|
@ -3,7 +3,6 @@
|
||||
// Purpose: wxSocketImpl implementation for Unix systems
|
||||
// Authors: Guilhem Lavaux, Vadim Zeitlin
|
||||
// Created: April 1997
|
||||
// RCS-ID: $Id: sockunix.h 65581 2010-09-21 11:56:53Z VZ $
|
||||
// Copyright: (c) 1997 Guilhem Lavaux
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: wxTimer for wxBase (unix)
|
||||
// Author: Lukasz Michalski
|
||||
// Created: 15/01/2005
|
||||
// RCS-ID: $Id: timer.h 69839 2011-11-27 19:50:33Z VZ $
|
||||
// Copyright: (c) Lukasz Michalski
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
101
Externals/wxWidgets3/include/wx/unix/private/wakeuppipe.h
vendored
Normal file
101
Externals/wxWidgets3/include/wx/unix/private/wakeuppipe.h
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/unix/private/wakeuppipe.h
|
||||
// Purpose: Helper class allowing to wake up the main thread.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2013-06-09 (extracted from src/unix/evtloopunix.cpp)
|
||||
// Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_UNIX_PRIVATE_WAKEUPPIPE_H_
|
||||
#define _WX_UNIX_PRIVATE_WAKEUPPIPE_H_
|
||||
|
||||
#include "wx/unix/pipe.h"
|
||||
#include "wx/evtloopsrc.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWakeUpPipe: allows to wake up the event loop by writing to it
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This class is not MT-safe, see wxWakeUpPipeMT below for a wake up pipe
|
||||
// usable from other threads.
|
||||
|
||||
class wxWakeUpPipe : public wxEventLoopSourceHandler
|
||||
{
|
||||
public:
|
||||
// Create and initialize the pipe.
|
||||
//
|
||||
// It's the callers responsibility to add the read end of this pipe,
|
||||
// returned by GetReadFd(), to the code blocking on input.
|
||||
wxWakeUpPipe();
|
||||
|
||||
// Wake up the blocking operation involving this pipe.
|
||||
//
|
||||
// It simply writes to the write end of the pipe.
|
||||
//
|
||||
// As indicated by its name, this method does no locking and so can be
|
||||
// called only from the main thread.
|
||||
void WakeUpNoLock();
|
||||
|
||||
// Same as WakeUp() but without locking.
|
||||
|
||||
// Return the read end of the pipe.
|
||||
int GetReadFd() { return m_pipe[wxPipe::Read]; }
|
||||
|
||||
|
||||
// Implement wxEventLoopSourceHandler pure virtual methods
|
||||
virtual void OnReadWaiting();
|
||||
virtual void OnWriteWaiting() { }
|
||||
virtual void OnExceptionWaiting() { }
|
||||
|
||||
private:
|
||||
wxPipe m_pipe;
|
||||
|
||||
// This flag is set to true after writing to the pipe and reset to false
|
||||
// after reading from it in the main thread. Having it allows us to avoid
|
||||
// overflowing the pipe with too many writes if the main thread can't keep
|
||||
// up with reading from it.
|
||||
bool m_pipeIsEmpty;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWakeUpPipeMT: thread-safe version of wxWakeUpPipe
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This class can be used from multiple threads, i.e. its WakeUp() can be
|
||||
// called concurrently.
|
||||
#if wxUSE_THREADS
|
||||
|
||||
class wxWakeUpPipeMT : public wxWakeUpPipe
|
||||
{
|
||||
public:
|
||||
wxWakeUpPipeMT() { }
|
||||
|
||||
// Thread-safe wrapper around WakeUpNoLock(): can be called from another
|
||||
// thread to wake up the main one.
|
||||
void WakeUp()
|
||||
{
|
||||
wxCriticalSectionLocker lock(m_pipeLock);
|
||||
|
||||
WakeUpNoLock();
|
||||
}
|
||||
|
||||
virtual void OnReadWaiting()
|
||||
{
|
||||
wxCriticalSectionLocker lock(m_pipeLock);
|
||||
|
||||
wxWakeUpPipe::OnReadWaiting();
|
||||
}
|
||||
|
||||
private:
|
||||
// Protects access to m_pipeIsEmpty.
|
||||
wxCriticalSection m_pipeLock;
|
||||
};
|
||||
|
||||
#else // !wxUSE_THREADS
|
||||
|
||||
typedef wxWakeUpPipe wxWakeUpPipeMT;
|
||||
|
||||
#endif // wxUSE_THREADS/!wxUSE_THREADS
|
||||
|
||||
#endif // _WX_UNIX_PRIVATE_WAKEUPPIPE_H_
|
Reference in New Issue
Block a user