From 7872b9fd380f5c1f00684e3500e5194d1b28357b Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 23 Sep 2018 20:02:21 -0700 Subject: [PATCH] Deprecate Set{Height,Width,Depth} for other platforms as well Fixes GTK build with --disable-compat30 See https://github.com/wxWidgets/wxWidgets/pull/925 --- include/wx/dfb/bitmap.h | 8 +++++--- include/wx/gtk/bitmap.h | 8 +++++--- include/wx/qt/bitmap.h | 8 +++++--- include/wx/x11/bitmap.h | 8 +++++--- src/dfb/bitmap.cpp | 2 ++ src/gtk/bitmap.cpp | 2 ++ src/qt/bitmap.cpp | 5 ++--- src/x11/bitmap.cpp | 2 ++ 8 files changed, 28 insertions(+), 15 deletions(-) diff --git a/include/wx/dfb/bitmap.h b/include/wx/dfb/bitmap.h index 4d718fabbc..ed2976d68f 100644 --- a/include/wx/dfb/bitmap.h +++ b/include/wx/dfb/bitmap.h @@ -75,9 +75,11 @@ public: bool HasAlpha() const; // implementation: - virtual void SetHeight(int height); - virtual void SetWidth(int width); - virtual void SetDepth(int depth); +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED(virtual void SetHeight(int height)); + wxDEPRECATED(virtual void SetWidth(int width)); + wxDEPRECATED(virtual void SetDepth(int depth)); +#endif // get underlying native representation: wxIDirectFBSurfacePtr GetDirectFBSurface() const; diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index ea54328dcf..714fbf3a61 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -126,9 +126,11 @@ public: // implementation // -------------- - void SetHeight( int height ) wxOVERRIDE; - void SetWidth( int width ) wxOVERRIDE; - void SetDepth( int depth ) wxOVERRIDE; +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED(void SetHeight( int height ) wxOVERRIDE); + wxDEPRECATED(void SetWidth( int width ) wxOVERRIDE); + wxDEPRECATED(void SetDepth( int depth ) wxOVERRIDE); +#endif #ifdef __WXGTK3__ GdkPixbuf* GetPixbufNoMask() const; diff --git a/include/wx/qt/bitmap.h b/include/wx/qt/bitmap.h index b04c0b2c1d..e03883ca3f 100644 --- a/include/wx/qt/bitmap.h +++ b/include/wx/qt/bitmap.h @@ -66,9 +66,11 @@ public: virtual bool CopyFromIcon(const wxIcon& icon); // implementation: - virtual void SetHeight(int height); - virtual void SetWidth(int width); - virtual void SetDepth(int depth); +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED(virtual void SetHeight(int height)); + wxDEPRECATED(virtual void SetWidth(int width)); + wxDEPRECATED(virtual void SetDepth(int depth)); +#endif void *GetRawData(wxPixelDataBase& data, int bpp); void UngetRawData(wxPixelDataBase& data); diff --git a/include/wx/x11/bitmap.h b/include/wx/x11/bitmap.h index c5cc209a3a..b188a5b140 100644 --- a/include/wx/x11/bitmap.h +++ b/include/wx/x11/bitmap.h @@ -124,9 +124,11 @@ public: // implementation // -------------- - void SetHeight( int height ); - void SetWidth( int width ); - void SetDepth( int depth ); +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED(void SetHeight( int height )); + wxDEPRECATED(void SetWidth( int width )); + wxDEPRECATED(void SetDepth( int depth )); +#endif void SetPixmap( WXPixmap pixmap ); void SetBitmap( WXPixmap bitmap ); diff --git a/src/dfb/bitmap.cpp b/src/dfb/bitmap.cpp index 913587aa4f..8954e384b2 100644 --- a/src/dfb/bitmap.cpp +++ b/src/dfb/bitmap.cpp @@ -703,6 +703,7 @@ void wxBitmap::SetPalette(const wxPalette& palette) } #endif // wxUSE_PALETTE +#if WXWIN_COMPATIBILITY_3_0 void wxBitmap::SetHeight(int height) { AllocExclusive(); @@ -737,6 +738,7 @@ void wxBitmap::SetDepth(int depth) M_BITMAP->m_surface = s; } +#endif // WXWIN_COMPATIBILITY_3_0 wxIDirectFBSurfacePtr wxBitmap::GetDirectFBSurface() const { diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 0d45b88619..40f04c0b3c 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -1139,6 +1139,7 @@ void wxBitmap::SetPalette(const wxPalette& WXUNUSED(palette)) } #endif // wxUSE_PALETTE +#if WXWIN_COMPATIBILITY_3_0 void wxBitmap::SetHeight( int height ) { AllocExclusive(); @@ -1156,6 +1157,7 @@ void wxBitmap::SetDepth( int depth ) AllocExclusive(); M_BMPDATA->m_bpp = depth; } +#endif #ifndef __WXGTK3__ void wxBitmap::SetPixmap( GdkPixmap *pixmap ) diff --git a/src/qt/bitmap.cpp b/src/qt/bitmap.cpp index bcbde2ea5e..6f632a1931 100644 --- a/src/qt/bitmap.cpp +++ b/src/qt/bitmap.cpp @@ -386,8 +386,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) return IsOk(); } - -// implementation: +#if WXWIN_COMPATIBILITY_3_0 void wxBitmap::SetHeight(int height) { M_PIXDATA = QPixmap(GetWidth(), height); @@ -405,7 +404,7 @@ void wxBitmap::SetDepth(int depth) else M_PIXDATA = QPixmap(GetWidth(), GetHeight()); } - +#endif void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) { diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 550506fe01..99020ed1a7 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -1109,6 +1109,7 @@ wxPalette *wxBitmap::GetPalette() const return M_BMPDATA->m_palette; } +#if WXWIN_COMPATIBILITY_3_0 void wxBitmap::SetHeight( int height ) { AllocExclusive(); @@ -1129,6 +1130,7 @@ void wxBitmap::SetDepth( int depth ) M_BMPDATA->m_bpp = depth; } +#endif void wxBitmap::SetPixmap( WXPixmap pixmap ) {