| 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 #ifndef CHROME_BROWSER_GTK_DND_REGISTRY_H_ | |
| 6 #define CHROME_BROWSER_GTK_DND_REGISTRY_H_ | |
| 7 | |
| 8 #include <gtk/gtk.h> | |
| 9 | |
| 10 // We wrap all of these constants in a namespace to prevent pollution. | |
| 11 namespace dnd { | |
| 12 | |
| 13 // Registry of all internal int codes for drag and drop. | |
| 14 // | |
| 15 // These ids need to be unique app wide. Simply adding a GtkTargetEntry with an | |
| 16 // id of 0 should be an error and it will conflict with X_CHROME_TAB below. | |
| 17 enum { | |
| 18 X_CHROME_TAB = 1 << 0, | |
| 19 X_CHROME_TEXT_PLAIN = 1 << 1, | |
| 20 X_CHROME_TEXT_URI_LIST = 1 << 2, | |
| 21 X_CHROME_BOOKMARK_ITEM = 1 << 3, | |
| 22 }; | |
| 23 | |
| 24 // Creates a target list from the given mask. The mask should be an OR of | |
| 25 // X_CHROME_* values. The target list is returned with ref count 1; the caller | |
| 26 // is responsible for unreffing it when it is no longer needed. | |
| 27 GtkTargetList* GetTargetListFromCodeMask(int code_mask); | |
| 28 | |
| 29 // Set the drag target list for |dest| or |source| with the target list that | |
| 30 // corresponds to |code_mask|. | |
| 31 void SetDestTargetListFromCodeMask(GtkWidget* dest, int code_mask); | |
| 32 void SetSourceTargetListFromCodeMask(GtkWidget* source, int code_mask); | |
| 33 | |
| 34 } // namespace dnd | |
| 35 | |
| 36 #endif // CHROME_BROWSER_GTK_DND_REGISTRY_H_ | |
| OLD | NEW |