<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkDragSource">
<refmeta>
<refentrytitle role="top_of_page" id="GtkDragSource.top_of_page">GtkDragSource</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkDragSource</refname>
<refpurpose>Event controller to initiate DND operations</refpurpose>
</refnamediv>

<refsect1 id="GtkDragSource.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GtkDragSource"><returnvalue>GtkDragSource</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drag-source-new">gtk_drag_source_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-source-set-content">gtk_drag_source_set_content</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drag-source-get-content">gtk_drag_source_get_content</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-source-set-actions">gtk_drag_source_set_actions</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-source-get-actions">gtk_drag_source_get_actions</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-source-set-icon">gtk_drag_source_set_icon</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-source-drag-cancel">gtk_drag_source_drag_cancel</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDrag"><returnvalue>GdkDrag</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drag-source-get-drag">gtk_drag_source_get_drag</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-check-threshold">gtk_drag_check_threshold</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDragSource.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GdkDragAction"><type>GdkDragAction</type></link></entry><entry role="property_name"><link linkend="GtkDragSource--actions">actions</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkDragSource--content">content</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDragSource.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkDragSource-drag-begin">drag-begin</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkDragSource-drag-cancel">drag-cancel</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkDragSource-drag-end">drag-end</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>*</entry><entry role="signal_name"><link linkend="GtkDragSource-prepare">prepare</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDragSource.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkDragSource-struct">GtkDragSource</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDragSource.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkEventController">GtkEventController</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkGesture">GtkGesture</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkGestureSingle">GtkGestureSingle</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkDragSource
</screen>
</refsect1>

<refsect1 id="GtkDragSource.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkDragSource.description" role="desc">
<title role="desc.title">Description</title>
<para>GtkDragSource is an auxiliary object that is used to initiate
Drag-And-Drop operations. It can be set up with the necessary
ingredients for a DND operation ahead of time. This includes
the source for the data that is being transferred, in the form
of a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>, the desired action, and the icon to
use during the drag operation. After setting it up, the drag
source must be added to a widget as an event controller, using
<link linkend="gtk-widget-add-controller"><function>gtk_widget_add_controller()</function></link>.</para>
<para>Setting up the content provider and icon ahead of time only
makes sense when the data does not change. More commonly, you
will want to set them up just in time. To do so, <link linkend="GtkDragSource"><type>GtkDragSource</type></link>
has <link linkend="GtkDragSource-prepare"><type>“prepare”</type></link> and <link linkend="GtkDragSource-drag-begin"><type>“drag-begin”</type></link> signals.
The ::prepare signal is emitted before a drag is started, and
can be used to set the content provider and actions that the
drag should be started with. The ::drag-begin signal is emitted
after the <link linkend="GdkDrag"><type>GdkDrag</type></link> object has been created, and can be used
to set up the drag icon.</para>
<para>During the DND operation, GtkDragSource emits signals that
can be used to obtain updates about the status of the operation,
but it is not normally necessary to connect to any signals,
except for one case: when the supported actions include
<link linkend="GDK-ACTION-MOVE:CAPS"><literal>GDK_ACTION_MOVE</literal></link>, you need to listen for the
<link linkend="GtkDragSource-drag-end"><type>“drag-end”</type></link> signal and delete the
data after it has been transferred.</para>

</refsect1>
<refsect1 id="GtkDragSource.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-drag-source-new" role="function">
<title>gtk_drag_source_new&#160;()</title>
<indexterm zone="gtk-drag-source-new"><primary>gtk_drag_source_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkDragSource"><returnvalue>GtkDragSource</returnvalue></link>&#160;*
gtk_drag_source_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new <link linkend="GtkDragSource"><type>GtkDragSource</type></link> object.</para>
<refsect3 id="gtk-drag-source-new.returns" role="returns">
<title>Returns</title>
<para> the new <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-drag-source-set-content" role="function">
<title>gtk_drag_source_set_content&#160;()</title>
<indexterm zone="gtk-drag-source-set-content"><primary>gtk_drag_source_set_content</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drag_source_set_content (<parameter><link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source</parameter>,
                             <parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *content</parameter>);</programlisting>
