Changeset 63985 in webkit


Ignore:
Timestamp:
Jul 23, 2010 10:11:11 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-23 Patrick Gansterer <paroga@paroga.com>

Reviewed by Adam Roben.

[WINCE] Merge PasteboardWince.cpp into PasteboardWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=42885

Make PasteboardWin more portable and remove the global namespace prefix
from GlobalLock/GlobalUnlock, since they are only macros on WinCE.

  • platform/win/PasteboardWin.cpp: (WebCore::PasteboardOwnerWndProc): (WebCore::Pasteboard::Pasteboard): (WebCore::Pasteboard::plainText): (WebCore::Pasteboard::documentFragment):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63984 r63985  
     12010-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
    1172010-07-23  Justin Schuh  <jschuh@chromium.org>
    218
  • trunk/WebCore/platform/win/PasteboardWin.cpp

    r63940 r63985  
    5353{
    5454    LRESULT lresult = 0;
    55     LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
    5655
    5756    switch (message) {
     
    6564        // the clipboard before it exits.
    6665        break;
     66    case WM_DESTROY:
     67        break;
     68#if !OS(WINCE)
    6769    case WM_DRAWCLIPBOARD:
    6870        break;
    69     case WM_DESTROY:
    70         break;
    7171    case WM_CHANGECBCHAIN:
    7272        break;
     73#endif
    7374    default:
    7475        lresult = DefWindowProc(hWnd, message, wParam, lParam);
     
    8586
    8687Pasteboard::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);
    95100
    96101    m_owner = ::CreateWindow(L"PasteboardOwnerWindowClass", L"PasteboardOwnerWindow", 0, 0, 0, 0, 0,
    97         HWND_MESSAGE, 0, 0, 0);
     102        hWndParent, 0, 0, 0);
    98103
    99104    HTMLClipboardFormat = ::RegisterClipboardFormat(L"HTML Format");
     
    226231    image->getHBITMAP(coreBitmap);
    227232
     233#if !defined(NO_ALPHABLEND)
    228234    BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
    229235    AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(),
    230236        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
    231241
    232242    SelectObject(sourceDC, oldSource);
     
    254264        HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT);
    255265        if (cbData) {
    256             UChar* buffer = (UChar*)::GlobalLock(cbData);
     266            UChar* buffer = static_cast<UChar*>(GlobalLock(cbData));
    257267            String fromClipboard(buffer);
    258             ::GlobalUnlock(cbData);
     268            GlobalUnlock(cbData);
    259269            ::CloseClipboard();
    260270            return fromClipboard;
     
    266276        HANDLE cbData = ::GetClipboardData(CF_TEXT);
    267277        if (cbData) {
    268             char* buffer = (char*)::GlobalLock(cbData);
     278            char* buffer = static_cast<char*>(GlobalLock(cbData));
    269279            String fromClipboard(buffer);
    270             ::GlobalUnlock(cbData);
     280            GlobalUnlock(cbData);
    271281            ::CloseClipboard();
    272282            return fromClipboard;
     
    287297        if (cbData) {
    288298            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);
    291301            ::CloseClipboard();
    292302
     
    303313            HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT);
    304314            if (cbData) {
    305                 UChar* buffer = (UChar*)GlobalLock(cbData);
     315                UChar* buffer = static_cast<UChar*>(GlobalLock(cbData));
    306316                String str(buffer);
    307                 ::GlobalUnlock(cbData);
     317                GlobalUnlock(cbData);
    308318                ::CloseClipboard();
    309319                RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
     
    320330            HANDLE cbData = ::GetClipboardData(CF_TEXT);
    321331            if (cbData) {
    322                 char* buffer = (char*)GlobalLock(cbData);
     332                char* buffer = static_cast<char*>(GlobalLock(cbData));
    323333                String str(buffer);
    324                 ::GlobalUnlock(cbData);
     334                GlobalUnlock(cbData);
    325335                ::CloseClipboard();
    326336                RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
Note: See TracChangeset for help on using the changeset viewer.