image handlers moved to separate headers (imagbmp.h etc.) This change is backward compatible (all hdrs #included in image.h) and reduces executable size under GCC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
1999-12-15 22:38:02 +00:00
parent 1dbe87089b
commit 8f49300284
14 changed files with 388 additions and 239 deletions

46
include/wx/imagbmp.h Normal file
View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagbmp.h
// Purpose: wxImage BMP handler
// Author: Robert Roebling
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGBMP_H_
#define _WX_IMAGBMP_H_
#ifdef __GNUG__
#pragma interface "imagbmp.h"
#endif
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxBMPHandler
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxBMPHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxBMPHandler)
public:
inline wxBMPHandler()
{
m_name = "BMP file";
m_extension = "bmp";
m_type = wxBITMAP_TYPE_BMP;
m_mime = "image/bmp";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
// _WX_IMAGBMP_H_

View File

@@ -29,25 +29,6 @@
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxImageHandler;
#if wxUSE_LIBPNG
class WXDLLEXPORT wxPNGHandler;
#endif
#if wxUSE_LIBJPEG
class WXDLLEXPORT wxJPEGHandler;
#endif
#if wxUSE_LIBTIFF
class WXDLLEXPORT wxTIFFHandler;
#endif
class WXDLLEXPORT wxBMPHandler;
#if wxUSE_GIF
class WXDLLEXPORT wxGIFHandler;
#endif
#if wxUSE_PNM
class WXDLLEXPORT wxPNMHandler;
#endif
#if wxUSE_PCX
class WXDLLEXPORT wxPCXHandler;
#endif
class WXDLLEXPORT wxImage;
//-----------------------------------------------------------------------------
@@ -90,193 +71,7 @@ protected:
};
//-----------------------------------------------------------------------------
// wxPNGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBPNG
class WXDLLEXPORT wxPNGHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPNGHandler)
public:
inline wxPNGHandler()
{
m_name = "PNG file";
m_extension = "png";
m_type = wxBITMAP_TYPE_PNG;
m_mime = "image/png";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
//-----------------------------------------------------------------------------
// wxJPEGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBJPEG
class WXDLLEXPORT wxJPEGHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxJPEGHandler)
public:
inline wxJPEGHandler()
{
m_name = "JPEG file";
m_extension = "jpg";
m_type = wxBITMAP_TYPE_JPEG;
m_mime = "image/jpeg";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
//-----------------------------------------------------------------------------
// wxTIFFHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBTIFF
class WXDLLEXPORT wxTIFFHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxTIFFHandler)
public:
inline wxTIFFHandler()
{
m_name = "TIFF file";
m_extension = "tif";
m_type = wxBITMAP_TYPE_TIF;
m_mime = "image/tiff";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual int GetImageCount( wxInputStream& stream );
#endif
};
#endif
//-----------------------------------------------------------------------------
// wxBMPHandler
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxBMPHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxBMPHandler)
public:
inline wxBMPHandler()
{
m_name = "BMP file";
m_extension = "bmp";
m_type = wxBITMAP_TYPE_BMP;
m_mime = "image/bmp";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
//-----------------------------------------------------------------------------
// wxGIFHandler
//-----------------------------------------------------------------------------
#if wxUSE_GIF
class WXDLLEXPORT wxGIFHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxGIFHandler)
public:
inline wxGIFHandler()
{
m_name = "GIF file";
m_extension = "gif";
m_type = wxBITMAP_TYPE_GIF;
m_mime = "image/gif";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
//-----------------------------------------------------------------------------
// wxPNMHandler
//-----------------------------------------------------------------------------
#if wxUSE_PNM
class WXDLLEXPORT wxPNMHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPNMHandler)
public:
inline wxPNMHandler()
{
m_name = "PNM file";
m_extension = "pnm";
m_type = wxBITMAP_TYPE_PNM;
m_mime = "image/pnm";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
//-----------------------------------------------------------------------------
// wxPCXHandler
//-----------------------------------------------------------------------------
#if wxUSE_PCX
class WXDLLEXPORT wxPCXHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPCXHandler)
public:
inline wxPCXHandler()
{
m_name = "PCX file";
m_extension = "pcx";
m_type = wxBITMAP_TYPE_PCX;
m_mime = "image/pcx";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif // wxUSE_STREAMS
};
#endif // wxUSE_PCX
//-----------------------------------------------------------------------------
// wxImage
@@ -400,8 +195,22 @@ protected:
};
extern void WXDLLEXPORT wxInitAllImageHandlers();
//-----------------------------------------------------------------------------
// wxImage handlers
//-----------------------------------------------------------------------------
#include "wx/imagbmp.h"
#include "wx/imagpng.h"
#include "wx/imaggif.h"
#include "wx/imagpcx.h"
#include "wx/imagjpeg.h"
#include "wx/imagtiff.h"
#include "wx/imagpnm.h"
#endif
// _WX_IMAGE_H_

