Sets our main struct and passes it to the parent class
Informs the drag source that the drop is finished, and that the data of the drag will no longer be required.
Determines the source widget for a drag. Determines the source widget for a drag.
the main Gtk struct as a void*
Sets the icon for a particular drag to the default icon.
Sets the icon for a given drag from a named themed icon. See the docs for GtkIconTheme for more details. Note that the size of the icon depends on the icon theme (the icon is loaded at the symbolic size GTK_ICON_SIZE_DND), thus hot_x and hot_y have to be used with care. Since 2.8
Sets pixbuf as the icon for a given drag.
Sets pixmap as the icon for a given drag. GTK+ retains references for the arguments, and will release them when they are no longer needed. In general, gtk_drag_set_icon_pixbuf() will be more convenient to use.
Sets the icon for a given drag from a stock ID.
Changes 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.
Initiates 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. The event is used to retrieve the timestamp that will be used internally to grab the pointer. If event is NULL, then GDK_CURRENT_TIME will be used. However, you should try to pass a real event in all cases, since that can be used by GTK+ to get information about the start position of the drag, for example if the event is a GDK_MOTION_NOTIFY. Generally there are three cases when you want to start a drag by hand by calling
Checks to see if a mouse drag starting at (start_x, start_y) and ending at (current_x, current_y) has passed the GTK+ drag threshold, and thus should trigger the beginning of a drag-and-drop operation.
Add the image targets supported by GtkSelection to the target list of the drag destination. The targets are added with info = 0. If you need another value, use gtk_target_list_add_image_targets() and gtk_drag_dest_set_target_list(). Since 2.6
Add the text targets supported by GtkSelection to the target list of the drag destination. The targets are added with info = 0. If you need another value, use gtk_target_list_add_text_targets() and gtk_drag_dest_set_target_list(). Since 2.6
Add the URI targets supported by GtkSelection to the target list of the drag destination. The targets are added with info = 0. If you need another value, use gtk_target_list_add_uri_targets() and gtk_drag_dest_set_target_list(). Since 2.6
Returns the list of targets this widget can accept from drag-and-drop.
Returns whether the widget has been configured to always emit ::drag-motion signals. Since 2.10
Sets a widget as a potential drop destination, and adds default behaviors. The default behaviors listed in flags have an effect similar to installing default handlers for the widget's drag-and-drop signals ("drag-motion", "drag-drop", ...). They all exist for convenience. When passing GTK_DEST_DEFAULT_ALL for instance it is sufficient to connect to the widget's "drag-data-received" signal to get primitive, but consistent drag-and-drop support. Things become more complicated when you try to preview the dragged data, as described in the documentation for "drag-motion". The default behaviors described by flags make some assumptions, that can conflict with your own signal handlers. For instance GTK_DEST_DEFAULT_DROP causes invokations of gdk_drag_status() in the context of "drag-motion", and invokations of gtk_drag_finish() in "drag-data-received". Especially the later is dramatic, when your own "drag-motion" handler calls gtk_drag_get_data() to inspect the dragged data. There's no way to set a default action here, you can use the "drag-motion" callback for that. Here's an example which selects
Sets this widget as a proxy for drops to another window.
Sets the target types that this widget can accept from drag-and-drop. The widget must first be made into a drag destination with gtk_drag_dest_set().
Tells the widget to emit ::drag-motion and ::drag-leave events regardless of the targets and the GTK_DEST_DEFAULT_MOTION flag. This may be used when a widget wants to do generic actions regardless of the targets that the source offers. Since 2.10
Clears information about a drop destination set with gtk_drag_dest_set(). The widget will no longer receive notification of drags.
Gets 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_DEST_DEFAULT_DROP was set, then the widget will not receive notification of failed drops.
Draws 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.
Warning gtk_drag_set_default_icon is deprecated and should not be used in newly-written code. Change the default drag icon via the stock system by changing the stock pixbuf for GTK_STOCK_DND instead. Changes the default drag icon. GTK+ retains references for the arguments, and will release them when they are no longer needed.
Add the writable image targets supported by GtkSelection to the target list of the drag source. The targets are added with info = 0. If you need another value, use gtk_target_list_add_image_targets() and gtk_drag_source_set_target_list(). Since 2.6
Add the text targets supported by GtkSelection to the target list of the drag source. The targets are added with info = 0. If you need another value, use gtk_target_list_add_text_targets() and gtk_drag_source_set_target_list(). Since 2.6
Add the URI targets supported by GtkSelection to the target list of the drag source. The targets are added with info = 0. If you need another value, use gtk_target_list_add_uri_targets() and gtk_drag_source_set_target_list(). Since 2.6
Gets the list of targets this widget can provide for drag-and-drop. Since 2.4
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.
Sets the icon that will be used for drags from a particular widget from a pixmap/mask. GTK+ retains references for the arguments, and will release them when they are no longer needed. Use gtk_drag_source_set_icon_pixbuf() instead.
Sets the icon that will be used for drags from a particular source to a themed icon. See the docs for GtkIconTheme for more details. Since 2.8
Sets the icon that will be used for drags from a particular widget from a GdkPixbuf. GTK+ retains a reference for pixbuf and will release it when it is no longer needed.
Sets the icon that will be used for drags from a particular source to a stock icon.
Changes the target types that this widget offers for drag-and-drop. The widget must first be made into a drag source with gtk_drag_source_set(). Since 2.4
Undoes the effects of gtk_drag_source_set().
Removes a highlight set by gtk_drag_highlight() from a widget.
the main Gtk struct
Description GTK+ has a rich set of functions for doing inter-process communication via the drag-and-drop metaphor. 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.