<para>Sets a content provider on a <link linkend="GtkDragSource"><type>GtkDragSource</type></link>.</para>
<para>When the data is requested in the cause of a
DND operation, it will be obtained from the
content provider.</para>
<para>This function can be called before a drag is started,
or in a handler for the <link linkend="GtkDragSource-prepare"><type>“prepare”</type></link> signal.</para>
<para>You may consider setting the content provider back to
<link linkend="NULL:CAPS"><literal>NULL</literal></link> in a <link linkend="GtkDragSource-drag-end"><type>“drag-end”</type></link> signal handler.</para>
<refsect3 id="gtk-drag-source-set-content.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>content</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drag-source-get-content" role="function">
<title>gtk_drag_source_get_content&#160;()</title>
<indexterm zone="gtk-drag-source-get-content"><primary>gtk_drag_source_get_content</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
gtk_drag_source_get_content (<parameter><link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source</parameter>);</programlisting>
<para>Gets the current content provider of a <link linkend="GtkDragSource"><type>GtkDragSource</type></link>.</para>
<refsect3 id="gtk-drag-source-get-content.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drag-source-get-content.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> of <parameter>source</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drag-source-set-actions" role="function">
<title>gtk_drag_source_set_actions&#160;()</title>
<indexterm zone="gtk-drag-source-set-actions"><primary>gtk_drag_source_set_actions</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drag_source_set_actions (<parameter><link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source</parameter>,
                             <parameter><link linkend="GdkDragAction"><type>GdkDragAction</type></link> actions</parameter>);</programlisting>
<para>Sets the actions on the <link linkend="GtkDragSource"><type>GtkDragSource</type></link>.</para>
<para>During a DND operation, the actions are offered
to potential drop targets. If <parameter>actions</parameter>
 include
<link linkend="GDK-ACTION-MOVE:CAPS"><literal>GDK_ACTION_MOVE</literal></link>, you need to listen to the
<link linkend="GtkDragSource-drag-end"><type>“drag-end”</type></link> signal and handle
<parameter>delete_data</parameter>
 being <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.</para>
<para>This function can be called before a drag is started,
or in a handler for the <link linkend="GtkDragSource-prepare"><type>“prepare”</type></link> signal.</para>
<refsect3 id="gtk-drag-source-set-actions.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>actions</para></entry>
<entry role="parameter_description"><para>the actions to offer</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drag-source-get-actions" role="function">
<title>gtk_drag_source_get_actions&#160;()</title>
<indexterm zone="gtk-drag-source-get-actions"><primary>gtk_drag_source_get_actions</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
gtk_drag_source_get_actions (<parameter><link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source</parameter>);</programlisting>
<para>Gets the actions that are currently set on the <link linkend="GtkDragSource"><type>GtkDragSource</type></link>.</para>
<refsect3 id="gtk-drag-source-get-actions.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drag-source-get-actions.returns" role="returns">
<title>Returns</title>
<para> the actions set on <parameter>source</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="gtk-drag-source-set-icon" role="function">
<title>gtk_drag_source_set_icon&#160;()</title>
<indexterm zone="gtk-drag-source-set-icon"><primary>gtk_drag_source_set_icon</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drag_source_set_icon (<parameter><link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source</parameter>,
                          <parameter><link linkend="GdkPaintable"><type>GdkPaintable</type></link> *paintable</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> hot_x</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> hot_y</parameter>);</programlisting>
