diff --git a/include/wx/bmpbndl.h b/include/wx/bmpbndl.h index dabbfa8d2d..d099fb70bc 100644 --- a/include/wx/bmpbndl.h +++ b/include/wx/bmpbndl.h @@ -45,6 +45,12 @@ public: // wxBitmapBundle. wxBitmapBundle(const wxImage& image); + // And another one from XPM data, as it's relatively common to pass it to + // various functions that take wxBitmapBundle in the existing code. It is + // not formally deprecated, but should be avoided in any new code and can + // become deprecated in the future. + wxBitmapBundle(const char* const* xpm); + // Default copy ctor and assignment operator and dtor would be ok, but need // to be defined out of line, where wxBitmapBundleImpl is fully declared. diff --git a/interface/wx/bmpbndl.h b/interface/wx/bmpbndl.h index 959919c3c4..27aea39a30 100644 --- a/interface/wx/bmpbndl.h +++ b/interface/wx/bmpbndl.h @@ -126,6 +126,18 @@ public: */ wxBitmapBundle(const wxImage& image); + /** + Conversion constructor from XPM data. + + This constructor overload exists only for compatibility with the + existing code passing XPM data (e.g. @c foo_xpm after including @c + foo.xpm) directly to the functions expecting a bitmap. Don't use it in + the new code, as it is likely to be deprecated in the future. + + @since 3.2.0 + */ + wxBitmapBundle(const char* const* xpm); + /** Copy constructor creates a copy of another bundle. */ diff --git a/src/common/bmpbndl.cpp b/src/common/bmpbndl.cpp index a15b004b65..7e9e193c97 100644 --- a/src/common/bmpbndl.cpp +++ b/src/common/bmpbndl.cpp @@ -358,6 +358,11 @@ wxBitmapBundle::wxBitmapBundle(const wxImage& image) { } +wxBitmapBundle::wxBitmapBundle(const char* const* xpm) + : m_impl(new wxBitmapBundleImplSet(wxBitmap(xpm))) +{ +} + wxBitmapBundle::wxBitmapBundle(const wxBitmapBundle& other) : m_impl(other.m_impl) {