From 84b5e4639e9a0d2b0b6b3a79ddaf5792f3a45964 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 20 Jan 2022 23:19:04 +0000 Subject: [PATCH] Add wxBitmapBundle::IsSameAs() This is useful if only for compatibility with wxBitmap or wxIcon, that have the same member function with the same semantics. --- include/wx/bmpbndl.h | 5 +++++ interface/wx/bmpbndl.h | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/wx/bmpbndl.h b/include/wx/bmpbndl.h index 5b045f2113..bc511fd847 100644 --- a/include/wx/bmpbndl.h +++ b/include/wx/bmpbndl.h @@ -123,6 +123,11 @@ public: // Access implementation wxBitmapBundleImpl* GetImpl() const { return m_impl.get(); } + // Check if two objects refer to the same bundle. + bool IsSameAs(const wxBitmapBundle& other) const + { + return GetImpl() == other.GetImpl(); + } // Implementation only from now on. diff --git a/interface/wx/bmpbndl.h b/interface/wx/bmpbndl.h index 873fcd0b94..733ac23d3a 100644 --- a/interface/wx/bmpbndl.h +++ b/interface/wx/bmpbndl.h @@ -341,6 +341,16 @@ public: the returned bitmap to wxIcon. */ wxIcon GetIcon(const wxSize& size) const; + + /** + Check if the two bundles refer to the same object. + + Bundles are considered to be same only if they actually use the same + underlying object, i.e. are copies of each other. If the two bundles + were independently constructed, they're @e not considered to be the + same, even if they were created from the same bitmap. + */ + bool IsSameAs(const wxBitmapBundle& other) const; }; /**