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

83 lines
2.6 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/private/fileback.h
// Purpose: Back an input stream with memory or a file
// Author: Mike Wetherell
// Copyright: (c) 2006 Mike Wetherell
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEBACK_H__
#define _WX_FILEBACK_H__
#include "wx/defs.h"
#if wxUSE_FILESYSTEM
#include "wx/stream.h"
// ----------------------------------------------------------------------------
// Backs an input stream with memory or a file to make it seekable.
//
// One or more wxBackedInputStreams can be used to read it's data. The data is
// reference counted, so stays alive until the last wxBackingFile or
// wxBackedInputStream using it is destroyed.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxBackingFile
{
public:
enum { DefaultBufSize = 16384 };
// Takes ownership of stream. If the stream is smaller than bufsize, the
// backing file is never created and the backing is done with memory.
wxBackingFile(wxInputStream *stream,
size_t bufsize = DefaultBufSize,
const wxString& prefix = wxT("wxbf"));
wxBackingFile() : m_impl(NULL) { }
~wxBackingFile();
wxBackingFile(const wxBackingFile& backer);
wxBackingFile& operator=(const wxBackingFile& backer);
operator bool() const { return m_impl != NULL; }
private:
class wxBackingFileImpl *m_impl;
friend class wxBackedInputStream;
};
// ----------------------------------------------------------------------------
// An input stream to read from a wxBackingFile.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxBackedInputStream : public wxInputStream
{
public:
wxBackedInputStream(const wxBackingFile& backer);
// If the length of the backer's parent stream is unknown then GetLength()
// returns wxInvalidOffset until the parent has been read to the end.
wxFileOffset GetLength() const wxOVERRIDE;
// Returns the length, reading the parent stream to the end if necessary.
wxFileOffset FindLength() const;
bool IsSeekable() const wxOVERRIDE { return true; }
protected:
size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE;
private:
wxBackingFile m_backer;
wxFileOffset m_pos;
wxDECLARE_NO_COPY_CLASS(wxBackedInputStream);
};
#endif // wxUSE_FILESYSTEM
#endif // _WX_FILEBACK_H__