1998-11-10 05:28:34 +03:00
|
|
|
/* Drag and Drop functionality for the Midnight Commander
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998 The Free Software Foundation
|
|
|
|
*
|
|
|
|
* Authors: Federico Mena <federico@nuclecu.unam.mx>
|
|
|
|
* Miguel de Icaza <miguel@nuclecu.unam.mx>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GDND_H
|
|
|
|
#define GDND_H
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
1999-01-26 09:53:48 +03:00
|
|
|
#include "panel.h"
|
1998-11-10 05:28:34 +03:00
|
|
|
|
1998-12-05 04:01:13 +03:00
|
|
|
|
|
|
|
/* Standard DnD types */
|
1999-01-21 12:46:01 +03:00
|
|
|
typedef enum {
|
1998-12-05 04:01:13 +03:00
|
|
|
TARGET_MC_DESKTOP_ICON,
|
|
|
|
TARGET_URI_LIST,
|
1998-12-11 21:12:21 +03:00
|
|
|
TARGET_TEXT_PLAIN,
|
1999-01-21 12:46:01 +03:00
|
|
|
TARGET_URL,
|
|
|
|
TARGET_NTARGETS
|
|
|
|
} TargetType;
|
1998-12-05 04:01:13 +03:00
|
|
|
|
1999-01-21 12:46:01 +03:00
|
|
|
/* DnD target names */
|
|
|
|
#define TARGET_MC_DESKTOP_ICON_TYPE "application/x-mc-desktop-icon"
|
|
|
|
#define TARGET_URI_LIST_TYPE "text/uri-list"
|
|
|
|
#define TARGET_TEXT_PLAIN_TYPE "text/plain"
|
|
|
|
#define TARGET_URL_TYPE "_NETSCAPE_URL"
|
|
|
|
|
|
|
|
/* Atoms for the DnD types, indexed per the enum above */
|
|
|
|
extern GdkAtom dnd_target_atoms[];
|
|
|
|
|
|
|
|
|
|
|
|
/* Initializes drag and drop by interning the target convenience atoms */
|
|
|
|
void gdnd_init (void);
|
1998-12-05 04:01:13 +03:00
|
|
|
|
1999-02-03 14:46:01 +03:00
|
|
|
/* Perform a drop on the specified file entry. This function takes care of
|
|
|
|
* determining how to drop the stuff epending on the type of the file entry.
|
|
|
|
* Returns TRUE if an action was performed, FALSE otherwise (i.e. invalid drop).
|
|
|
|
*/
|
|
|
|
int gdnd_perform_drop (GdkDragContext *context, GtkSelectionData *selection_data,
|
1999-02-18 03:07:26 +03:00
|
|
|
char *directory, file_entry *dest_fe);
|
1998-11-10 05:28:34 +03:00
|
|
|
|
1999-01-21 12:46:01 +03:00
|
|
|
/* Test whether the specified context has a certain target type */
|
|
|
|
int gdnd_drag_context_has_target (GdkDragContext *context, TargetType type);
|
1998-12-05 04:01:13 +03:00
|
|
|
|
1999-01-26 09:53:48 +03:00
|
|
|
/* Look for a panel that corresponds to the specified drag context */
|
|
|
|
WPanel *gdnd_find_panel_by_drag_context (GdkDragContext *context, GtkWidget **source_widget);
|
|
|
|
|
|
|
|
/* Computes the final drag action based on the suggested actions and the
|
|
|
|
* specified conditions.
|
|
|
|
*/
|
1999-02-03 14:46:01 +03:00
|
|
|
GdkDragAction gdnd_validate_action (GdkDragContext *context,
|
|
|
|
int on_desktop, int same_process, int same_source,
|
1999-02-18 03:07:26 +03:00
|
|
|
char *directory, file_entry *dest_fe, int dest_selected);
|
1999-01-26 09:53:48 +03:00
|
|
|
|
|
|
|
|
1998-11-10 05:28:34 +03:00
|
|
|
#endif
|