X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1699cd397f7db0193491c8498608578b43db12b..5fd588d2298a44428ac66bef1e4d9fc73e18d4fd:/include/wx/image.h diff --git a/include/wx/image.h b/include/wx/image.h index 786b76f3a2..ea439aab62 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(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 ); @@ -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; @@ -116,7 +121,7 @@ public: wxImage( const wxImage* image ); #if WXWIN_COMPATIBILITY_2_2 && wxUSE_GUI - // convertion to/from wxBitmap (deprecated, use wxBitmap's methods instead): + // conversion to/from wxBitmap (deprecated, use wxBitmap's methods instead): wxImage( const wxBitmap &bitmap ); wxBitmap ConvertToBitmap() const; #ifdef __WXGTK__ @@ -175,12 +180,6 @@ public: bool SetMaskFromImage(const wxImage & mask, unsigned char mr, unsigned char mg, unsigned char mb); - void DoFloodFill (wxCoord x, wxCoord y, - const wxBrush & fillBrush, - const wxColour& testColour, - int style = wxFLOOD_SURFACE, - int LogicalFunction = wxCOPY /* currently unused */ ) ; - static bool CanRead( const wxString& name ); static int GetImageCount( const wxString& name, long type = wxBITMAP_TYPE_ANY ); virtual bool LoadFile( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 ); @@ -249,9 +248,9 @@ public: 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; } @@ -270,10 +269,6 @@ protected: static wxList sm_handlers; private: - //these two are called by FloodFill - bool MatchPixel(int x, int y, int w, int h, const wxColour & c) ; - bool MatchBoundaryPixel(int x, int y, int w, int h, const wxColour & fill, const wxColour & bound) ; - friend class WXDLLEXPORT wxImageHandler; DECLARE_DYNAMIC_CLASS(wxImage)