#ifndef _WX_IMAGE_H_
#define _WX_IMAGE_H_
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "image.h"
#endif
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdicmn.h"
-#include "wx/bitmap.h"
+#if WXWIN_COMPATIBILITY_2_2
+# include "wx/bitmap.h"
+#endif
#include "wx/hashmap.h"
#if wxUSE_STREAMS
class WXDLLEXPORT wxImageHandler;
class WXDLLEXPORT wxImage;
+class WXDLLEXPORT wxPalette;
//-----------------------------------------------------------------------------
// wxImageHandler
class WXDLLEXPORT wxImageHandler: public wxObject
{
public:
- wxImageHandler() { m_name = ""; m_extension = ""; m_type = 0; }
+ wxImageHandler()
+ : m_name(wxT("")), m_extension(wxT("")), m_mime(), m_type(0)
+ { }
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual int GetImageCount( wxInputStream& stream );
- bool CanRead( wxInputStream& stream ) { return DoCanRead(stream); }
+ bool CanRead( wxInputStream& stream ) { return CallDoCanRead(stream); }
bool CanRead( const wxString& name );
#endif // wxUSE_STREAMS
protected:
#if wxUSE_STREAMS
virtual bool DoCanRead( wxInputStream& stream ) = 0;
+
+ // save the stream position, call DoCanRead() and restore the position
+ bool CallDoCanRead(wxInputStream& stream);
#endif // wxUSE_STREAMS
wxString m_name;
wxImage( const wxImage* image );
#if WXWIN_COMPATIBILITY_2_2 && wxUSE_GUI
- // convertion to/from wxBitmap (deprecated, use wxBitmap's methods instead):
- wxImage( const wxBitmap &bitmap );
- wxBitmap ConvertToBitmap() const;
+ // conversion to/from wxBitmap (deprecated, use wxBitmap's methods instead):
+ wxDEPRECATED( wxImage(const wxBitmap &bitmap) );
+ wxDEPRECATED( wxBitmap ConvertToBitmap() const );
#ifdef __WXGTK__
wxBitmap ConvertToMonoBitmap( unsigned char red, unsigned char green, unsigned char blue ) const;
#endif
return *this;
}
- bool operator == (const wxImage& image)
+ bool operator == (const wxImage& image) const
{ return m_refData == image.m_refData; }
- bool operator != (const wxImage& image)
+ bool operator != (const wxImage& image) const
{ return m_refData != image.m_refData; }
static wxList& GetHandlers() { return sm_handlers; }