| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "app/drag_drop_types.h" | |
| 6 | |
| 7 #include <gtk/gtk.h> | |
| 8 | |
| 9 // static | |
| 10 int DragDropTypes::DragOperationToGdkDragAction(int drag_operation) { | |
| 11 int gdk_drag_action = 0; | |
| 12 if (drag_operation & DRAG_MOVE) | |
| 13 gdk_drag_action |= GDK_ACTION_MOVE; | |
| 14 if (drag_operation & DRAG_COPY) | |
| 15 gdk_drag_action |= GDK_ACTION_COPY; | |
| 16 if (drag_operation & DRAG_LINK) | |
| 17 gdk_drag_action |= GDK_ACTION_LINK; | |
| 18 return gdk_drag_action; | |
| 19 } | |
| 20 | |
| 21 // static | |
| 22 int DragDropTypes::GdkDragActionToDragOperation(int gdk_drag_action) { | |
| 23 int drag_operation = DRAG_NONE; | |
| 24 if (gdk_drag_action & GDK_ACTION_COPY) | |
| 25 drag_operation |= DRAG_COPY; | |
| 26 if (gdk_drag_action & GDK_ACTION_MOVE) | |
| 27 drag_operation |= DRAG_MOVE; | |
| 28 if (gdk_drag_action & GDK_ACTION_LINK) | |
| 29 drag_operation |= DRAG_LINK; | |
| 30 return drag_operation; | |
| 31 } | |
| OLD | NEW |