Reviewed Adam Roben and Darin Adler.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 01:34:24 +0000 (01:34 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 01:34:24 +0000 (01:34 +0000)
commitdb355a4adea5a10ff4ef465813f274a2b3b965e8
treebef7d593a51ce4092fbad127b6fb26a34f571dc9
parent97ab9d10325f1a742b2ea3bb42361b433403b8e5
Reviewed Adam Roben and Darin Adler.

Source/WebCore:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775
<rdar://problem/8514409>

* loader/EmptyClients.h: Removed createDragImageFromLink.
* page/DragClient.h: Ditto.
* page/DragController.cpp:
(WebCore::DragController::startDrag): changed call to createDragImageFromLink.
* platform/DragImage.h:
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink): Moved from DragClient.
* platform/win/ClipboardUtilitiesWin.cpp: Added a series of functions
to de-serialize the drag data from the map into an IDataObject.
(WebCore::getWebLocData):
(WebCore::texthtmlFormat):
(WebCore::createGlobalData):
(WebCore::getFullCFHTML):
(WebCore::urlWFormat):
(WebCore::urlFormat):
(WebCore::filenameWFormat):
(WebCore::filenameFormat):
(WebCore::htmlFormat):
(WebCore::smartPasteFormat):
(WebCore::getURL):
(WebCore::getPlainText):
(WebCore::getTextHTML):
(WebCore::ClipboardDataItem::ClipboardDataItem):
(WebCore::getStringData):
(WebCore::getUtf8Data):
(WebCore::getCFData):
(WebCore::setUCharData):
(WebCore::setCharData):
(WebCore::setCFData):
(WebCore::getClipboardMap):
(WebCore::getClipboardData):
(WebCore::setClipboardData):
* platform/win/ClipboardUtilitiesWin.h:
* platform/win/DragImageWin.cpp: Moved createDragImageForLink from DragClient
to a platform specific file in WebCore. It makes a lot more sense here, since
the drag image is always created in WebCore for all the other content types
except for links.
(WebCore::dragLabelFont):
(WebCore::createDragImageForLink):
* platform/win/WCDataObject.cpp: Added new way to
construct a WCDataObject from a DragDataMap.
(WebCore::WCDataObject::createInstance):
(WebCore::WCDataObject::clearData):
* platform/win/WCDataObject.h:

Source/WebKit/chromium:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* src/DragClientImpl.cpp:
* src/DragClientImpl.h:

Source/WebKit/efl:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebCoreSupport/DragClientEfl.cpp:
* WebCoreSupport/DragClientEfl.h:

Source/WebKit/gtk:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebCoreSupport/DragClientGtk.cpp:
* WebCoreSupport/DragClientGtk.h:

Source/WebKit/haiku:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebCoreSupport/DragClientHaiku.cpp:
* WebCoreSupport/DragClientHaiku.h:

Source/WebKit/mac:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::startDrag):

Source/WebKit/qt:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebCoreSupport/DragClientQt.cpp:
* WebCoreSupport/DragClientQt.h:

Source/WebKit/win:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::startDrag):
* WebCoreSupport/WebDragClient.h:

Source/WebKit/wince:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebCoreSupport/DragClientWinCE.cpp:
* WebCoreSupport/DragClientWinCE.h:

Source/WebKit/wx:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775

Removed createDragImageForLink from DragClient.

* WebKitSupport/DragClientWx.cpp:
* WebKitSupport/DragClientWx.h:

Source/WebKit2:

WebKit2: drag and drop support on Windows.
https://bugs.webkit.org/show_bug.cgi?id=52775
<rdar://problem/8514409>

This patch contains the remaining work to support
a WebKit window as drag source on Windows.
I've added the code to generate the image for dragging a link as
well as the steps necessary to package the HBITMAP into a SharedMemory
object and send it over to the UI process where DoDragDrop is performed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setDragImage):
(WebKit::WebPageProxy::startDragDrop):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::startDrag): Made startDrag for
platforms other than Windows and Mac.
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/win/WebDragClientWin.cpp: Added.
(WebKit::draggingSourceOperationMaskToDragCursors):
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/win/WebDragSource.cpp: Added.
This object implements the IDropSource interface.
(WebDragSource::createInstance):
(WebDragSource::WebDragSource):
(WebDragSource::QueryInterface):
(WebDragSource::AddRef):
(WebDragSource::Release):
(WebDragSource::QueryContinueDrag):
(WebDragSource::GiveFeedback):
* WebProcess/WebCoreSupport/win/WebDragSource.h: Added.
* win/WebKit2.vcproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@77870 268f45cc-cd09-0410-ab3c-d52691b4dbfc
50 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/DragClient.h
Source/WebCore/page/DragController.cpp
Source/WebCore/platform/DragImage.cpp
Source/WebCore/platform/DragImage.h
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
Source/WebCore/platform/win/ClipboardUtilitiesWin.h
Source/WebCore/platform/win/DragImageWin.cpp
Source/WebCore/platform/win/WCDataObject.cpp
Source/WebCore/platform/win/WCDataObject.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/DragClientImpl.cpp
Source/WebKit/chromium/src/DragClientImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DragClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/DragClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/DragClientGtk.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp
Source/WebKit/haiku/WebCoreSupport/DragClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebDragClient.h
Source/WebKit/mac/WebCoreSupport/WebDragClient.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp
Source/WebKit/qt/WebCoreSupport/DragClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebDragClient.cpp
Source/WebKit/win/WebCoreSupport/WebDragClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/DragClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/DragClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/DragClientWx.cpp
Source/WebKit/wx/WebKitSupport/DragClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Source/WebKit2/WebProcess/WebCoreSupport/win/WebDragClientWin.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/WebCoreSupport/win/WebDragSource.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/WebCoreSupport/win/WebDragSource.h [new file with mode: 0644]
Source/WebKit2/win/WebKit2.vcproj