Synopsis#include <gdk/gdk.h> GdkAtom gdk_drag_get_selection (GdkDragContext *context); void gdk_drag_abort (GdkDragContext *context, guint32 time_); void gdk_drop_reply (GdkDragContext *context, gboolean ok, guint32 time_); GdkDragContext* gdk_drag_context_new (void); void gdk_drag_drop (GdkDragContext *context, guint32 time_); void gdk_drag_find_window (GdkDragContext *context, GdkWindow *drag_window, gint x_root, gint y_root, GdkWindow **dest_window, GdkDragProtocol *protocol); void gdk_drag_find_window_for_screen (GdkDragContext *context, GdkWindow *drag_window, GdkScreen *screen, gint x_root, gint y_root, GdkWindow **dest_window, GdkDragProtocol *protocol); void gdk_drag_context_ref (GdkDragContext *context); GdkDragContext* gdk_drag_begin (GdkWindow *window, GList *targets); gboolean gdk_drag_motion (GdkDragContext *context, GdkWindow *dest_window, GdkDragProtocol protocol, gint x_root, gint y_root, GdkDragAction suggested_action, GdkDragAction possible_actions, guint32 time_); void gdk_drop_finish (GdkDragContext *context, gboolean success, guint32 time_); GdkNativeWindow gdk_drag_get_protocol (GdkNativeWindow xid, GdkDragProtocol *protocol); GdkNativeWindow gdk_drag_get_protocol_for_display (GdkDisplay *display, GdkNativeWindow xid, GdkDragProtocol *protocol); enum GdkDragProtocol; void gdk_drag_context_unref (GdkDragContext *context); GdkDragContext; enum GdkDragAction; void gdk_drag_status (GdkDragContext *context, GdkDragAction action, guint32 time_); gboolean gdk_drag_drop_succeeded (GdkDragContext *context); DescriptionThese functions provide a low level interface for drag and drop. The X backend of GDK supports both the Xdnd and Motif drag and drop protocols transparently, the Win32 backend supports the WM_DROPFILES protocol. GTK+ provides a higher level abstraction based on top of these functions, and so they are not normally needed in GTK+ applications. See the Drag and Drop section of the GTK+ documentation for more information. Detailsgdk_drag_get_selection ()GdkAtom gdk_drag_get_selection (GdkDragContext *context); Returns the selection atom for the current source window.
gdk_drag_abort ()void gdk_drag_abort (GdkDragContext *context, guint32 time_); Aborts a drag without dropping. This function is called by the drag source.
gdk_drop_reply ()void gdk_drop_reply (GdkDragContext *context, gboolean ok, guint32 time_); Accepts or rejects a drop. This function is called by the drag destination in response to a drop initiated by the drag source.
gdk_drag_context_new ()GdkDragContext* gdk_drag_context_new (void); Creates a new GdkDragContext.
gdk_drag_drop ()void gdk_drag_drop (GdkDragContext *context, guint32 time_); Drops on the current destination. This function is called by the drag source.
gdk_drag_find_window ()void gdk_drag_find_window (GdkDragContext *context, GdkWindow *drag_window, gint x_root, gint y_root, GdkWindow **dest_window, GdkDragProtocol *protocol); Finds the destination window and DND protocol to use at the given pointer position.
This function is called by the drag source to obtain the
gdk_drag_find_window_for_screen ()void gdk_drag_find_window_for_screen (GdkDragContext *context, GdkWindow *drag_window, GdkScreen *screen, gint x_root, gint y_root, GdkWindow **dest_window, GdkDragProtocol *protocol); Finds the destination window and DND protocol to use at the given pointer position.
This function is called by the drag source to obtain the
Since 2.2 gdk_drag_context_ref ()void gdk_drag_context_ref (GdkDragContext *context); Warning
Deprecated function; use
gdk_drag_begin ()GdkDragContext* gdk_drag_begin (GdkWindow *window, GList *targets); Starts a drag and creates a new drag context for it. This function is called by the drag source.
gdk_drag_motion ()gboolean gdk_drag_motion (GdkDragContext *context, GdkWindow *dest_window, GdkDragProtocol protocol, gint x_root, gint y_root, GdkDragAction suggested_action, GdkDragAction possible_actions, guint32 time_); Updates the drag context when the pointer moves or the set of actions changes. This function is called by the drag source.
gdk_drop_finish ()void gdk_drop_finish (GdkDragContext *context, gboolean success, guint32 time_); Ends the drag operation after a drop. This function is called by the drag destination.
gdk_drag_get_protocol ()GdkNativeWindow gdk_drag_get_protocol (GdkNativeWindow xid, GdkDragProtocol *protocol); Finds out the DND protocol supported by a window.
gdk_drag_get_protocol_for_display ()GdkNativeWindow gdk_drag_get_protocol_for_display (GdkDisplay *display, GdkNativeWindow xid, GdkDragProtocol *protocol); Finds out the DND protocol supported by a window.
Since 2.2 enum GdkDragProtocoltypedef enum { GDK_DRAG_PROTO_MOTIF, GDK_DRAG_PROTO_XDND, GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming * drags */ GDK_DRAG_PROTO_NONE, /* Not a valid drag window */ GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */ GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */ GDK_DRAG_PROTO_LOCAL /* Intra-app */ } GdkDragProtocol; Used in GdkDragContext to indicate the protocol according to which DND is done.
gdk_drag_context_unref ()void gdk_drag_context_unref (GdkDragContext *context); Warning
Deprecated function; use
GdkDragContexttypedef struct { GObject parent_instance; GdkDragProtocol protocol; gboolean is_source; GdkWindow *source_window; GdkWindow *dest_window; GList *targets; GdkDragAction actions; GdkDragAction suggested_action; GdkDragAction action; guint32 start_time; } GdkDragContext; A GdkDragContext holds information about a drag in progress. It is used on both source and destination sides.
enum GdkDragActiontypedef enum { GDK_ACTION_DEFAULT = 1 << 0, GDK_ACTION_COPY = 1 << 1, GDK_ACTION_MOVE = 1 << 2, GDK_ACTION_LINK = 1 << 3, GDK_ACTION_PRIVATE = 1 << 4, GDK_ACTION_ASK = 1 << 5 } GdkDragAction; Used in GdkDragContext to indicate what the destination should do with the dropped data.
gdk_drag_status ()void gdk_drag_status (GdkDragContext *context, GdkDragAction action, guint32 time_); Selects one of the actions offered by the drag source.
This function is called by the drag destination in response to
gdk_drag_drop_succeeded ()gboolean gdk_drag_drop_succeeded (GdkDragContext *context);
Returns wether the dropped data has been successfully
transferred. This function is intended to be used while
handling a
Since 2.6 |