- wxCHECK_MSG( m_dataObjectLast, url, _T("no data in wxURLDataObject") );
-
- size_t len = m_dataObjectLast->GetDataSize();
-
- m_dataObjectLast->GetDataHere(url.GetWriteBuf(len));
- url.UngetWriteBuf();
-
- return url;
-}
-
-void wxURLDataObject::SetURL(const wxString& url)
-{
- SetData(wxDataFormat(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT),
- url.Length()+1, url.c_str());
-
- // CFSTR_SHELLURL is always supposed to be ANSI...
- wxWX2MBbuf urlA = (wxWX2MBbuf)url.mbc_str();
- size_t len = strlen(urlA);
- SetData(wxDataFormat(CFSTR_SHELLURL), len+1, (const char*)urlA);
-}
-
-// ----------------------------------------------------------------------------
-// private functions
-// ----------------------------------------------------------------------------
-
-static size_t wxGetNumOfBitmapColors(size_t bitsPerPixel)
-{
- switch ( bitsPerPixel )
- {
- case 1:
- // monochrome bitmap, 2 entries
- return 2;
-
- case 4:
- return 16;
-
- case 8:
- return 256;
-
- case 24:
- // may be used with 24bit bitmaps, but we don't use it here - fall
- // through
-
- case 16:
- case 32:
- // bmiColors not used at all with these bitmaps
- return 0;
-
- default:
- wxFAIL_MSG( wxT("unknown bitmap format") );
- return 0;
- }
-}
-
-size_t wxConvertBitmapToDIB(LPBITMAPINFO pbi, const wxBitmap& bitmap)
-{
- wxASSERT_MSG( bitmap.Ok(), wxT("invalid bmp can't be converted to DIB") );
-
- // shouldn't be selected into a DC or GetDIBits() would fail
- wxASSERT_MSG( !bitmap.GetSelectedInto(),
- wxT("can't copy bitmap selected into wxMemoryDC") );
-
- // prepare all the info we need
- BITMAP bm;
- HBITMAP hbmp = (HBITMAP)bitmap.GetHBITMAP();
- if ( !GetObject(hbmp, sizeof(bm), &bm) )
- {
- wxLogLastError(wxT("GetObject(bitmap)"));
-
- return 0;
- }