From 34b91330314493fb57bf2381f01ecace34721351 Mon Sep 17 00:00:00 2001 From: "james.k.crook@gmail.com" Date: Thu, 13 Nov 2014 21:13:11 +0000 Subject: [PATCH] Fix type problem with wxWidgets 3.0: Use enum wxRasterOperationMode instead of int. [Patch 0022] from martin@steghoefer.eu This change from the old int type to the real enum wxRasterOperationMode was missed during the fix of similar problems in r13403 (when similar fixes were applied), probably because ImageRoll and the affected variable are currently unused and the problem therefore doesn't cause a compilation error and is only fixed preventively. Compatibility with wxWidgets 2.8 is assured thanks to a conditional definition of wxRasterOperationMode as int in ImageRoll.h, introduced in r13403. --- src/widgets/ImageRoll.cpp | 4 ++-- src/widgets/ImageRoll.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/widgets/ImageRoll.cpp b/src/widgets/ImageRoll.cpp index 138b47b26..9bc6c7d3c 100644 --- a/src/widgets/ImageRoll.cpp +++ b/src/widgets/ImageRoll.cpp @@ -312,7 +312,7 @@ void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap, } } -void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc)) +void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logicalFunc)) { int width = rect.width; int height = rect.height; @@ -435,7 +435,7 @@ ImageRollPanel::ImageRollPanel(wxWindow *parent, mImageRoll.GetMaxSize()); } -void ImageRollPanel::SetLogicalFunction(int func) +void ImageRollPanel::SetLogicalFunction(wxRasterOperationMode func) { mLogicalFunction = func; } diff --git a/src/widgets/ImageRoll.h b/src/widgets/ImageRoll.h index 29dc821a7..2129b62b9 100644 --- a/src/widgets/ImageRoll.h +++ b/src/widgets/ImageRoll.h @@ -13,9 +13,11 @@ #define __AUDACITY_IMAGE_ROLL__ #include +#include #include #include #include +#include #if !wxCHECK_VERSION(3,0,0) #define wxRasterOperationMode int @@ -45,7 +47,7 @@ class ImageRoll wxSize GetMaxSize() const { return mMaxSize; } void Draw(wxDC &dc, wxRect rect, - int logicalFunc = wxCOPY); + wxRasterOperationMode logicalFunc = wxCOPY); static ImageArray SplitH(const wxImage &src, wxColour magicColor); static ImageArray SplitV(const wxImage &src, wxColour magicColor); @@ -77,7 +79,7 @@ class ImageRollPanel : public wxPanel const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL); - void SetLogicalFunction(int func); + void SetLogicalFunction(wxRasterOperationMode func); void OnPaint(wxPaintEvent &evt); void OnSize(wxSizeEvent &evt); @@ -85,7 +87,7 @@ class ImageRollPanel : public wxPanel protected: ImageRoll mImageRoll; - int mLogicalFunction; + wxRasterOperationMode mLogicalFunction; DECLARE_EVENT_TABLE();