Description
GTK+ has a rich set of functions for doing inter-process
communication via the drag-and-drop metaphore. GTK+
can do drag and drop (DND) via multiple protocols.
The currently supported protocols are the Xdnd and
Motif protocols.
As well as the functions listed here, applications
may need to use some facilities provided for
Selections.
Also, the Drag and Drop API makes use of signals
in the GtkWidget class.
Details
enum GtkDestDefaults
typedef enum {
GTK_DEST_DEFAULT_MOTION = 1 << 0, /* respond to "drag_motion" */
GTK_DEST_DEFAULT_HIGHLIGHT = 1 << 1, /* auto-highlight */
GTK_DEST_DEFAULT_DROP = 1 << 2, /* respond to "drag_drop" */
GTK_DEST_DEFAULT_ALL = 0x07
} GtkDestDefaults; |
The GtkDestfaults enumeration specifies the various
types of action that will be taken on behalf
of the user for a drag destination site.
enum GtkTargetFlags
typedef enum {
GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/
} GtkTargetFlags; |
The GtkTargetFlags enumeration is used to specifies
constraints on an entry in a GtkTargetTable.
- GTK_TARGET_SAME_APP
If this is set, the target will only be selected
for drags within a single application.
- GTK_TARGET_SAME_WIDGET
If this is set, the target will only be selected
for drags within a single widget.
gtk_drag_dest_set ()
Set a widget as a potential drop destination.
gtk_drag_dest_set_proxy ()
Set this widget as a proxy for drops to another window.
gtk_drag_dest_unset ()
void gtk_drag_dest_unset (GtkWidget *widget); |
Clear information about a drop destination set with
gtk_drag_dest_set(). The widget will no longer receive
notification of drags.
gtk_drag_finish ()
Inform the drag source that the drop is finished, and
that the data of the drag will no longer be required.
gtk_drag_get_data ()
Get the data associated with a drag. When the data
is received or the retrieval fails, GTK+ will emit a
"drag_data_received" signal. Failure of the retrieval
is indicated by the length field of the selection_data
signal parameter being negative. However, when gtk_drag_get_data()
is called implicitely because the GTK_DRAG_DEFAULT_DROP was set,
then the widget will not receive notification of failed
drops.
gtk_drag_get_source_widget ()
Determine the source widget for a drag.
gtk_drag_highlight ()
Draw a highlight around a widget. This will attach
handlers to "expose_event" and "draw", so the highlight
will continue to be displayed until gtk_drag_unhighlight
is called.
gtk_drag_unhighlight ()
void gtk_drag_unhighlight (GtkWidget *widget); |
Remove a highlight set by gtk_drag_highlight() from
a widget.
is called.
gtk_drag_begin ()
Initiate a drag on the source side. The function
only needs to be used when the application is
starting drags itself, and is not needed when
gtk_drag_source_set() is used.
gtk_drag_set_icon_widget ()
Change the icon for a widget to a given widget. GTK+
will not destroy the icon, so if you don't want
it to persist, you should connect to the "drag_end"
signal and destroy it yourself.
gtk_drag_set_icon_pixmap ()
Sets a given pixmap as the icon for a given drag.
GTK+ retains a reference count for the arguments, and
will release them when they are no longer needed.
gtk_drag_set_icon_default ()
Set the icon for a particular drag to the default
icon.
gtk_drag_set_default_icon ()
Change the default drag icon. GTK+ retains a reference count for the
arguments, and will release them when they are no longer needed.
gtk_drag_source_set ()
Sets up a widget so that GTK+ will start a drag
operation when the user clicks and drags on the
widget. The widget must have a window.
gtk_drag_source_set_icon ()
Sets the icon that will be used for drags from a
particular widget. GTK+ retains a reference count
for the arguments, and will release them when
they are no longer needed.
gtk_drag_source_handle_event ()
Internal function.
gtk_drag_dest_handle_event ()
Internal function.