1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
Drag and Drop
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2000-02-02 03:23:11 +00:00
|
|
|
functions for controlling drag and drop handling.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2000-02-02 03:23:11 +00:00
|
|
|
These functions provide a low level interface for drag and drop.
|
2001-11-28 23:41:12 +00:00
|
|
|
The X backend of GDK supports both the Xdnd and Motif drag and drop protocols
|
|
|
|
transparently, the Win32 backend supports the WM_DROPFILES protocol.
|
2000-02-02 03:23:11 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
GTK+ provides a higher level abstraction based on top of these functions,
|
|
|
|
and so they are not normally needed in GTK+ applications.
|
|
|
|
See the <link linkend="gtk-Drag-and-Drop">Drag and Drop</link> section of
|
|
|
|
the GTK+ documentation for more information.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_get_selection ##### -->
|
|
|
|
<para>
|
2001-11-29 23:08:38 +00:00
|
|
|
Returns the selection atom for the current source window.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-29 23:08:38 +00:00
|
|
|
@context: a #GdkDragContext.
|
|
|
|
@Returns: the selection atom.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_abort ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Aborts a drag without dropping.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag source.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-29 23:08:38 +00:00
|
|
|
@context: a #GdkDragContext.
|
|
|
|
@time: the timestamp for this operation.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drop_reply ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Accepts or rejects a drop.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag destination in response
|
|
|
|
to a drop initiated by the drag source.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-02 22:27:26 +00:00
|
|
|
@context: a #GdkDragContext.
|
|
|
|
@ok: %TRUE if the drop is accepted.
|
|
|
|
@time: the timestamp for this operation.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_context_new ##### -->
|
|
|
|
<para>
|
2001-11-29 23:08:38 +00:00
|
|
|
Creates a new #GdkDragContext.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-29 23:08:38 +00:00
|
|
|
@Returns: the newly created #GdkDragContext.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_drop ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Drops on the current destination.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag source.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-02 22:27:26 +00:00
|
|
|
@context: a #GdkDragContext.
|
|
|
|
@time: the timestamp for this operation.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_find_window ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Finds the destination window and DND protocol to use at the
|
|
|
|
given pointer position.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag source to obtain the
|
|
|
|
@dest_window and @protocol parameters for gdk_drag_motion().
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-02 22:27:26 +00:00
|
|
|
@context: a #GdkDragContext.
|
|
|
|
@drag_window: a window which may be at the pointer position, but
|
|
|
|
should be ignored, since it is put up by the drag source as an icon.
|
|
|
|
@x_root: the x position of the pointer in root coordinates.
|
|
|
|
@y_root: the y position of the pointer in root coordinates.
|
|
|
|
@dest_window: location to store the destination window in.
|
|
|
|
@protocol: location to store the DND protocol in.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_context_ref ##### -->
|
|
|
|
<para>
|
Deprecate.
* gdk/gdkdrawable.h (gdk_drawable_ref, gdk_drawable_unref),
gdk/gdkcolor.h (gdk_colormap_ref, gdk_colormap_unref),
gdk/gdkdnd.h (gdk_drag_context_ref, gdk_drag_context_unref),
gdk/gdkgc.h (gdk_gc_ref, gdk_gc_unref): Deprecate.
* gdk/gdkvisual.h: Use GDK_DISABLE_DEPRECATED, not
GTK_DISABLE_DEPRECATED.
* gdk/gdkcolor.c (gdk_colormap_ref, gdk_colormap_unref),
gdk/gdkgc.c (gdk_gc_ref, gdk_gc_unref): Document.
* gdk/tmpl/colors.sgml, gdk/tmpl/pixmaps.sgml, gdk/tmpl/dnd.sgml,
gdk/tmpl/gcs.sgml: Document ref and unref functions as deprecated.
2001-11-30 22:55:28 +00:00
|
|
|
Deprecated function; use g_object_ref() instead.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-29 23:08:38 +00:00
|
|
|
@context: a #GdkDragContext.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_begin ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Starts a drag and creates a new drag context for it.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag source.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-29 23:08:38 +00:00
|
|
|
@window: the source window for this drag.
|
2001-12-02 22:27:26 +00:00
|
|
|
@targets: the list of offered targets.
|
2001-11-29 23:08:38 +00:00
|
|
|
@Returns: a newly created #GdkDragContext.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_motion ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Updates the drag context when the pointer moves or the
|
|
|
|
set of actions changes.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag source.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-02 22:27:26 +00:00
|
|
|
@context: a #GdkDragContext.
|
|
|
|
@dest_window: the new destination window, obtained by gdk_drag_find_window().
|
2001-12-23 22:55:17 +00:00
|
|
|
@protocol: the DND protocol in use, obtained by gdk_drag_find_window().
|
2001-12-02 22:27:26 +00:00
|
|
|
@x_root: the x position of the pointer in root coordinates.
|
|
|
|
@y_root: the y position of the pointer in root coordinates.
|
|
|
|
@suggested_action: the suggested action.
|
|
|
|
@possible_actions: the possible actions.
|
|
|
|
@time: the timestamp for this operation.
|
|
|
|
@Returns: FIXME
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drop_finish ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Ends the drag operation after a drop.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag destination.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-02 22:27:26 +00:00
|
|
|
@context: a #GtkDragContext.
|
|
|
|
@success: %TRUE if the data was successfully received.
|
|
|
|
@time: the timestamp for this operation.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_get_protocol ##### -->
|
|
|
|
<para>
|
2001-11-29 23:08:38 +00:00
|
|
|
Finds out the DND protocol supported by a window.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-29 23:08:38 +00:00
|
|
|
@xid: the X id of the destination window.
|
|
|
|
@protocol: location where the supported DND protocol is returned.
|
|
|
|
@Returns: the X id of the window where the drop should happen. This
|
|
|
|
may be @xid or the X id of a proxy window, or None if @xid doesn't
|
|
|
|
support Drag and Drop.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### ENUM GdkDragProtocol ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Used in #GdkDragContext to indicate the protocol according to
|
2001-11-28 23:41:12 +00:00
|
|
|
which DND is done.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-28 23:41:12 +00:00
|
|
|
@GDK_DRAG_PROTO_MOTIF: The Motif DND protocol.
|
|
|
|
@GDK_DRAG_PROTO_XDND: The Xdnd protocol.
|
|
|
|
@GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
|
|
|
|
unclaimed root window drops.
|
2001-12-23 22:55:17 +00:00
|
|
|
@GDK_DRAG_PROTO_NONE: no protocol.
|
2001-11-28 23:41:12 +00:00
|
|
|
@GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
|
2001-12-23 22:55:17 +00:00
|
|
|
@GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
|
2001-11-28 23:41:12 +00:00
|
|
|
@GDK_DRAG_PROTO_LOCAL: Intra-application DND.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_context_unref ##### -->
|
|
|
|
<para>
|
Deprecate.
* gdk/gdkdrawable.h (gdk_drawable_ref, gdk_drawable_unref),
gdk/gdkcolor.h (gdk_colormap_ref, gdk_colormap_unref),
gdk/gdkdnd.h (gdk_drag_context_ref, gdk_drag_context_unref),
gdk/gdkgc.h (gdk_gc_ref, gdk_gc_unref): Deprecate.
* gdk/gdkvisual.h: Use GDK_DISABLE_DEPRECATED, not
GTK_DISABLE_DEPRECATED.
* gdk/gdkcolor.c (gdk_colormap_ref, gdk_colormap_unref),
gdk/gdkgc.c (gdk_gc_ref, gdk_gc_unref): Document.
* gdk/tmpl/colors.sgml, gdk/tmpl/pixmaps.sgml, gdk/tmpl/dnd.sgml,
gdk/tmpl/gcs.sgml: Document ref and unref functions as deprecated.
2001-11-30 22:55:28 +00:00
|
|
|
Deprecated function; use g_object_unref() instead.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-11-29 23:08:38 +00:00
|
|
|
@context: a #GdkDragContext.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GdkDragContext ##### -->
|
|
|
|
<para>
|
2001-11-28 23:41:12 +00:00
|
|
|
A <structname>GdkDragContext</structname> holds information about a
|
|
|
|
drag in progress. It is used on both source and destination sides.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-23 22:55:17 +00:00
|
|
|
@parent_instance:
|
2001-11-28 23:41:12 +00:00
|
|
|
@protocol: the DND protocol which governs this drag.
|
|
|
|
@is_source: %TRUE if the context is used on the source side.
|
|
|
|
@source_window: the source of this drag.
|
2001-12-23 22:55:17 +00:00
|
|
|
@dest_window: the destination window of this drag.
|
2001-12-02 22:27:26 +00:00
|
|
|
@targets: a list of targets offered by the source.
|
|
|
|
@actions: a bitmask of actions proposed by the source when
|
|
|
|
@suggested_action is %GDK_ACTION_ASK.
|
|
|
|
@suggested_action: the action suggested by the source.
|
|
|
|
@action: the action chosen by the destination.
|
2001-11-28 23:41:12 +00:00
|
|
|
@start_time: a timestamp recording the start time of this drag.
|
|
|
|
|
1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### ENUM GdkDragAction ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Used in #GdkDragContext to indicate what the destination
|
|
|
|
should do with the dropped data.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
@GDK_ACTION_DEFAULT:
|
2001-12-23 22:55:17 +00:00
|
|
|
@GDK_ACTION_COPY: Copy the data.
|
2001-12-02 22:27:26 +00:00
|
|
|
@GDK_ACTION_MOVE: Move the data, i.e. first copy it, then delete
|
|
|
|
it from the source using the DELETE target of the X selection protocol.
|
|
|
|
@GDK_ACTION_LINK: Add a link to the data. Note that this is only
|
|
|
|
useful if source and destination agree on what it means.
|
|
|
|
@GDK_ACTION_PRIVATE: Special action which tells the source that the
|
|
|
|
destination will do something that the source doesn't understand.
|
2001-12-23 22:55:17 +00:00
|
|
|
@GDK_ACTION_ASK: Ask the user what to do with the data.
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
<!-- ##### FUNCTION gdk_drag_status ##### -->
|
|
|
|
<para>
|
2001-12-02 22:27:26 +00:00
|
|
|
Selects one of the actions offered by the drag source.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This function is called by the drag destination in response to
|
|
|
|
gdk_drag_motion() called by the drag source.
|
1999-08-16 18:51:52 +00:00
|
|
|
</para>
|
|
|
|
|
2001-12-02 22:27:26 +00:00
|
|
|
@context: a #GdkDragContext.
|
|
|
|
@action: the selected action which will be taken when a drop happens,
|
|
|
|
or 0 to indicate that a drop will not be accepted.
|
|
|
|
@time: the timestamp for this operation.
|
2001-12-23 22:55:17 +00:00
|
|
|
|
|
|
|
|