X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e838cc14684f8dfd4ede39e4649e04a5bd79d149..f1d93f0beeec9d88f8a225aa35a9ccc163dcdb15:/src/motif/bitmap.cpp diff --git a/src/motif/bitmap.cpp b/src/motif/bitmap.cpp index 077f20cd3b..524d851c60 100644 --- a/src/motif/bitmap.cpp +++ b/src/motif/bitmap.cpp @@ -13,6 +13,10 @@ #pragma implementation "bitmap.h" #endif +#ifdef __VMS +#define XtParent XTPARENT +#endif + #include "wx/setup.h" #include "wx/utils.h" #include "wx/palette.h" @@ -108,6 +112,8 @@ wxBitmapRefData::~wxBitmapRefData() wxList wxBitmap::sm_handlers; +#define M_BMPDATA ((wxBitmapRefData *)m_refData) + wxBitmap::wxBitmap() { m_refData = NULL; @@ -308,6 +314,20 @@ void wxBitmap::SetMask(wxMask *mask) M_BITMAPDATA->m_bitmapMask = mask ; } +wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const +{ + wxCHECK_MSG( Ok() && + (rect.x >= 0) && (rect.y >= 0) && + (rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height), + wxNullBitmap, wxT("invalid bitmap or bitmap region") ); + + wxBitmap ret( rect.width, rect.height, 0 ); + wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); + + // The remaining still TODO + return ret; +} + void wxBitmap::AddHandler(wxBitmapHandler *handler) { sm_handlers.Append(handler);