+
+// ----------------------------------------------------------------------------
+// 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 && *hPixMap, NULL,
+ _T("GetRawData(): failed to get PixMap from GWorld?") );
+
+ wxCHECK_MSG( (*hPixMap)->pixelSize == bpp, NULL,
+ _T("GetRawData(): pixel format mismatch") );
+
+ 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
+}
+