summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp
diff options
context:
space:
mode:
authorLeon Clarke <leonclarke@google.com>2010-07-15 12:03:35 +0100
committerLeon Clarke <leonclarke@google.com>2010-07-20 16:57:23 +0100
commite458d70a0d18538346f41b503114c9ebe6b2ce12 (patch)
tree86f1637deca2c524432a822e5fcedd4bef221091 /WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp
parentf43eabc081f7ce6af24b9df4953498a3cd6ca24d (diff)
downloadexternal_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.zip
external_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.tar.gz
external_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.tar.bz2
Merge WebKit at r63173 : Initial merge by git.
Change-Id: Ife5af0c7c6261fbbc8ae6bc08c390efa9ef10b44
Diffstat (limited to 'WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp')
-rw-r--r--WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp b/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp
index f6dea79..9fc0e74 100644
--- a/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp
@@ -39,8 +39,27 @@ GdkDragAction dragOperationToGdkDragActions(DragOperation coreAction)
return gdkAction;
}
+GdkDragAction dragOperationToSingleGdkDragAction(DragOperation coreAction)
+{
+ if (coreAction == DragOperationEvery || coreAction & DragOperationCopy)
+ return GDK_ACTION_COPY;
+ if (coreAction & DragOperationMove)
+ return GDK_ACTION_MOVE;
+ if (coreAction & DragOperationLink)
+ return GDK_ACTION_LINK;
+ if (coreAction & DragOperationPrivate)
+ return GDK_ACTION_PRIVATE;
+ return static_cast<GdkDragAction>(0);
+}
+
DragOperation gdkDragActionToDragOperation(GdkDragAction gdkAction)
{
+ // We have no good way to detect DragOperationEvery other than
+ // to use it when all applicable flags are on.
+ if (gdkAction & GDK_ACTION_COPY && gdkAction & GDK_ACTION_MOVE
+ && gdkAction & GDK_ACTION_LINK && gdkAction & GDK_ACTION_PRIVATE)
+ return DragOperationEvery;
+
unsigned int action = DragOperationNone;
if (gdkAction & GDK_ACTION_COPY)
action |= DragOperationCopy;