1 /* Drag and Drop functionality for the Midnight Commander
3 * Copyright (C) 1998 The Free Software Foundation
5 * Authors: Federico Mena <federico@nuclecu.unam.mx>
6 * Miguel de Icaza <miguel@nuclecu.unam.mx>
16 /* Standard DnD types */
18 TARGET_MC_DESKTOP_ICON
,
25 /* DnD target names */
26 #define TARGET_MC_DESKTOP_ICON_TYPE "application/x-mc-desktop-icon"
27 #define TARGET_URI_LIST_TYPE "text/uri-list"
28 #define TARGET_TEXT_PLAIN_TYPE "text/plain"
29 #define TARGET_URL_TYPE "_NETSCAPE_URL"
31 /* Atoms for the DnD types, indexed per the enum above */
32 extern GdkAtom dnd_target_atoms
[];
35 /* Initializes drag and drop by interning the target convenience atoms */
36 void gdnd_init (void);
38 /* Perform a drop on the specified file entry. This function takes care of
39 * determining how to drop the stuff epending on the type of the file entry.
40 * Returns TRUE if an action was performed, FALSE otherwise (i.e. invalid drop).
42 int gdnd_perform_drop (GdkDragContext
*context
, GtkSelectionData
*selection_data
,
43 file_entry
*dest_fe
, char *dest_name
);
45 /* Test whether the specified context has a certain target type */
46 int gdnd_drag_context_has_target (GdkDragContext
*context
, TargetType type
);
48 /* Look for a panel that corresponds to the specified drag context */
49 WPanel
*gdnd_find_panel_by_drag_context (GdkDragContext
*context
, GtkWidget
**source_widget
);
51 /* Computes the final drag action based on the suggested actions and the
52 * specified conditions.
54 GdkDragAction
gdnd_validate_action (GdkDragContext
*context
,
55 int on_desktop
, int same_process
, int same_source
,
56 file_entry
*dest_fe
, int dest_selected
);