<para>Sets a paintable to use as icon during DND operations.</para>
<para>The hotspot coordinates determine the point on the icon
that gets aligned with the hotspot of the cursor.</para>
<para>If <parameter>paintable</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, a default icon is used.</para>
<para>This function can be called before a drag is started, or in
a <link linkend="GtkDragSource-prepare"><type>“prepare”</type></link> or <link linkend="GtkDragSource-drag-begin"><type>“drag-begin”</type></link> signal handler.</para>
<refsect3 id="gtk-drag-source-set-icon.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>paintable</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkPaintable"><type>GdkPaintable</type></link> to use as icon, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>hot_x</para></entry>
<entry role="parameter_description"><para>the hotspot X coordinate on the icon</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>hot_y</para></entry>
<entry role="parameter_description"><para>the hotspot Y coordinate on the icon</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drag-source-drag-cancel" role="function">
<title>gtk_drag_source_drag_cancel&#160;()</title>
<indexterm zone="gtk-drag-source-drag-cancel"><primary>gtk_drag_source_drag_cancel</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drag_source_drag_cancel (<parameter><link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source</parameter>);</programlisting>
<para>Cancels a currently ongoing drag operation.</para>
<refsect3 id="gtk-drag-source-drag-cancel.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drag-source-get-drag" role="function">
<title>gtk_drag_source_get_drag&#160;()</title>
<indexterm zone="gtk-drag-source-get-drag"><primary>gtk_drag_source_get_drag</primary></indexterm>
<programlisting language="C"><link linkend="GdkDrag"><returnvalue>GdkDrag</returnvalue></link>&#160;*
gtk_drag_source_get_drag (<parameter><link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source</parameter>);</programlisting>
<para>Returns the underlying <link linkend="GdkDrag"><type>GdkDrag</type></link> object for an ongoing drag.</para>
<refsect3 id="gtk-drag-source-get-drag.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drag-source-get-drag.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GdkDrag"><type>GdkDrag</type></link> of the current drag operation, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drag-check-threshold" role="function">
<title>gtk_drag_check_threshold&#160;()</title>
<indexterm zone="gtk-drag-check-threshold"><primary>gtk_drag_check_threshold</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_drag_check_threshold (<parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *widget</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> start_x</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> start_y</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> current_x</parameter>,
                          <parameter><link linkend="int"><type>int</type></link> current_y</parameter>);</programlisting>
<para>Checks to see if a mouse drag starting at (<parameter>start_x</parameter>
, <parameter>start_y</parameter>
) and ending
at (<parameter>current_x</parameter>
, <parameter>current_y</parameter>
) has passed the GTK drag threshold, and thus
should trigger the beginning of a drag-and-drop operation.</para>

<para><emphasis role="annotation">[<acronym>method</acronym>]</emphasis></para><refsect3 id="gtk-drag-check-threshold.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>widget</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkWidget"><type>GtkWidget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>start_x</para></entry>
<entry role="parameter_description"><para>X coordinate of start of drag</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>start_y</para></entry>
<entry role="parameter_description"><para>Y coordinate of start of drag</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>current_x</para></entry>
<entry role="parameter_description"><para>current X coordinate</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>current_y</para></entry>
<entry role="parameter_description"><para>current Y coordinate</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drag-check-threshold.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the drag threshold has been passed.</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkDragSource.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkDragSource-struct" role="struct">
<title>GtkDragSource</title>
<indexterm zone="GtkDragSource-struct"><primary>GtkDragSource</primary></indexterm>
<programlisting language="C">typedef struct _GtkDragSource GtkDragSource;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkDragSource.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkDragSource--actions" role="property"><title>The <literal>“actions”</literal> property</title>
<indexterm zone="GtkDragSource--actions"><primary>GtkDragSource:actions</primary></indexterm>
<programlisting>  “actions”                  <link linkend="GdkDragAction"><type>GdkDragAction</type></link></programlisting>
<para>The actions that are supported by drag operations from the source.</para>
<para>Note that you must handle the <link linkend="GtkDragSource-drag-end"><type>“drag-end”</type></link> signal
if the actions include <link linkend="GDK-ACTION-MOVE:CAPS"><literal>GDK_ACTION_MOVE</literal></link>.</para>
<para>Owner: GtkDragSource</para>
<para>Flags: Read / Write</para>
<para>Default value: GDK_ACTION_COPY</para>
</refsect2>
<refsect2 id="GtkDragSource--content" role="property"><title>The <literal>“content”</literal> property</title>
<indexterm zone="GtkDragSource--content"><primary>GtkDragSource:content</primary></indexterm>
<programlisting>  “content”                  <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>&#160;*</programlisting>
<para>The data that is offered by drag operations from this source,
in the form of a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>.</para>
<para>Owner: GtkDragSource</para>
<para>Flags: Read / Write</para>
</refsect2>

