From a29c6824c21bca8e66fdd0c7a64b65e8935bdbcd Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Mon, 7 Apr 2003 17:39:00 +0000 Subject: [PATCH] Add GetDrawable convenience function that returns m_bitmap if the wxBitmap is monochrome or m_pixmap if the wxBitmap is polichrome. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/x11/bitmap.h | 4 +++- src/x11/bitmap.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/wx/x11/bitmap.h b/include/wx/x11/bitmap.h index 9cf410f3c4..f4c69428ef 100644 --- a/include/wx/x11/bitmap.h +++ b/include/wx/x11/bitmap.h @@ -130,7 +130,9 @@ public: WXPixmap GetPixmap() const; WXPixmap GetBitmap() const; - + + WXPixmap GetDrawable() const; + WXDisplay *GetDisplay() const; protected: diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index b8c6b31ec7..b2edff7387 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -1107,6 +1107,13 @@ WXPixmap wxBitmap::GetBitmap() const return M_BMPDATA->m_bitmap; } +WXPixmap wxBitmap::GetDrawable() const +{ + wxCHECK_MSG( Ok(), (WXPixmap) NULL, wxT("invalid bitmap") ); + + return M_BMPDATA->m_bpp == 1 ? M_BMPDATA->m_bitmap : M_BMPDATA->m_pixmap; +} + WXDisplay *wxBitmap::GetDisplay() const { wxCHECK_MSG( Ok(), (WXDisplay*) NULL, wxT("invalid bitmap") ); -- 2.45.2