From ba6c691c221efd9ddac6837c425675d3a86ea892 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Oct 2021 16:01:34 +0100 Subject: [PATCH] Add wxBitmapBundle::FromImpl() and GetImpl() For now they're only used internally but at least the latter will be made public later. --- include/wx/bmpbndl.h | 5 +++++ src/common/bmpbndl.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/include/wx/bmpbndl.h b/include/wx/bmpbndl.h index ef2e8dde2d..924b99bcf5 100644 --- a/include/wx/bmpbndl.h +++ b/include/wx/bmpbndl.h @@ -63,6 +63,8 @@ public: // form name_2x or name@2x (and also using other factors) will be used. static wxBitmapBundle FromResources(const wxString& name); + // Create from existing implementation + static wxBitmapBundle FromImpl(wxBitmapBundleImpl* impl); // Check if bitmap bundle is non-empty. bool IsOk() const { return m_impl; } @@ -77,6 +79,9 @@ public: // If size == wxDefaultSize, GetDefaultSize() is used for it instead. wxBitmap GetBitmap(const wxSize size) const; + // Access implementation + wxBitmapBundleImpl* GetImpl() const { return m_impl.get(); } + private: typedef wxObjectDataPtr wxBitmapBundleImplPtr; diff --git a/src/common/bmpbndl.cpp b/src/common/bmpbndl.cpp index 2e926f352c..709fca8009 100644 --- a/src/common/bmpbndl.cpp +++ b/src/common/bmpbndl.cpp @@ -244,6 +244,13 @@ wxBitmapBundle wxBitmapBundle::FromBitmaps(const wxVector& bitmaps) return wxBitmapBundle(new wxBitmapBundleImplSet(bitmaps)); } +/* static */ +wxBitmapBundle wxBitmapBundle::FromImpl(wxBitmapBundleImpl* impl) +{ + return wxBitmapBundle(impl); +} + + // MSW has its own, actually working, version, in MSW-specific code. #ifndef __WXMSW__