51
include/wx/imaggif.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imaggif.h
// Purpose: wxImage GIF handler
// Author: Vaclav Slavik & Guillermo Rodriguez Garcia
// RCS-ID: $Id$
// Copyright: (c) Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGGIF_H_
#define _WX_IMAGGIF_H_
#ifdef __GNUG__
#pragma interface "imaggif.h"
#endif
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxGIFHandler
//-----------------------------------------------------------------------------
#if wxUSE_GIF
class WXDLLEXPORT wxGIFHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxGIFHandler)
public:
inline wxGIFHandler()
{
m_name = "GIF file";
m_extension = "gif";
m_type = wxBITMAP_TYPE_GIF;
m_mime = "image/gif";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
#endif
// _WX_IMAGGIF_H_

50
include/wx/imagjpeg.h Normal file
View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagjpeg.h
// Purpose: wxImage JPEG handler
// Author: Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGJPEG_H_
#define _WX_IMAGJPEG_H_
#ifdef __GNUG__
#pragma interface "imagjpeg.h"
#endif
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxJPEGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBJPEG
class WXDLLEXPORT wxJPEGHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxJPEGHandler)
public:
inline wxJPEGHandler()
{
m_name = "JPEG file";
m_extension = "jpg";
m_type = wxBITMAP_TYPE_JPEG;
m_mime = "image/jpeg";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
#endif
// _WX_IMAGJPEG_H_

50
include/wx/imagpcx.h Normal file
View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagpcx.h
// Purpose: wxImage PCX handler
// Author: Guillermo Rodriguez Garcia <guille@iies.es>
// RCS-ID: $Id$
// Copyright: (c) 1999 Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPCX_H_
#define _WX_IMAGPCX_H_
#ifdef __GNUG__
#pragma interface "imagpcx.h"
#endif
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxPCXHandler
//-----------------------------------------------------------------------------
#if wxUSE_PCX
class WXDLLEXPORT wxPCXHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPCXHandler)
public:
inline wxPCXHandler()
{
m_name = "PCX file";
m_extension = "pcx";
m_type = wxBITMAP_TYPE_PCX;
m_mime = "image/pcx";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif // wxUSE_STREAMS
};
#endif // wxUSE_PCX
#endif
// _WX_IMAGPCX_H_

49
include/wx/imagpng.h Normal file
View File

@@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagpng.h
// Purpose: wxImage PNG handler
// Author: Robert Roebling
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPNG_H_
#define _WX_IMAGPNG_H_
#ifdef __GNUG__
#pragma interface "imagpng.h"
#endif
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxPNGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBPNG
class WXDLLEXPORT wxPNGHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPNGHandler)
public:
inline wxPNGHandler()
{
m_name = "PNG file";
m_extension = "png";
m_type = wxBITMAP_TYPE_PNG;
m_mime = "image/png";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
#endif
// _WX_IMAGPNG_H_

49
include/wx/imagpnm.h Normal file
View File

@@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagpnm.h
// Purpose: wxImage PNM handler
// Author: Sylvain Bougnoux
// RCS-ID: $Id$
// Copyright: (c) Sylvain Bougnoux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPNM_H_
#define _WX_IMAGPNM_H_
#ifdef __GNUG__
#pragma interface "imagpnm.h"
#endif
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxPNMHandler
//-----------------------------------------------------------------------------
#if wxUSE_PNM
class WXDLLEXPORT wxPNMHandler : public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxPNMHandler)
public:
inline wxPNMHandler()
{
m_name = "PNM file";
m_extension = "pnm";
m_type = wxBITMAP_TYPE_PNM;
m_mime = "image/pnm";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
#endif
};
#endif
#endif
// _WX_IMAGPNM_H_

