[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:26:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5cc174d18e65ddb2cdb0671702009a573d274628
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 23 17:11:11 2010 +0000

    2010-07-23  Patrick Gansterer  <paroga at 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):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63985 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2b67c0e..11e102b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-23  Patrick Gansterer  <paroga at 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):
+
 2010-07-23  Justin Schuh  <jschuh at chromium.org>
 
         Unreviewed, rolling out r63925.
diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp
index 169f6fd..03ecd36 100644
--- a/WebCore/platform/win/PasteboardWin.cpp
+++ b/WebCore/platform/win/PasteboardWin.cpp
@@ -52,7 +52,6 @@ static UINT WebSmartPasteFormat = 0;
 static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     LRESULT lresult = 0;
-    LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
 
     switch (message) {
     case WM_RENDERFORMAT:
@@ -64,12 +63,14 @@ static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM w
         // and now this application is about to quit, so it must put data on 
         // the clipboard before it exits.
         break;
-    case WM_DRAWCLIPBOARD:
-        break;
     case WM_DESTROY:
         break;
+#if !OS(WINCE)
+    case WM_DRAWCLIPBOARD:
+        break;
     case WM_CHANGECBCHAIN:
         break;
+#endif
     default:
         lresult = DefWindowProc(hWnd, message, wParam, lParam);
         break;
@@ -84,17 +85,21 @@ Pasteboard* Pasteboard::generalPasteboard()
 }
 
 Pasteboard::Pasteboard()
-{ 
-    // make a dummy HWND to be the Windows clipboard's owner
-    WNDCLASSEX wcex = {0};
-    wcex.cbSize = sizeof(WNDCLASSEX);
-    wcex.lpfnWndProc    = PasteboardOwnerWndProc;
-    wcex.hInstance      = WebCore::instanceHandle();
-    wcex.lpszClassName  = L"PasteboardOwnerWindowClass";
-    ::RegisterClassEx(&wcex);
+{
+    HWND hWndParent = 0;
+#if !OS(WINCE)
+    hWndParent = HWND_MESSAGE;
+#endif
+
+    WNDCLASS wc;
+    memset(&wc, 0, sizeof(WNDCLASS));
+    wc.lpfnWndProc    = PasteboardOwnerWndProc;
+    wc.hInstance      = WebCore::instanceHandle();
+    wc.lpszClassName  = L"PasteboardOwnerWindowClass";
+    RegisterClass(&wc);
 
     m_owner = ::CreateWindow(L"PasteboardOwnerWindowClass", L"PasteboardOwnerWindow", 0, 0, 0, 0, 0,
-        HWND_MESSAGE, 0, 0, 0);
+        hWndParent, 0, 0, 0);
 
     HTMLClipboardFormat = ::RegisterClipboardFormat(L"HTML Format");
     BookmarkClipboardFormat = ::RegisterClipboardFormat(L"UniformResourceLocatorW");
@@ -225,9 +230,14 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&)
     HGDIOBJ oldSource = SelectObject(sourceDC, coreBitmap);
     image->getHBITMAP(coreBitmap);
 
+#if !defined(NO_ALPHABLEND)
     BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
     AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(),
         sourceDC, 0, 0, image->width(), image->height(), bf);
+#else
+    StretchBlt(compatibleDC, 0, 0, image->width(), image->height(),
+        sourceDC, 0, 0, image->width(), image->height(), SRCCOPY);
+#endif
 
     SelectObject(sourceDC, oldSource);
     DeleteObject(coreBitmap);
@@ -253,9 +263,9 @@ String Pasteboard::plainText(Frame* frame)
     if (::IsClipboardFormatAvailable(CF_UNICODETEXT) && ::OpenClipboard(m_owner)) {
         HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT);
         if (cbData) {
-            UChar* buffer = (UChar*)::GlobalLock(cbData);
+            UChar* buffer = static_cast<UChar*>(GlobalLock(cbData));
             String fromClipboard(buffer);
-            ::GlobalUnlock(cbData);
+            GlobalUnlock(cbData);
             ::CloseClipboard();
             return fromClipboard;
         }
@@ -265,9 +275,9 @@ String Pasteboard::plainText(Frame* frame)
     if (::IsClipboardFormatAvailable(CF_TEXT) && ::OpenClipboard(m_owner)) {
         HANDLE cbData = ::GetClipboardData(CF_TEXT);
         if (cbData) {
-            char* buffer = (char*)::GlobalLock(cbData);
+            char* buffer = static_cast<char*>(GlobalLock(cbData));
             String fromClipboard(buffer);
-            ::GlobalUnlock(cbData);
+            GlobalUnlock(cbData);
             ::CloseClipboard();
             return fromClipboard;
         }
@@ -286,8 +296,8 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
         HANDLE cbData = ::GetClipboardData(HTMLClipboardFormat);
         if (cbData) {
             SIZE_T dataSize = ::GlobalSize(cbData);
-            String cfhtml(UTF8Encoding().decode((char*)::GlobalLock(cbData), dataSize));
-            ::GlobalUnlock(cbData);
+            String cfhtml(UTF8Encoding().decode(static_cast<char*>(GlobalLock(cbData)), dataSize));
+            GlobalUnlock(cbData);
             ::CloseClipboard();
 
             PassRefPtr<DocumentFragment> fragment = fragmentFromCFHTML(frame->document(), cfhtml);
@@ -302,9 +312,9 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
         if (::OpenClipboard(m_owner)) {
             HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT);
             if (cbData) {
-                UChar* buffer = (UChar*)GlobalLock(cbData);
+                UChar* buffer = static_cast<UChar*>(GlobalLock(cbData));
                 String str(buffer);
-                ::GlobalUnlock(cbData);
+                GlobalUnlock(cbData);
                 ::CloseClipboard();
                 RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
                 if (fragment)
@@ -319,9 +329,9 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
         if (::OpenClipboard(m_owner)) {
             HANDLE cbData = ::GetClipboardData(CF_TEXT);
             if (cbData) {
-                char* buffer = (char*)GlobalLock(cbData);
+                char* buffer = static_cast<char*>(GlobalLock(cbData));
                 String str(buffer);
-                ::GlobalUnlock(cbData);
+                GlobalUnlock(cbData);
                 ::CloseClipboard();
                 RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
                 if (fragment)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list