From ef8f37e0dbfdd5b3eac3bce7ad13347c8ed450ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 25 Mar 2002 23:25:53 +0000 Subject: [PATCH] surround deprecated wxImage methods in WXWIN_COMPATIBILITY_2_2 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/image.h | 2 +- src/common/image.cpp | 43 +++++++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/include/wx/image.h b/include/wx/image.h index 55e9d96834..7522d06854 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -115,7 +115,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; diff --git a/src/common/image.cpp b/src/common/image.cpp index 9d5716221c..d4f9ddac8c 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -1298,10 +1298,10 @@ bool wxImageHandler::CanRead( const wxString& name ) //----------------------------------------------------------------------------- -// wxBitmap convertion routines +// Deprecated wxBitmap convertion routines //----------------------------------------------------------------------------- -#if wxUSE_GUI +#if WXWIN_COMPATIBILITY_2_2 && wxUSE_GUI #ifdef __WXGTK__ wxBitmap wxImage::ConvertToMonoBitmap( unsigned char red, unsigned char green, unsigned char blue ) const @@ -1323,24 +1323,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) *this = bitmap.ConvertToImage(); } -#endif - - - -// A module to allow wxImage initialization/cleanup -// without calling these functions from app.cpp or from -// the user's application. - -class wxImageModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxImageModule) -public: - wxImageModule() {} - bool OnInit() { wxImage::InitStandardHandlers(); return TRUE; }; - void OnExit() { wxImage::CleanUpHandlers(); }; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxImageModule, wxModule) +#endif // WXWIN_COMPATIBILITY_2_2 && wxUSE_GUI //----------------------------------------------------------------------------- @@ -1667,4 +1650,24 @@ wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool i return rotated; } + + + + +// A module to allow wxImage initialization/cleanup +// without calling these functions from app.cpp or from +// the user's application. + +class wxImageModule: public wxModule +{ +DECLARE_DYNAMIC_CLASS(wxImageModule) +public: + wxImageModule() {} + bool OnInit() { wxImage::InitStandardHandlers(); return TRUE; }; + void OnExit() { wxImage::CleanUpHandlers(); }; +}; + +IMPLEMENT_DYNAMIC_CLASS(wxImageModule, wxModule) + + #endif // wxUSE_IMAGE -- 2.45.2