EmptyChaos 822326eea9 Update wxWidgets to 3.1.0
From wxWidgets master 81570ae070b35c9d52de47b1f14897f3ff1a66c7.

include/wx/defs.h -- __w64 warning disable patch by comex brought forward.

include/wx/msw/window.h -- added GetContentScaleFactor() which was not implemented on Windows but is necessary for wxBitmap scaling on Mac OS X so it needs to work to avoid #ifdef-ing the code.

src/gtk/window.cpp -- Modified DoSetClientSize() to direct call wxWindowGTK::DoSetSize() instead of using public wxWindowBase::SetSize() which now prevents derived classes (like wxAuiToolbar) intercepting the call and breaking it. This matches Windows which does NOT need to call DoSetSize internally. End result is this fixes Dolphin's debug tools toolbars on Linux.

src/osx/window_osx.cpp -- Same fix as for GTK since it has the same issue.

src/msw/radiobox.cpp -- Hacked to fix display in HiDPI (was clipping off end of text).

Updated CMakeLists for Linux and Mac OS X. Small code changes to Dolphin to fix debug error boxes, deprecation warnings, and retain previous UI behavior on Windows.
2016-06-26 15:25:29 +10:00

123 lines
4.4 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/stdstream.h
// Purpose: Header of std::istream and std::ostream derived wrappers for
// wxInputStream and wxOutputStream
// Author: Jonathan Liu <net147@gmail.com>
// Created: 2009-05-02
// Copyright: (c) 2009 Jonathan Liu
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STDSTREAM_H_
#define _WX_STDSTREAM_H_
#include "wx/defs.h" // wxUSE_STD_IOSTREAM
#if wxUSE_STREAMS && wxUSE_STD_IOSTREAM
#include "wx/defs.h"
#include "wx/stream.h"
#include "wx/ioswrap.h"
// ==========================================================================
// wxStdInputStreamBuffer
// ==========================================================================
class WXDLLIMPEXP_BASE wxStdInputStreamBuffer : public std::streambuf
{
public:
wxStdInputStreamBuffer(wxInputStream& stream);
virtual ~wxStdInputStreamBuffer() { }
protected:
virtual std::streambuf *setbuf(char *s, std::streamsize n) wxOVERRIDE;
virtual std::streampos seekoff(std::streamoff off,
std::ios_base::seekdir way,
std::ios_base::openmode which =
std::ios_base::in |
std::ios_base::out) wxOVERRIDE;
virtual std::streampos seekpos(std::streampos sp,
std::ios_base::openmode which =
std::ios_base::in |
std::ios_base::out) wxOVERRIDE;
virtual std::streamsize showmanyc() wxOVERRIDE;
virtual std::streamsize xsgetn(char *s, std::streamsize n) wxOVERRIDE;
virtual int underflow() wxOVERRIDE;
virtual int uflow() wxOVERRIDE;
virtual int pbackfail(int c = EOF) wxOVERRIDE;
// Special work around for VC8/9 (this bug was fixed in VC10 and later):
// these versions have non-standard _Xsgetn_s() that it being called from
// the stream code instead of xsgetn() and so our overridden implementation
// never actually gets used. To work around this, forward to it explicitly.
#if defined(__VISUALC8__) || defined(__VISUALC9__)
virtual std::streamsize
_Xsgetn_s(char *s, size_t WXUNUSED(size), std::streamsize n)
{
return xsgetn(s, n);
}
#endif // VC8 or VC9
wxInputStream& m_stream;
int m_lastChar;
};
// ==========================================================================
// wxStdInputStream
// ==========================================================================
class WXDLLIMPEXP_BASE wxStdInputStream : public std::istream
{
public:
wxStdInputStream(wxInputStream& stream);
virtual ~wxStdInputStream() { }
protected:
wxStdInputStreamBuffer m_streamBuffer;
};
// ==========================================================================
// wxStdOutputStreamBuffer
// ==========================================================================
class WXDLLIMPEXP_BASE wxStdOutputStreamBuffer : public std::streambuf
{
public:
wxStdOutputStreamBuffer(wxOutputStream& stream);
virtual ~wxStdOutputStreamBuffer() { }
protected:
virtual std::streambuf *setbuf(char *s, std::streamsize n) wxOVERRIDE;
virtual std::streampos seekoff(std::streamoff off,
std::ios_base::seekdir way,
std::ios_base::openmode which =
std::ios_base::in |
std::ios_base::out) wxOVERRIDE;
virtual std::streampos seekpos(std::streampos sp,
std::ios_base::openmode which =
std::ios_base::in |
std::ios_base::out) wxOVERRIDE;
virtual std::streamsize xsputn(const char *s, std::streamsize n) wxOVERRIDE;
virtual int overflow(int c) wxOVERRIDE;
wxOutputStream& m_stream;
};
// ==========================================================================
// wxStdOutputStream
// ==========================================================================
class WXDLLIMPEXP_BASE wxStdOutputStream : public std::ostream
{
public:
wxStdOutputStream(wxOutputStream& stream);
virtual ~wxStdOutputStream() { }
protected:
wxStdOutputStreamBuffer m_streamBuffer;
};
#endif // wxUSE_STREAMS && wxUSE_STD_IOSTREAM
#endif // _WX_STDSTREAM_H_