51
include/wx/imagtiff.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagtiff.h
// Purpose: wxImage TIFF handler
// Author: Robert Roebling
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGTIFF_H_
#define _WX_IMAGTIFF_H_
#ifdef __GNUG__
#pragma interface "imagtiff.h"
#endif
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxTIFFHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBTIFF
class WXDLLEXPORT wxTIFFHandler: public wxImageHandler
{
DECLARE_DYNAMIC_CLASS(wxTIFFHandler)
public:
inline wxTIFFHandler()
{
m_name = "TIFF file";
m_extension = "tif";
m_type = wxBITMAP_TYPE_TIF;
m_mime = "image/tiff";
};
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=0 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool DoCanRead( wxInputStream& stream );
virtual int GetImageCount( wxInputStream& stream );
#endif
};
#endif
#endif
// _WX_IMAGTIFF_H_

View File

@@ -7,10 +7,9 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
We don't put pragma implement in this file because it is already present in
src/common/image.cpp
*/
#ifdef __GNUG__
#pragma implementation "imagbmp.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@ -19,7 +18,7 @@
#pragma hdrstop
#endif
#include "wx/image.h"
#include "wx/imagbmp.h"
#include "wx/bitmap.h"
#include "wx/debug.h"
#include "wx/log.h"

View File

@@ -7,10 +7,9 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
We don't put pragma implement in this file because it is already present in
src/common/image.cpp
*/
#ifdef __GNUG__
#pragma implementation "imaggif.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@ -25,7 +24,7 @@
#if wxUSE_GIF
#include "wx/image.h"
#include "wx/imaggif.h"
#include "wx/gifdecod.h"
#include "wx/wfstream.h"
#include "wx/log.h"

View File

@@ -8,10 +8,9 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
We don't put pragma implement in this file because it is already present in
src/common/image.cpp
*/
#ifdef __GNUG__
#pragma implementation "imagpcx.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@ -26,7 +25,7 @@
#if wxUSE_STREAMS && wxUSE_PCX
#include "wx/image.h"
#include "wx/imagpcx.h"
#include "wx/wfstream.h"
#include "wx/module.h"
#include "wx/log.h"

View File

@@ -7,10 +7,9 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
We don't put pragma implement in this file because it is already present in
src/common/image.cpp
*/
#ifdef __GNUG__
#pragma implementation "imagpng.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@ -25,7 +24,7 @@
#if wxUSE_LIBPNG
#include "wx/image.h"
#include "wx/imagpng.h"
#include "wx/bitmap.h"
#include "wx/debug.h"
#include "wx/log.h"

View File

@@ -7,10 +7,9 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
We don't put pragma implement in this file because it is already present in
src/common/image.cpp
*/
#ifdef __GNUG__
#pragma implementation "imagpnm.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@ -25,7 +24,7 @@
#if wxUSE_PNM
#include "wx/image.h"
#include "wx/imagpnm.h"
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/txtstrm.h"

View File

@@ -1,16 +1,15 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagjpeg.cpp
// Purpose: wxImage JPEG handler
// Author: Vaclav Slavik
// Name: imagtiff.cpp
// Purpose: wxImage TIFF handler
// Author: Robert Roebling
// RCS-ID: $Id$
// Copyright: (c) Vaclav Slavik
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
We don't put pragma implement in this file because it is already present in
src/common/image.cpp
*/
#ifdef __GNUG__
#pragma implementation "imagtiff.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@ -23,7 +22,7 @@
#if wxUSE_LIBTIFF
#include "wx/image.h"
#include "wx/imagtiff.h"
#include "wx/bitmap.h"
#include "wx/debug.h"
#include "wx/log.h"