mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 18:19:49 -06:00
Upgrade WX to r74856, mainly to support @2x.
This commit is contained in:
25
Externals/wxWidgets3/include/wx/private/eventloopsourcesmanager.h
vendored
Normal file
25
Externals/wxWidgets3/include/wx/private/eventloopsourcesmanager.h
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/eventloopsourcesmanager.h
|
||||
// Purpose: declares wxEventLoopSourcesManagerBase class
|
||||
// Author: Rob Bresalier
|
||||
// Created: 2013-06-19
|
||||
// Copyright: (c) 2013 Rob Bresalier
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_EVENTLOOPSOURCESMANAGER_H_
|
||||
#define _WX_PRIVATE_EVENTLOOPSOURCESMANAGER_H_
|
||||
|
||||
// For pulling in the value of wxUSE_EVENTLOOP_SOURCE
|
||||
#include "wx/evtloop.h"
|
||||
|
||||
class WXDLLIMPEXP_BASE wxEventLoopSourcesManagerBase
|
||||
{
|
||||
public:
|
||||
#if wxUSE_EVENTLOOP_SOURCE
|
||||
virtual wxEventLoopSource*
|
||||
AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // _WX_PRIVATE_EVENTLOOPSOURCESMANAGER_H_
|
1
Externals/wxWidgets3/include/wx/private/fd.h
vendored
1
Externals/wxWidgets3/include/wx/private/fd.h
vendored
@ -3,7 +3,6 @@
|
||||
// Purpose: private stuff for working with file descriptors
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2008-11-23 (moved from wx/unix/private.h)
|
||||
// RCS-ID: $Id: fd.h 62790 2009-12-06 02:29:42Z VZ $
|
||||
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -4,7 +4,6 @@
|
||||
// Authors: Lukasz Michalski
|
||||
// Created: December 2006
|
||||
// Copyright: (c) Lukasz Michalski
|
||||
// RCS-ID: $Id: fdiodispatcher.h 61686 2009-08-17 23:02:29Z VZ $
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
38
Externals/wxWidgets3/include/wx/private/fdioeventloopsourcehandler.h
vendored
Normal file
38
Externals/wxWidgets3/include/wx/private/fdioeventloopsourcehandler.h
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/fdioeventloopsourcehandler.h
|
||||
// Purpose: declares wxFDIOEventLoopSourceHandler class
|
||||
// Author: Rob Bresalier, Vadim Zeitlin
|
||||
// Created: 2013-06-13 (extracted from src/unix/evtloopunix.cpp)
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// (c) 2013 Rob Bresalier
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_FDIO_EVENT_LOOP_SOURCE_HANDLER_H
|
||||
#define _WX_PRIVATE_FDIO_EVENT_LOOP_SOURCE_HANDLER_H
|
||||
|
||||
#include "wx/evtloopsrc.h"
|
||||
|
||||
// This class is a temporary bridge between event loop sources and
|
||||
// FDIODispatcher. It is going to be removed soon, when all subject interfaces
|
||||
// are modified
|
||||
class wxFDIOEventLoopSourceHandler : public wxFDIOHandler
|
||||
{
|
||||
public:
|
||||
wxEXPLICIT wxFDIOEventLoopSourceHandler(wxEventLoopSourceHandler* handler)
|
||||
: m_handler(handler)
|
||||
{
|
||||
}
|
||||
|
||||
// Just forward to the real handler.
|
||||
virtual void OnReadWaiting() { m_handler->OnReadWaiting(); }
|
||||
virtual void OnWriteWaiting() { m_handler->OnWriteWaiting(); }
|
||||
virtual void OnExceptionWaiting() { m_handler->OnExceptionWaiting(); }
|
||||
|
||||
protected:
|
||||
wxEventLoopSourceHandler* const m_handler;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxFDIOEventLoopSourceHandler);
|
||||
};
|
||||
|
||||
#endif // _WX_PRIVATE_FDIO_EVENT_LOOP_SOURCE_HANDLER_H
|
@ -3,7 +3,6 @@
|
||||
// Purpose: declares wxFDIOHandler class
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-08-17
|
||||
// RCS-ID: $Id: fdiohandler.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: declaration of wxFDIOManager
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-08-17
|
||||
// RCS-ID: $Id: fdiomanager.h 64140 2010-04-25 21:33:16Z FM $
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -2,7 +2,6 @@
|
||||
// Name: wx/private/fileback.h
|
||||
// Purpose: Back an input stream with memory or a file
|
||||
// Author: Mike Wetherell
|
||||
// RCS-ID: $Id: fileback.h 64943 2010-07-13 13:29:58Z VZ $
|
||||
// Copyright: (c) 2006 Mike Wetherell
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -4,7 +4,6 @@
|
||||
// Author: Mike Wetherell
|
||||
// Modified by:
|
||||
// Created: 2006-10-22
|
||||
// RCS-ID: $Id: filename.h 64943 2010-07-13 13:29:58Z VZ $
|
||||
// Copyright: (c) 2006 Mike Wetherell
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: helpers for checking that (bit)flags don't overlap
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2008-02-21
|
||||
// RCS-ID: $Id: flagscheck.h 59016 2009-02-19 05:34:25Z PC $
|
||||
// Copyright: (c) 2008 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: font management for ports that don't have their own
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2006-11-18
|
||||
// RCS-ID: $Id: fontmgr.h 70353 2012-01-15 14:46:41Z VZ $
|
||||
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
|
||||
// (c) 2006 REA Elektronik GmbH
|
||||
// Licence: wxWindows licence
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: File system watcher impl classes
|
||||
// Author: Bartosz Bekier
|
||||
// Created: 2009-05-26
|
||||
// RCS-ID: $Id: fswatcher.h 70796 2012-03-04 00:29:31Z VZ $
|
||||
// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -49,8 +48,13 @@ public:
|
||||
|
||||
virtual bool Add(const wxFSWatchInfo& winfo)
|
||||
{
|
||||
wxCHECK_MSG( m_watches.find(winfo.GetPath()) == m_watches.end(), false,
|
||||
"Path '%s' is already watched");
|
||||
if ( m_watches.find(winfo.GetPath()) != m_watches.end() )
|
||||
{
|
||||
wxLogTrace(wxTRACE_FSWATCHER,
|
||||
"Path '%s' is already watched", winfo.GetPath());
|
||||
// This can happen if a dir is watched, then a parent tree added
|
||||
return true;
|
||||
}
|
||||
|
||||
// construct watch entry
|
||||
wxSharedPtr<wxFSWatchEntry> watch(new wxFSWatchEntry(winfo));
|
||||
@ -66,8 +70,13 @@ public:
|
||||
virtual bool Remove(const wxFSWatchInfo& winfo)
|
||||
{
|
||||
wxFSWatchEntries::iterator it = m_watches.find(winfo.GetPath());
|
||||
wxCHECK_MSG( it != m_watches.end(), false, "Path '%s' is not watched");
|
||||
|
||||
if ( it == m_watches.end() )
|
||||
{
|
||||
wxLogTrace(wxTRACE_FSWATCHER,
|
||||
"Path '%s' is not watched", winfo.GetPath());
|
||||
// This can happen if a dir is watched, then a parent tree added
|
||||
return true;
|
||||
}
|
||||
wxSharedPtr<wxFSWatchEntry> watch = it->second;
|
||||
m_watches.erase(it);
|
||||
return DoRemove(watch);
|
||||
@ -79,6 +88,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check whether any filespec matches the file's ext (if present)
|
||||
bool MatchesFilespec(const wxFileName& fn, const wxString& filespec) const
|
||||
{
|
||||
return filespec.empty() || wxMatchWild(filespec, fn.GetFullName());
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool DoAdd(wxSharedPtr<wxFSWatchEntry> watch) = 0;
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
// Modified by:
|
||||
// Created:
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// RCS-ID: $Id: graphics.h 67232 2011-03-18 15:10:15Z DS $
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -28,6 +27,18 @@ class WXDLLIMPEXP_CORE wxGraphicsObjectRefData : public wxObjectRefData
|
||||
wxGraphicsRenderer* m_renderer;
|
||||
} ;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGraphicsBitmapData : public wxGraphicsObjectRefData
|
||||
{
|
||||
public :
|
||||
wxGraphicsBitmapData( wxGraphicsRenderer* renderer) :
|
||||
wxGraphicsObjectRefData(renderer) {}
|
||||
|
||||
virtual ~wxGraphicsBitmapData() {}
|
||||
|
||||
// returns the native representation
|
||||
virtual void * GetNativeBitmap() const = 0;
|
||||
} ;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGraphicsMatrixData : public wxGraphicsObjectRefData
|
||||
{
|
||||
public :
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: Classes for parsing simple markup.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-02-16
|
||||
// RCS-ID: $Id: markupparser.h 67076 2011-02-27 18:36:52Z VZ $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: Classes mapping markup attributes to wxFont/wxColour.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-02-18
|
||||
// RCS-ID: $Id: markupparserattr.h 70447 2012-01-23 11:28:32Z VZ $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -4,7 +4,6 @@
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
// Created: 2006-10-20
|
||||
// RCS-ID: $Id: overlay.h 54125 2008-06-11 19:17:41Z SC $
|
||||
// Copyright: (c) wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
29
Externals/wxWidgets3/include/wx/private/pipestream.h
vendored
Normal file
29
Externals/wxWidgets3/include/wx/private/pipestream.h
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/pipestream.h
|
||||
// Purpose: Declares wxPipeInputStream and wxPipeOutputStream.
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by: Rob Bresalier
|
||||
// Created: 2013-04-27
|
||||
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// (c) 2013 Rob Bresalier
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_PIPESTREAM_H_
|
||||
#define _WX_PRIVATE_PIPESTREAM_H_
|
||||
|
||||
#include "wx/platform.h"
|
||||
|
||||
// wxPipeInputStream is a platform-dependent input stream class (i.e. deriving,
|
||||
// possible indirectly, from wxInputStream) for reading from a pipe, i.e. a
|
||||
// pipe FD under Unix or a pipe HANDLE under MSW. It provides a single extra
|
||||
// IsOpened() method.
|
||||
//
|
||||
// wxPipeOutputStream is similar but has no additional methods at all.
|
||||
#ifdef __UNIX__
|
||||
#include "wx/unix/private/pipestream.h"
|
||||
#elif defined(__WINDOWS__) && !defined(__WXWINCE__)
|
||||
#include "wx/msw/private/pipestream.h"
|
||||
#endif
|
||||
|
||||
#endif // _WX_PRIVATE_PIPESTREAM_H_
|
40
Externals/wxWidgets3/include/wx/private/preferences.h
vendored
Normal file
40
Externals/wxWidgets3/include/wx/private/preferences.h
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/preferences.h
|
||||
// Purpose: wxPreferencesEditorImpl declaration.
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2013-02-19
|
||||
// Copyright: (c) 2013 Vaclav Slavik <vslavik@fastmail.fm>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_PREFERENCES_H_
|
||||
#define _WX_PRIVATE_PREFERENCES_H_
|
||||
|
||||
#include "wx/preferences.h"
|
||||
|
||||
#if wxUSE_TOOLBAR && defined(__WXOSX_COCOA__) && wxOSX_USE_NATIVE_TOOLBAR
|
||||
#define wxHAS_PREF_EDITOR_NATIVE
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPreferencesEditorImpl: defines wxPreferencesEditor implementation.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxPreferencesEditorImpl
|
||||
{
|
||||
public:
|
||||
// This is implemented in a platform-specific way.
|
||||
static wxPreferencesEditorImpl* Create(const wxString& title);
|
||||
|
||||
// These methods simply mirror the public wxPreferencesEditor ones.
|
||||
virtual void AddPage(wxPreferencesPage* page) = 0;
|
||||
virtual void Show(wxWindow* parent) = 0;
|
||||
virtual void Dismiss() = 0;
|
||||
|
||||
virtual ~wxPreferencesEditorImpl() {}
|
||||
|
||||
protected:
|
||||
wxPreferencesEditorImpl() {}
|
||||
};
|
||||
|
||||
#endif // _WX_PRIVATE_PREFERENCES_H_
|
@ -3,7 +3,6 @@
|
||||
// Purpose: wxRichToolTipImpl declaration.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-10-18
|
||||
// RCS-ID: $Id: richtooltip.h 69463 2011-10-18 21:57:02Z VZ $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -29,11 +28,12 @@ public:
|
||||
const wxColour& colEnd) = 0;
|
||||
virtual void SetCustomIcon(const wxIcon& icon) = 0;
|
||||
virtual void SetStandardIcon(int icon) = 0;
|
||||
virtual void SetTimeout(unsigned milliseconds) = 0;
|
||||
virtual void SetTimeout(unsigned milliseconds,
|
||||
unsigned millisecondsShowdelay = 0) = 0;
|
||||
virtual void SetTipKind(wxTipKind tipKind) = 0;
|
||||
virtual void SetTitleFont(const wxFont& font) = 0;
|
||||
|
||||
virtual void ShowFor(wxWindow* win) = 0;
|
||||
virtual void ShowFor(wxWindow* win, const wxRect* rect = NULL) = 0;
|
||||
|
||||
virtual ~wxRichToolTipImpl() { }
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: wxSockAddressImpl
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2008-12-28
|
||||
// RCS-ID: $Id: sckaddr.h 70796 2012-03-04 00:29:31Z VZ $
|
||||
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -4,7 +4,6 @@
|
||||
// Authors: Lukasz Michalski and Vadim Zeitlin
|
||||
// Created: December 2006
|
||||
// Copyright: (c) Lukasz Michalski
|
||||
// RCS-ID: $Id: selectdispatcher.h 63716 2010-03-20 12:45:28Z VZ $
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: wxSocketImpl and related declarations
|
||||
// Authors: Guilhem Lavaux, Vadim Zeitlin
|
||||
// Created: April 1997
|
||||
// RCS-ID: $Id: socket.h 70796 2012-03-04 00:29:31Z VZ $
|
||||
// Copyright: (c) 1997 Guilhem Lavaux
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
@ -51,7 +50,7 @@
|
||||
having been defined in sys/types.h" when winsock.h is included later and
|
||||
doesn't seem to be necessary anyhow. It's not needed under Mac neither.
|
||||
*/
|
||||
#if !defined(__WXMAC__) && !defined(__CYGWIN__) && !defined(__WXWINCE__)
|
||||
#if !defined(__WXMAC__) && !defined(__WXMSW__) && !defined(__WXWINCE__)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
@ -79,10 +78,6 @@
|
||||
|
||||
// define some symbols which winsock.h defines but traditional BSD headers
|
||||
// don't
|
||||
#ifndef __WINDOWS__
|
||||
#define SOCKET int
|
||||
#endif
|
||||
|
||||
#ifndef INVALID_SOCKET
|
||||
#define INVALID_SOCKET (-1)
|
||||
#endif
|
||||
@ -293,7 +288,7 @@ public:
|
||||
// TODO: make these fields protected and provide accessors for those of
|
||||
// them that wxSocketBase really needs
|
||||
//protected:
|
||||
SOCKET m_fd;
|
||||
wxSOCKET_T m_fd;
|
||||
|
||||
int m_initialRecvBufferSize;
|
||||
int m_initialSendBufferSize;
|
||||
|
134
Externals/wxWidgets3/include/wx/private/streamtempinput.h
vendored
Normal file
134
Externals/wxWidgets3/include/wx/private/streamtempinput.h
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/streamtempinput.h
|
||||
// Purpose: defines wxStreamTempInputBuffer which is used by Unix and MSW
|
||||
// implementations of wxExecute; this file is only used by the
|
||||
// library and never by the user code
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by: Rob Bresalier
|
||||
// Created: 2013-05-04
|
||||
// Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_STREAMTEMPINPUT_H
|
||||
#define _WX_PRIVATE_STREAMTEMPINPUT_H
|
||||
|
||||
#include "wx/private/pipestream.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStreamTempInputBuffer
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
wxStreamTempInputBuffer is a hack which we need to solve the problem of
|
||||
executing a child process synchronously with IO redirecting: when we do
|
||||
this, the child writes to a pipe we open to it but when the pipe buffer
|
||||
(which has finite capacity, e.g. commonly just 4Kb) becomes full we have to
|
||||
read data from it because the child blocks in its write() until then and if
|
||||
it blocks we are never going to return from wxExecute() so we dead lock.
|
||||
|
||||
So here is the fix: we now read the output as soon as it appears into a temp
|
||||
buffer (wxStreamTempInputBuffer object) and later just stuff it back into
|
||||
the stream when the process terminates. See supporting code in wxExecute()
|
||||
itself as well.
|
||||
|
||||
Note that this is horribly inefficient for large amounts of output (count
|
||||
the number of times we copy the data around) and so a better API is badly
|
||||
needed! However it's not easy to devise a way to do this keeping backwards
|
||||
compatibility with the existing wxExecute(wxEXEC_SYNC)...
|
||||
*/
|
||||
class wxStreamTempInputBuffer
|
||||
{
|
||||
public:
|
||||
wxStreamTempInputBuffer()
|
||||
{
|
||||
m_stream = NULL;
|
||||
m_buffer = NULL;
|
||||
m_size = 0;
|
||||
}
|
||||
|
||||
// call to associate a stream with this buffer, otherwise nothing happens
|
||||
// at all
|
||||
void Init(wxPipeInputStream *stream)
|
||||
{
|
||||
wxASSERT_MSG( !m_stream, wxS("Can only initialize once") );
|
||||
|
||||
m_stream = stream;
|
||||
}
|
||||
|
||||
// check for input on our stream and cache it in our buffer if any
|
||||
//
|
||||
// return true if anything was done
|
||||
bool Update()
|
||||
{
|
||||
if ( !m_stream || !m_stream->CanRead() )
|
||||
return false;
|
||||
|
||||
// realloc in blocks of 4Kb: this is the default (and minimal) buffer
|
||||
// size of the Unix pipes so it should be the optimal step
|
||||
//
|
||||
// NB: don't use "static int" in this inline function, some compilers
|
||||
// (e.g. IBM xlC) don't like it
|
||||
enum { incSize = 4096 };
|
||||
|
||||
void *buf = realloc(m_buffer, m_size + incSize);
|
||||
if ( !buf )
|
||||
return false;
|
||||
|
||||
m_buffer = buf;
|
||||
m_stream->Read((char *)m_buffer + m_size, incSize);
|
||||
m_size += m_stream->LastRead();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// check if can continue reading from the stream, this is used to disable
|
||||
// the callback once we can't read anything more
|
||||
bool Eof() const
|
||||
{
|
||||
// If we have no stream, always return true as we can't read any more.
|
||||
return !m_stream || m_stream->Eof();
|
||||
}
|
||||
|
||||
// read everything remaining until the EOF, this should only be called once
|
||||
// the child process terminates and we know that no more data is coming
|
||||
bool ReadAll()
|
||||
{
|
||||
while ( !Eof() )
|
||||
{
|
||||
if ( !Update() )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// dtor puts the data buffered during this object lifetime into the
|
||||
// associated stream
|
||||
~wxStreamTempInputBuffer()
|
||||
{
|
||||
if ( m_buffer )
|
||||
{
|
||||
m_stream->Ungetch(m_buffer, m_size);
|
||||
free(m_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
const void *GetBuffer() const { return m_buffer; }
|
||||
|
||||
size_t GetSize() const { return m_size; }
|
||||
|
||||
private:
|
||||
// the stream we're buffering, if NULL we don't do anything at all
|
||||
wxPipeInputStream *m_stream;
|
||||
|
||||
// the buffer of size m_size (NULL if m_size == 0)
|
||||
void *m_buffer;
|
||||
|
||||
// the size of the buffer
|
||||
size_t m_size;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxStreamTempInputBuffer);
|
||||
};
|
||||
|
||||
#endif // _WX_PRIVATE_STREAMTEMPINPUT_H
|
174
Externals/wxWidgets3/include/wx/private/textmeasure.h
vendored
Normal file
174
Externals/wxWidgets3/include/wx/private/textmeasure.h
vendored
Normal file
@ -0,0 +1,174 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/textmeasure.h
|
||||
// Purpose: declaration of wxTextMeasure class
|
||||
// Author: Manuel Martin
|
||||
// Created: 2012-10-05
|
||||
// Copyright: (c) 1997-2012 wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_TEXTMEASURE_H_
|
||||
#define _WX_PRIVATE_TEXTMEASURE_H_
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxFont;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextMeasure: class used to measure text extent.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxTextMeasureBase
|
||||
{
|
||||
public:
|
||||
// The first ctor argument must be non-NULL, i.e. each object of this class
|
||||
// is associated with either a valid wxDC or a valid wxWindow. The font can
|
||||
// be NULL to use the current DC/window font or can be specified explicitly.
|
||||
wxTextMeasureBase(const wxDC *dc, const wxFont *theFont);
|
||||
wxTextMeasureBase(const wxWindow *win, const wxFont *theFont);
|
||||
|
||||
// Even though this class is not supposed to be used polymorphically, give
|
||||
// it a virtual dtor to avoid compiler warnings.
|
||||
virtual ~wxTextMeasureBase() { }
|
||||
|
||||
|
||||
// Return the extent of a single line string.
|
||||
void GetTextExtent(const wxString& string,
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL);
|
||||
|
||||
// The same for a multiline (with '\n') string.
|
||||
void GetMultiLineTextExtent(const wxString& text,
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *heightOneLine = NULL);
|
||||
|
||||
// Find the dimensions of the largest string.
|
||||
wxSize GetLargestStringExtent(size_t n, const wxString* strings);
|
||||
wxSize GetLargestStringExtent(const wxArrayString& strings)
|
||||
{
|
||||
return GetLargestStringExtent(strings.size(), &strings[0]);
|
||||
}
|
||||
|
||||
// Fill the array with the widths for each "0..N" substrings for N from 1
|
||||
// to text.length().
|
||||
//
|
||||
// The scaleX argument is the horizontal scale used by wxDC and is only
|
||||
// used in the generic implementation.
|
||||
bool GetPartialTextExtents(const wxString& text,
|
||||
wxArrayInt& widths,
|
||||
double scaleX);
|
||||
|
||||
|
||||
// These functions are called by our public methods before and after each
|
||||
// call to DoGetTextExtent(). Derived classes may override them to prepare
|
||||
// for -- possibly several -- subsequent calls to DoGetTextExtent().
|
||||
//
|
||||
// As these calls must be always paired, they're never called directly but
|
||||
// only by our friend MeasuringGuard class.
|
||||
//
|
||||
// NB: They're public only to allow VC6 to compile this code, there doesn't
|
||||
// seem to be any way to give MeasuringGuard access to them (FIXME-VC6)
|
||||
virtual void BeginMeasuring() { }
|
||||
virtual void EndMeasuring() { }
|
||||
|
||||
// This is another method which is only used by MeasuringGuard.
|
||||
bool IsUsingDCImpl() const { return m_useDCImpl; }
|
||||
|
||||
protected:
|
||||
// RAII wrapper for the two methods above.
|
||||
class MeasuringGuard
|
||||
{
|
||||
public:
|
||||
MeasuringGuard(wxTextMeasureBase& tm) : m_tm(tm)
|
||||
{
|
||||
// BeginMeasuring() should only be called if we have a native DC,
|
||||
// so don't call it if we delegate to a DC of unknown type.
|
||||
if ( !m_tm.IsUsingDCImpl() )
|
||||
m_tm.BeginMeasuring();
|
||||
}
|
||||
|
||||
~MeasuringGuard()
|
||||
{
|
||||
if ( !m_tm.IsUsingDCImpl() )
|
||||
m_tm.EndMeasuring();
|
||||
}
|
||||
|
||||
private:
|
||||
wxTextMeasureBase& m_tm;
|
||||
};
|
||||
|
||||
|
||||
// The main function of this class, to be implemented in platform-specific
|
||||
// way used by all our public methods.
|
||||
//
|
||||
// The width and height pointers here are never NULL and the input string
|
||||
// is not empty.
|
||||
virtual void DoGetTextExtent(const wxString& string,
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL) = 0;
|
||||
|
||||
// The real implementation of GetPartialTextExtents().
|
||||
//
|
||||
// On input, widths array contains text.length() zero elements and the text
|
||||
// is guaranteed to be non-empty.
|
||||
virtual bool DoGetPartialTextExtents(const wxString& text,
|
||||
wxArrayInt& widths,
|
||||
double scaleX) = 0;
|
||||
|
||||
// Call either DoGetTextExtent() or wxDC::GetTextExtent() depending on the
|
||||
// value of m_useDCImpl.
|
||||
//
|
||||
// This must be always used instead of calling DoGetTextExtent() directly!
|
||||
void CallGetTextExtent(const wxString& string,
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL);
|
||||
|
||||
// Return a valid font: if one was given to us in the ctor, use this one,
|
||||
// otherwise use the current font of the associated wxDC or wxWindow.
|
||||
wxFont GetFont() const;
|
||||
|
||||
|
||||
// Exactly one of m_dc and m_win is non-NULL for any given object of this
|
||||
// class.
|
||||
const wxDC* const m_dc;
|
||||
const wxWindow* const m_win;
|
||||
|
||||
// If this is true, simply forward to wxDC::GetTextExtent() from our
|
||||
// CallGetTextExtent() instead of calling our own DoGetTextExtent().
|
||||
//
|
||||
// We need this because our DoGetTextExtent() typically only works with
|
||||
// native DCs, i.e. those having an HDC under Windows or using Pango under
|
||||
// GTK+. However wxTextMeasure object can be constructed for any wxDC, not
|
||||
// necessarily a native one and in this case we must call back into the DC
|
||||
// implementation of text measuring itself.
|
||||
bool m_useDCImpl;
|
||||
|
||||
// This one can be NULL or not.
|
||||
const wxFont* const m_font;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxTextMeasureBase);
|
||||
};
|
||||
|
||||
// Include the platform dependant class declaration, if any.
|
||||
#if defined(__WXGTK20__)
|
||||
#include "wx/gtk/private/textmeasure.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/private/textmeasure.h"
|
||||
#else // no platform-specific implementation of wxTextMeasure yet
|
||||
#include "wx/generic/private/textmeasure.h"
|
||||
|
||||
#define wxUSE_GENERIC_TEXTMEASURE 1
|
||||
#endif
|
||||
|
||||
#ifndef wxUSE_GENERIC_TEXTMEASURE
|
||||
#define wxUSE_GENERIC_TEXTMEASURE 0
|
||||
#endif
|
||||
|
||||
#endif // _WX_PRIVATE_TEXTMEASURE_H_
|
@ -3,7 +3,6 @@
|
||||
// Purpose: declaration of wxThreadSpecificInfo: thread-specific information
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-07-13
|
||||
// RCS-ID: $Id: threadinfo.h 67232 2011-03-18 15:10:15Z DS $
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -11,25 +10,30 @@
|
||||
#ifndef _WX_PRIVATE_THREADINFO_H_
|
||||
#define _WX_PRIVATE_THREADINFO_H_
|
||||
|
||||
#if wxUSE_THREADS
|
||||
|
||||
#include "wx/tls.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_BASE wxLog;
|
||||
|
||||
#if wxUSE_INTL
|
||||
#include "wx/hashset.h"
|
||||
WX_DECLARE_HASH_SET(wxString, wxStringHash, wxStringEqual,
|
||||
wxLocaleUntranslatedStrings);
|
||||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxThreadSpecificInfo: contains all thread-specific information used by wx
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// currently the only thread-specific information we use is the active wxLog
|
||||
// target but more could be added in the future (e.g. current wxLocale would be
|
||||
// a likely candidate) and we will group all of them in this struct to avoid
|
||||
// consuming more TLS slots than necessary as there is only a limited number of
|
||||
// them
|
||||
|
||||
// NB: this must be a POD to be stored in TLS
|
||||
struct wxThreadSpecificInfo
|
||||
// Group all thread-specific information we use (e.g. the active wxLog target)
|
||||
// a in this class to avoid consuming more TLS slots than necessary as there is
|
||||
// only a limited number of them.
|
||||
class wxThreadSpecificInfo
|
||||
{
|
||||
public:
|
||||
// Return this thread's instance.
|
||||
static wxThreadSpecificInfo& Get();
|
||||
|
||||
// the thread-specific logger or NULL if the thread is using the global one
|
||||
// (this is not used for the main thread which always uses the global
|
||||
// logger)
|
||||
@ -42,13 +46,24 @@ struct wxThreadSpecificInfo
|
||||
// because the default, for 0-initialized struct, should be to enable
|
||||
// logging
|
||||
bool loggingDisabled;
|
||||
|
||||
#if wxUSE_INTL
|
||||
// Storage for wxTranslations::GetUntranslatedString()
|
||||
wxLocaleUntranslatedStrings untranslatedStrings;
|
||||
#endif
|
||||
|
||||
#if wxUSE_THREADS
|
||||
// Cleans up storage for the current thread. Should be called when a thread
|
||||
// is being destroyed. If it's not called, the only bad thing that happens
|
||||
// is that the memory is deallocated later, on process termination.
|
||||
static void ThreadCleanUp();
|
||||
#endif
|
||||
|
||||
private:
|
||||
wxThreadSpecificInfo() : logger(NULL), loggingDisabled(false) {}
|
||||
};
|
||||
|
||||
// currently this is defined in src/common/log.cpp
|
||||
extern wxTLS_TYPE(wxThreadSpecificInfo) wxThreadInfoVar;
|
||||
#define wxThreadInfo wxTLS_VALUE(wxThreadInfoVar)
|
||||
|
||||
#endif // wxUSE_THREADS
|
||||
#define wxThreadInfo wxThreadSpecificInfo::Get()
|
||||
|
||||
#endif // _WX_PRIVATE_THREADINFO_H_
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: Base class for wxTimer implementations
|
||||
// Author: Lukasz Michalski <lmichalski@sf.net>
|
||||
// Created: 31.10.2006
|
||||
// RCS-ID: $Id: timer.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 2006-2007 wxWidgets dev team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Purpose: misc wxWindow helpers
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2010-01-21
|
||||
// RCS-ID: $Id: window.h 63251 2010-01-24 11:51:09Z VS $
|
||||
// Copyright: (c) 2010 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -4,7 +4,6 @@
|
||||
// Author: Ove Kaven
|
||||
// Modified by: Ron Lee, Francesco Montorsi
|
||||
// Created: 09/04/99
|
||||
// RCS-ID: $Id: wxprintf.h 70796 2012-03-04 00:29:31Z VZ $
|
||||
// Copyright: (c) wxWidgets copyright
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@ -22,11 +21,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if defined(__MWERKS__) && __MSL__ >= 0x6000
|
||||
namespace std {}
|
||||
using namespace std ;
|
||||
#endif
|
||||
|
||||
// prefer snprintf over sprintf
|
||||
#if defined(__VISUALC__) || \
|
||||
(defined(__BORLANDC__) && __BORLANDC__ >= 0x540)
|
||||
|
Reference in New Issue
Block a user