Changeset 63985 in webkit
- Timestamp:
- Jul 23, 2010 10:11:11 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63984 r63985 1 2010-07-23 Patrick Gansterer <paroga@paroga.com> 2 3 Reviewed by Adam Roben. 4 5 [WINCE] Merge PasteboardWince.cpp into PasteboardWin.cpp 6 https://bugs.webkit.org/show_bug.cgi?id=42885 7 8 Make PasteboardWin more portable and remove the global namespace prefix 9 from GlobalLock/GlobalUnlock, since they are only macros on WinCE. 10 11 * platform/win/PasteboardWin.cpp: 12 (WebCore::PasteboardOwnerWndProc): 13 (WebCore::Pasteboard::Pasteboard): 14 (WebCore::Pasteboard::plainText): 15 (WebCore::Pasteboard::documentFragment): 16 1 17 2010-07-23 Justin Schuh <jschuh@chromium.org> 2 18 -
trunk/WebCore/platform/win/PasteboardWin.cpp
r63940 r63985 53 53 { 54 54 LRESULT lresult = 0; 55 LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);56 55 57 56 switch (message) { … … 65 64 // the clipboard before it exits. 66 65 break; 66 case WM_DESTROY: 67 break; 68 #if !OS(WINCE) 67 69 case WM_DRAWCLIPBOARD: 68 70 break; 69 case WM_DESTROY:70 break;71 71 case WM_CHANGECBCHAIN: 72 72 break; 73 #endif 73 74 default: 74 75 lresult = DefWindowProc(hWnd, message, wParam, lParam); … … 85 86 86 87 Pasteboard::Pasteboard() 87 { 88 // make a dummy HWND to be the Windows clipboard's owner 89 WNDCLASSEX wcex = {0}; 90 wcex.cbSize = sizeof(WNDCLASSEX); 91 wcex.lpfnWndProc = PasteboardOwnerWndProc; 92 wcex.hInstance = WebCore::instanceHandle(); 93 wcex.lpszClassName = L"PasteboardOwnerWindowClass"; 94 ::RegisterClassEx(&wcex); 88 { 89 HWND hWndParent = 0; 90 #if !OS(WINCE) 91 hWndParent = HWND_MESSAGE; 92 #endif 93 94 WNDCLASS wc; 95 memset(&wc, 0, sizeof(WNDCLASS)); 96 wc.lpfnWndProc = PasteboardOwnerWndProc; 97 wc.hInstance = WebCore::instanceHandle(); 98 wc.lpszClassName = L"PasteboardOwnerWindowClass"; 99 RegisterClass(&wc); 95 100 96 101 m_owner = ::CreateWindow(L"PasteboardOwnerWindowClass", L"PasteboardOwnerWindow", 0, 0, 0, 0, 0, 97 HWND_MESSAGE, 0, 0, 0);102 hWndParent, 0, 0, 0); 98 103 99 104 HTMLClipboardFormat = ::RegisterClipboardFormat(L"HTML Format"); … … 226 231 image->getHBITMAP(coreBitmap); 227 232 233 #if !defined(NO_ALPHABLEND) 228 234 BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA}; 229 235 AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(), 230 236 sourceDC, 0, 0, image->width(), image->height(), bf); 237 #else 238 StretchBlt(compatibleDC, 0, 0, image->width(), image->height(), 239 sourceDC, 0, 0, image->width(), image->height(), SRCCOPY); 240 #endif 231 241 232 242 SelectObject(sourceDC, oldSource); … … 254 264 HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT); 255 265 if (cbData) { 256 UChar* buffer = (UChar*)::GlobalLock(cbData);266 UChar* buffer = static_cast<UChar*>(GlobalLock(cbData)); 257 267 String fromClipboard(buffer); 258 ::GlobalUnlock(cbData);268 GlobalUnlock(cbData); 259 269 ::CloseClipboard(); 260 270 return fromClipboard; … … 266 276 HANDLE cbData = ::GetClipboardData(CF_TEXT); 267 277 if (cbData) { 268 char* buffer = (char*)::GlobalLock(cbData);278 char* buffer = static_cast<char*>(GlobalLock(cbData)); 269 279 String fromClipboard(buffer); 270 ::GlobalUnlock(cbData);280 GlobalUnlock(cbData); 271 281 ::CloseClipboard(); 272 282 return fromClipboard; … … 287 297 if (cbData) { 288 298 SIZE_T dataSize = ::GlobalSize(cbData); 289 String cfhtml(UTF8Encoding().decode( (char*)::GlobalLock(cbData), dataSize));290 ::GlobalUnlock(cbData);299 String cfhtml(UTF8Encoding().decode(static_cast<char*>(GlobalLock(cbData)), dataSize)); 300 GlobalUnlock(cbData); 291 301 ::CloseClipboard(); 292 302 … … 303 313 HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT); 304 314 if (cbData) { 305 UChar* buffer = (UChar*)GlobalLock(cbData);315 UChar* buffer = static_cast<UChar*>(GlobalLock(cbData)); 306 316 String str(buffer); 307 ::GlobalUnlock(cbData);317 GlobalUnlock(cbData); 308 318 ::CloseClipboard(); 309 319 RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str); … … 320 330 HANDLE cbData = ::GetClipboardData(CF_TEXT); 321 331 if (cbData) { 322 char* buffer = (char*)GlobalLock(cbData);332 char* buffer = static_cast<char*>(GlobalLock(cbData)); 323 333 String str(buffer); 324 ::GlobalUnlock(cbData);334 GlobalUnlock(cbData); 325 335 ::CloseClipboard(); 326 336 RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
Note: See TracChangeset
for help on using the changeset viewer.