De-fuzzyed some msgs...
[midnight-commander.git] / gnome / gdnd.h
blobeeb0c56f29b10098da91724fa0fce02431167141
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>
7 */
9 #ifndef GDND_H
10 #define GDND_H
12 #include <gtk/gtk.h>
13 #include "panel.h"
16 /* Standard DnD types */
17 typedef enum {
18 TARGET_MC_DESKTOP_ICON,
19 TARGET_URI_LIST,
20 TARGET_TEXT_PLAIN,
21 TARGET_URL,
22 TARGET_NTARGETS
23 } TargetType;
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 char *dest_full_name, file_entry *dest_fe);
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 char *dest_full_name, file_entry *dest_fe, int dest_selected);
58 /* Returns whether a non-directory file can take drops */
59 int gdnd_can_drop_on_file (char *full_name, file_entry *fe);
62 #endif