#ifndef _WX_IMAGE_H_
#define _WX_IMAGE_H_
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "image.h"
#endif
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):
+ // conversion to/from wxBitmap (deprecated, use wxBitmap's methods instead):
wxImage( const wxBitmap &bitmap );
wxBitmap ConvertToBitmap() const;
#ifdef __WXGTK__
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 );
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; }
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)