Fix signatures of various image handlers methods.

Use wxBitmapType instead of long for the type parameter and made SaveFile()
methods const to follow the base class changes.

Now that the signatures are the same as in the base class these handlers have
a chance to work again while their methods couldn't be called at all before
this change.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-08-20 00:44:47 +00:00
parent 4462f911b1
commit 545cb3fcf2

View File

@@ -1304,7 +1304,6 @@ int GrGetPixelColor(GR_SCREEN_INFO* sinfo, GR_PALETTE* palette, GR_PIXELVAL pixe
class wxXPMFileHandler : public wxBitmapHandler class wxXPMFileHandler : public wxBitmapHandler
{ {
DECLARE_DYNAMIC_CLASS(wxXPMFileHandler)
public: public:
wxXPMFileHandler() wxXPMFileHandler()
{ {
@@ -1313,21 +1312,31 @@ public:
SetType( wxBITMAP_TYPE_XPM ); SetType( wxBITMAP_TYPE_XPM );
}; };
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, virtual bool LoadFile(wxBitmap *bitmap, const wxString& name,
wxBitmapType flags,
int desiredWidth, int desiredHeight); int desiredWidth, int desiredHeight);
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
int type, const wxPalette *palette = NULL); wxBitmapType type,
const wxPalette *palette = NULL) const;
virtual bool Create(wxBitmap *WXUNUSED(bitmap), const void* WXUNUSED(data), long WXUNUSED(flags), virtual bool Create(wxBitmap *WXUNUSED(bitmap),
int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth) = 1) const void* WXUNUSED(data),
wxBitmapType WXUNUSED(flags),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth) = 1)
{ return false; } { return false; }
DECLARE_DYNAMIC_CLASS(wxXPMFileHandler)
}; };
IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler) IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap,
long WXUNUSED(flags), int WXUNUSED(desiredWidth), const wxString& name,
wxBitmapType WXUNUSED(flags),
int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight)) int WXUNUSED(desiredHeight))
{ {
#if wxHAVE_LIB_XPM #if wxHAVE_LIB_XPM
@@ -1394,12 +1403,14 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
#endif // wxHAVE_LIB_XPM / wxUSE_STREAMS #endif // wxHAVE_LIB_XPM / wxUSE_STREAMS
} }
bool wxXPMFileHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, bool wxXPMFileHandler::SaveFile(const wxBitmap *bitmap,
int type, const wxString& name,
const wxPalette *WXUNUSED(palette)) wxBitmapType type,
const wxPalette *WXUNUSED(palette)) const
{ {
wxImage image(bitmap->ConvertToImage()); wxImage image(bitmap->ConvertToImage());
if (image.Ok()) return image.SaveFile( name, (wxBitmapType)type ); if (image.Ok())
return image.SaveFile( name, type );
return false; return false;
} }
@@ -1431,7 +1442,7 @@ public:
virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap), virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap),
const wxString& WXUNUSED(name), const wxString& WXUNUSED(name),
wxBitmapType WXUNUSED(type), wxBitmapType WXUNUSED(type),
const wxPalette *WXUNUSED(palette) = NULL) const wxPalette *WXUNUSED(palette) = NULL) const
{ return false; } { return false; }
virtual bool Create(wxBitmap *bitmap, const void* data, wxBitmapType flags, virtual bool Create(wxBitmap *bitmap, const void* data, wxBitmapType flags,
@@ -1529,25 +1540,25 @@ public:
virtual bool LoadFile(wxBitmap *WXUNUSED(bitmap), virtual bool LoadFile(wxBitmap *WXUNUSED(bitmap),
const wxString& WXUNUSED(name), const wxString& WXUNUSED(name),
long WXUNUSED(flags), wxBitmapType WXUNUSED(flags),
int WXUNUSED(desiredWidth), int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight)) int WXUNUSED(desiredHeight))
{ return false; } { return false; }
virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap), virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap),
const wxString& WXUNUSED(name), const wxString& WXUNUSED(name),
int WXUNUSED(type), wxBitmapType WXUNUSED(type),
const wxPalette *WXUNUSED(palette) = NULL) const wxPalette *WXUNUSED(palette) = NULL) const
{ return false; } { return false; }
virtual bool Create(wxBitmap *bitmap, const void* data, long flags, virtual bool Create(wxBitmap *bitmap, const void* data, wxBitmapType type,
int width, int height, int depth = 1); int width, int height, int depth = 1);
}; };
IMPLEMENT_DYNAMIC_CLASS(wxXBMDataHandler, wxBitmapHandler) IMPLEMENT_DYNAMIC_CLASS(wxXBMDataHandler, wxBitmapHandler)
bool wxXBMDataHandler::Create( wxBitmap *bitmap, const void* bits, bool wxXBMDataHandler::Create( wxBitmap *bitmap, const void* bits,
long WXUNUSED(flags), wxBitmapType WXUNUSED(type),
int width, int height, int WXUNUSED(depth)) int width, int height, int WXUNUSED(depth))
{ {
#if !wxUSE_NANOX #if !wxUSE_NANOX