mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
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
This commit is contained in:
149
Externals/wxWidgets3/include/wx/zstream.h
vendored
Normal file
149
Externals/wxWidgets3/include/wx/zstream.h
vendored
Normal file
@ -0,0 +1,149 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/zstream.h
|
||||
// Purpose: Memory stream classes
|
||||
// Author: Guilhem Lavaux
|
||||
// Modified by: Mike Wetherell
|
||||
// Created: 11/07/98
|
||||
// RCS-ID: $Id: zstream.h 66259 2010-11-25 00:53:44Z VZ $
|
||||
// Copyright: (c) Guilhem Lavaux
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _WX_WXZSTREAM_H__
|
||||
#define _WX_WXZSTREAM_H__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ZLIB && wxUSE_STREAMS
|
||||
|
||||
#include "wx/stream.h"
|
||||
#include "wx/versioninfo.h"
|
||||
|
||||
// Compression level
|
||||
enum wxZlibCompressionLevels {
|
||||
wxZ_DEFAULT_COMPRESSION = -1,
|
||||
wxZ_NO_COMPRESSION = 0,
|
||||
wxZ_BEST_SPEED = 1,
|
||||
wxZ_BEST_COMPRESSION = 9
|
||||
};
|
||||
|
||||
// Flags
|
||||
enum wxZLibFlags {
|
||||
wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum
|
||||
wxZLIB_ZLIB = 1, // zlib header and checksum
|
||||
wxZLIB_GZIP = 2, // gzip header and checksum, requires zlib 1.2.1+
|
||||
wxZLIB_AUTO = 3 // autodetect header zlib or gzip
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_BASE wxZlibInputStream: public wxFilterInputStream {
|
||||
public:
|
||||
wxZlibInputStream(wxInputStream& stream, int flags = wxZLIB_AUTO);
|
||||
wxZlibInputStream(wxInputStream *stream, int flags = wxZLIB_AUTO);
|
||||
virtual ~wxZlibInputStream();
|
||||
|
||||
char Peek() { return wxInputStream::Peek(); }
|
||||
wxFileOffset GetLength() const { return wxInputStream::GetLength(); }
|
||||
|
||||
static bool CanHandleGZip();
|
||||
|
||||
bool SetDictionary(const char *data, const size_t datalen);
|
||||
bool SetDictionary(const wxMemoryBuffer &buf);
|
||||
|
||||
protected:
|
||||
size_t OnSysRead(void *buffer, size_t size);
|
||||
wxFileOffset OnSysTell() const { return m_pos; }
|
||||
|
||||
private:
|
||||
void Init(int flags);
|
||||
|
||||
protected:
|
||||
size_t m_z_size;
|
||||
unsigned char *m_z_buffer;
|
||||
struct z_stream_s *m_inflate;
|
||||
wxFileOffset m_pos;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxZlibInputStream);
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_BASE wxZlibOutputStream: public wxFilterOutputStream {
|
||||
public:
|
||||
wxZlibOutputStream(wxOutputStream& stream, int level = -1, int flags = wxZLIB_ZLIB);
|
||||
wxZlibOutputStream(wxOutputStream *stream, int level = -1, int flags = wxZLIB_ZLIB);
|
||||
virtual ~wxZlibOutputStream() { Close(); }
|
||||
|
||||
void Sync() { DoFlush(false); }
|
||||
bool Close();
|
||||
wxFileOffset GetLength() const { return m_pos; }
|
||||
|
||||
static bool CanHandleGZip();
|
||||
|
||||
bool SetDictionary(const char *data, const size_t datalen);
|
||||
bool SetDictionary(const wxMemoryBuffer &buf);
|
||||
|
||||
protected:
|
||||
size_t OnSysWrite(const void *buffer, size_t size);
|
||||
wxFileOffset OnSysTell() const { return m_pos; }
|
||||
|
||||
virtual void DoFlush(bool final);
|
||||
|
||||
private:
|
||||
void Init(int level, int flags);
|
||||
|
||||
protected:
|
||||
size_t m_z_size;
|
||||
unsigned char *m_z_buffer;
|
||||
struct z_stream_s *m_deflate;
|
||||
wxFileOffset m_pos;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxZlibOutputStream);
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_BASE wxZlibClassFactory: public wxFilterClassFactory
|
||||
{
|
||||
public:
|
||||
wxZlibClassFactory();
|
||||
|
||||
wxFilterInputStream *NewStream(wxInputStream& stream) const
|
||||
{ return new wxZlibInputStream(stream); }
|
||||
wxFilterOutputStream *NewStream(wxOutputStream& stream) const
|
||||
{ return new wxZlibOutputStream(stream, -1); }
|
||||
wxFilterInputStream *NewStream(wxInputStream *stream) const
|
||||
{ return new wxZlibInputStream(stream); }
|
||||
wxFilterOutputStream *NewStream(wxOutputStream *stream) const
|
||||
{ return new wxZlibOutputStream(stream, -1); }
|
||||
|
||||
const wxChar * const *GetProtocols(wxStreamProtocolType type
|
||||
= wxSTREAM_PROTOCOL) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxZlibClassFactory)
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_BASE wxGzipClassFactory: public wxFilterClassFactory
|
||||
{
|
||||
public:
|
||||
wxGzipClassFactory();
|
||||
|
||||
wxFilterInputStream *NewStream(wxInputStream& stream) const
|
||||
{ return new wxZlibInputStream(stream); }
|
||||
wxFilterOutputStream *NewStream(wxOutputStream& stream) const
|
||||
{ return new wxZlibOutputStream(stream, -1); }
|
||||
wxFilterInputStream *NewStream(wxInputStream *stream) const
|
||||
{ return new wxZlibInputStream(stream); }
|
||||
wxFilterOutputStream *NewStream(wxOutputStream *stream) const
|
||||
{ return new wxZlibOutputStream(stream, -1); }
|
||||
|
||||
const wxChar * const *GetProtocols(wxStreamProtocolType type
|
||||
= wxSTREAM_PROTOCOL) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGzipClassFactory)
|
||||
};
|
||||
|
||||
WXDLLIMPEXP_BASE wxVersionInfo wxGetZlibVersionInfo();
|
||||
|
||||
#endif
|
||||
// wxUSE_ZLIB && wxUSE_STREAMS
|
||||
|
||||
#endif
|
||||
// _WX_WXZSTREAM_H__
|
||||
|
Reference in New Issue
Block a user