+
+// ----------------------------------------------------------------------------
+// raw bitmap access support
+// ----------------------------------------------------------------------------
+
+void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
+{
+ if ( !Ok() )
+ {
+ // no bitmap, no data (raw or otherwise)
+ return NULL;
+ }
+
+ if ( M_BITMAPDATA->m_bitmapType != kMacBitmapTypeGrafWorld )
+ {
+ wxFAIL_MSG( _T("GetRawData() only supported for GWorlds") );
+
+ return NULL;
+ }
+
+ GWorldPtr gworld = MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap);
+ PixMapHandle hPixMap = GetGWorldPixMap(gworld);
+ wxCHECK_MSG( hPixMap, NULL, _T("failed to get PixMap from GWorld?") );
+
+ if ( (*hPixMap)->pixelSize != bpp )
+ {
+ wxFAIL_MSG( _T("bpp mismatch in GetRawData()") );
+
+ return NULL;
+ }
+
+ if ( !LockPixels(hPixMap) )
+ {
+ wxFAIL_MSG( _T("failed to lock PixMap in GetRawData()") );
+
+ return NULL;
+ }
+
+ data.m_width = GetWidth();
+ data.m_height = GetHeight();
+ data.m_stride = (*hPixMap)->rowBytes & 0x7fff;
+
+ return GetPixBaseAddr(hPixMap);
+}
+
+void wxBitmap::UngetRawData(wxPixelDataBase& data)
+{
+ if ( !Ok() )
+ return;
+
+ GWorldPtr gworld = MAC_WXHBITMAP(M_BITMAPDATA->m_hBitmap);
+ PixMapHandle hPixMap = GetGWorldPixMap(gworld);
+ if ( hPixMap )
+ UnlockPixels(hPixMap);
+}
+
+void wxBitmap::UseAlpha()
+{
+ // nothing to do here so far
+}
+