X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd94e8aa4563b22e7c66c379625a8373d20720aa..6ba7c06eeeda47b88783025428ca0f290e3bf236:/include/wx/image.h?ds=inline diff --git a/include/wx/image.h b/include/wx/image.h index cf69aa743a..6d025c286b 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -10,7 +10,7 @@ #ifndef _WX_IMAGE_H_ #define _WX_IMAGE_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "image.h" #endif @@ -43,7 +43,9 @@ class WXDLLEXPORT wxImage; class WXDLLEXPORT wxImageHandler: public wxObject { public: - wxImageHandler() { m_name = ""; m_extension = ""; m_type = 0; } + wxImageHandler() + : m_name(""), m_extension(""), m_mime(), m_type(0) + { } #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 ); @@ -51,7 +53,7 @@ public: 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 @@ -67,6 +69,9 @@ public: 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; @@ -115,7 +120,7 @@ public: wxImage( const wxImage& image ); wxImage( const wxImage* image ); -#if wxUSE_GUI +#if WXWIN_COMPATIBILITY_2_2 && wxUSE_GUI // convertion to/from wxBitmap (deprecated, use wxBitmap's methods instead): wxImage( const wxBitmap &bitmap ); wxBitmap ConvertToBitmap() const; @@ -187,6 +192,7 @@ public: virtual bool LoadFile( wxInputStream& stream, const wxString& mimetype, int index = -1 ); #endif + virtual bool SaveFile( const wxString& name ) const; virtual bool SaveFile( const wxString& name, int type ) const; virtual bool SaveFile( const wxString& name, const wxString& mimetype ) const;