</refsect1>
<refsect1 id="GtkDragSource.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkDragSource-drag-begin" role="signal"><title>The <literal>“drag-begin”</literal> signal</title>
<indexterm zone="GtkDragSource-drag-begin"><primary>GtkDragSource::drag-begin</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source,
               <link linkend="GdkDrag"><type>GdkDrag</type></link>       *drag,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>The ::drag-begin signal is emitted on the drag source when a drag
is started. It can be used to e.g. set a custom drag icon with
<link linkend="gtk-drag-source-set-icon"><function>gtk_drag_source_set_icon()</function></link>.</para>
<refsect3 id="GtkDragSource-drag-begin.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>drag</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkDrag"><type>GdkDrag</type></link> object</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkDragSource-drag-cancel" role="signal"><title>The <literal>“drag-cancel”</literal> signal</title>
<indexterm zone="GtkDragSource-drag-cancel"><primary>GtkDragSource::drag-cancel</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
user_function (<link linkend="GtkDragSource"><type>GtkDragSource</type></link>      *source,
               <link linkend="GdkDrag"><type>GdkDrag</type></link>            *drag,
               <link linkend="GdkDragCancelReason"><type>GdkDragCancelReason</type></link> reason,
               <link linkend="gpointer"><type>gpointer</type></link>            user_data)</programlisting>
<para>The ::drag-cancel signal is emitted on the drag source when a drag has
failed. The signal handler may handle a failed drag operation based on
the type of error. It should return <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the failure has been handled
and the default "drag operation failed" animation should not be shown.</para>
<refsect3 id="GtkDragSource-drag-cancel.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>drag</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkDrag"><type>GdkDrag</type></link> object</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>reason</para></entry>
<entry role="parameter_description"><para>information on why the drag failed</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GtkDragSource-drag-cancel.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the failed drag operation has been already handled</para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkDragSource-drag-end" role="signal"><title>The <literal>“drag-end”</literal> signal</title>
<indexterm zone="GtkDragSource-drag-end"><primary>GtkDragSource::drag-end</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source,
               <link linkend="GdkDrag"><type>GdkDrag</type></link>       *drag,
               <link linkend="gboolean"><type>gboolean</type></link>       delete_data,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>The ::drag-end signal is emitted on the drag source when a drag is
finished. A typical reason to connect to this signal is to undo
things done in <link linkend="GtkDragSource-prepare"><type>“prepare”</type></link> or <link linkend="GtkDragSource-drag-begin"><type>“drag-begin”</type></link>.</para>
<refsect3 id="GtkDragSource-drag-end.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>drag</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkDrag"><type>GdkDrag</type></link> object</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>delete_data</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the drag was performing <link linkend="GDK-ACTION-MOVE:CAPS"><literal>GDK_ACTION_MOVE</literal></link>,
and the data should be deleted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkDragSource-prepare" role="signal"><title>The <literal>“prepare”</literal> signal</title>
<indexterm zone="GtkDragSource-prepare"><primary>GtkDragSource::prepare</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>*
user_function (<link linkend="GtkDragSource"><type>GtkDragSource</type></link> *source,
               <link linkend="gdouble"><type>gdouble</type></link>        x,
               <link linkend="gdouble"><type>gdouble</type></link>        y,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>The ::prepare signal is emitted when a drag is about to be initiated.
It returns the * <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> to use for the drag that is about
to start. The default handler for this signal returns the value of
the <link linkend="GtkDragSource--content"><type>“content”</type></link> property, so if you set up that property
ahead of time, you don't need to connect to this signal.</para>
<refsect3 id="GtkDragSource-prepare.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>source</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDragSource"><type>GtkDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>x</para></entry>
<entry role="parameter_description"><para>the X coordinate of the drag starting point</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>y</para></entry>
<entry role="parameter_description"><para>the Y coordinate fo the drag starting point</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GtkDragSource-prepare.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>

</refentry>
