<?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="GtkDropTarget">
<refmeta>
<refentrytitle role="top_of_page" id="GtkDropTarget.top_of_page">GtkDropTarget</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkDropTarget</refname>
<refpurpose>Event controller to receive DND drops</refpurpose>
</refnamediv>

<refsect1 id="GtkDropTarget.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="GtkDropTarget"><returnvalue>GtkDropTarget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drop-target-new">gtk_drop_target_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-drop-target-set-gtypes">gtk_drop_target_set_gtypes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="GType"><returnvalue>GType</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drop-target-get-gtypes">gtk_drop_target_get_gtypes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentFormats"><returnvalue>GdkContentFormats</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drop-target-get-formats">gtk_drop_target_get_formats</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-drop-target-set-actions">gtk_drop_target_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-drop-target-get-actions">gtk_drop_target_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-drop-target-set-preload">gtk_drop_target_set_preload</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-drop-target-get-preload">gtk_drop_target_get_preload</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDrop"><returnvalue>GdkDrop</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drop-target-get-drop">gtk_drop_target_get_drop</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="GValue"><returnvalue>GValue</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drop-target-get-value">gtk_drop_target_get_value</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-drop-target-reject">gtk_drop_target_reject</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDropTarget.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="GtkDropTarget--actions">actions</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GdkDrop"><type>GdkDrop</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkDropTarget--drop">drop</link></entry><entry role="property_flags">Read</entry></row>
<row><entry role="property_type"><link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkDropTarget--formats">formats</link></entry><entry role="property_flags">Read</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkDropTarget--preload">preload</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GValue"><type>GValue</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkDropTarget--value">value</link></entry><entry role="property_flags">Read</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDropTarget.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="gboolean"><returnvalue>gboolean</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkDropTarget-accept">accept</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="GtkDropTarget-drop">drop</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="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkDropTarget-enter">enter</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="GtkDropTarget-leave">leave</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="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkDropTarget-motion">motion</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDropTarget.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="GtkDropTarget-struct">GtkDropTarget</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDropTarget.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> GtkDropTarget
</screen>
</refsect1>

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

<refsect1 id="GtkDropTarget.description" role="desc">
<title role="desc.title">Description</title>
<para>GtkDropTarget is an event controller implementing a simple way to
receive Drag-and-Drop operations.</para>
<para>The most basic way to use a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> to receive drops on a
widget is to create it via <link linkend="gtk-drop-target-new"><function>gtk_drop_target_new()</function></link> passing in the
<link linkend="GType"><type>GType</type></link> of the data you want to receive and connect to the
GtkDropTarget::drop signal to receive the data.</para>
<para><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> supports more options, such as:</para>
<itemizedlist>
<listitem><para>rejecting potential drops via the <link linkend="GtkDropTarget-accept"><type>“accept”</type></link> signal
and the <link linkend="gtk-drop-target-reject"><function>gtk_drop_target_reject()</function></link> function to let other drop
targets handle the drop</para></listitem>
<listitem><para>tracking an ongoing drag operation before the drop via the
<link linkend="GtkDropTarget-enter"><type>“enter”</type></link>, <link linkend="GtkDropTarget-motion"><type>“motion”</type></link> and
<link linkend="GtkDropTarget-leave"><type>“leave”</type></link> signals</para></listitem>
<listitem>
<para>configuring how to receive data by setting the
<link linkend="GtkDropTarget--preload"><type>“preload”</type></link> property and listening for its availability
via the <link linkend="GtkDropTarget--value"><type>“value”</type></link> property</para>
</listitem>
</itemizedlist>
<para>However, <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> is ultimately modeled in a synchronous way
and only supports data transferred via <link linkend="GType"><type>GType</type></link>.  
If you want full control over an ongoing drop, the <link linkend="GtkDropTargetAsync"><type>GtkDropTargetAsync</type></link>
object gives you this ability.</para>
<para>While a pointer is dragged over the drop target's widget and the drop
has not been rejected, that widget will receive the
<link linkend="GTK-STATE-FLAG-DROP-ACTIVE:CAPS"><literal>GTK_STATE_FLAG_DROP_ACTIVE</literal></link> state, which can be used to style the widget.</para>

</refsect1>
<refsect1 id="GtkDropTarget.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-drop-target-new" role="function">
<title>gtk_drop_target_new&#160;()</title>
<indexterm zone="gtk-drop-target-new"><primary>gtk_drop_target_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkDropTarget"><returnvalue>GtkDropTarget</returnvalue></link>&#160;*
gtk_drop_target_new (<parameter><link linkend="GType"><type>GType</type></link> type</parameter>,
                     <parameter><link linkend="GdkDragAction"><type>GdkDragAction</type></link> actions</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> object.</para>
<para>If the drop target should support more than 1 type, pass
<link linkend="G-TYPE-INVALID:CAPS"><literal>G_TYPE_INVALID</literal></link> for <parameter>type</parameter>
 and then call
<link linkend="gtk-drop-target-set-gtypes"><function>gtk_drop_target_set_gtypes()</function></link>.</para>
<refsect3 id="gtk-drop-target-new.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>type</para></entry>
<entry role="parameter_description"><para>The supported type or <link linkend="G-TYPE-INVALID:CAPS"><literal>G_TYPE_INVALID</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>actions</para></entry>
<entry role="parameter_description"><para>the supported actions</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drop-target-new.returns" role="returns">
<title>Returns</title>
<para> the new <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-set-gtypes" role="function">
<title>gtk_drop_target_set_gtypes&#160;()</title>
<indexterm zone="gtk-drop-target-set-gtypes"><primary>gtk_drop_target_set_gtypes</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drop_target_set_gtypes (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>,
                            <parameter><link linkend="GType"><type>GType</type></link> *types</parameter>,
                            <parameter><link linkend="gsize"><type>gsize</type></link> n_types</parameter>);</programlisting>
<para>Sets the supported <link linkend="GTypes"><type>GTypes</type></link> for this drop target.</para>
<para>The GtkDropTarget::drop signal will</para>
<refsect3 id="gtk-drop-target-set-gtypes.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>types</para></entry>
<entry role="parameter_description"><para>all supported <link linkend="GTypes"><type>GTypes</type></link> that can be dropped. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>][<acronym>array</acronym> length=n_types]</emphasis></entry></row>
<row><entry role="parameter_name"><para>n_types</para></entry>
<entry role="parameter_description"><para>number of <parameter>types</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-get-gtypes" role="function">
<title>gtk_drop_target_get_gtypes&#160;()</title>
<indexterm zone="gtk-drop-target-get-gtypes"><primary>gtk_drop_target_get_gtypes</primary></indexterm>
<programlisting language="C">const <link linkend="GType"><returnvalue>GType</returnvalue></link>&#160;*
gtk_drop_target_get_gtypes (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>,
                            <parameter><link linkend="gsize"><type>gsize</type></link> *n_types</parameter>);</programlisting>
<para>Gets the list of supported <link linkend="GTypes"><type>GTypes</type></link> for <parameter>self</parameter>
. If no type have been set,
<link linkend="NULL:CAPS"><literal>NULL</literal></link> will be returned.</para>
<refsect3 id="gtk-drop-target-get-gtypes.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>n_types</para></entry>
<entry role="parameter_description"><para>optional pointer to take the
number of <link linkend="GTypes"><type>GTypes</type></link> contained in the return value. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>optional</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drop-target-get-gtypes.returns" role="returns">
<title>Returns</title>
<para><link linkend="G-TYPE-INVALID:CAPS"><literal>G_TYPE_INVALID</literal></link>-terminated array of types included in <parameter>formats</parameter>
or
<link linkend="NULL:CAPS"><literal>NULL</literal></link> if none. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>][<acronym>nullable</acronym>][<acronym>array</acronym> length=n_types]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-get-formats" role="function">
<title>gtk_drop_target_get_formats&#160;()</title>
<indexterm zone="gtk-drop-target-get-formats"><primary>gtk_drop_target_get_formats</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentFormats"><returnvalue>GdkContentFormats</returnvalue></link>&#160;*
gtk_drop_target_get_formats (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>);</programlisting>
<para>Gets the data formats that this drop target accepts.</para>
<para>If the result is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, all formats are expected to be supported.</para>
<refsect3 id="gtk-drop-target-get-formats.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drop-target-get-formats.returns" role="returns">
<title>Returns</title>
<para>the supported data formats. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-set-actions" role="function">
<title>gtk_drop_target_set_actions&#160;()</title>
<indexterm zone="gtk-drop-target-set-actions"><primary>gtk_drop_target_set_actions</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drop_target_set_actions (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>,
                             <parameter><link linkend="GdkDragAction"><type>GdkDragAction</type></link> actions</parameter>);</programlisting>
<para>Sets the actions that this drop target supports.</para>
<refsect3 id="gtk-drop-target-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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</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 supported actions</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-get-actions" role="function">
<title>gtk_drop_target_get_actions&#160;()</title>
<indexterm zone="gtk-drop-target-get-actions"><primary>gtk_drop_target_get_actions</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
gtk_drop_target_get_actions (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>);</programlisting>
<para>Gets the actions that this drop target supports.</para>
<refsect3 id="gtk-drop-target-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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drop-target-get-actions.returns" role="returns">
<title>Returns</title>
<para> the actions that this drop target supports</para>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-set-preload" role="function">
<title>gtk_drop_target_set_preload&#160;()</title>
<indexterm zone="gtk-drop-target-set-preload"><primary>gtk_drop_target_set_preload</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drop_target_set_preload (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>,
                             <parameter><link linkend="gboolean"><type>gboolean</type></link> preload</parameter>);</programlisting>
<para>Sets the GtkDropTarget:preload property.</para>
<refsect3 id="gtk-drop-target-set-preload.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>preload</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> to preload drop data</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-get-preload" role="function">
<title>gtk_drop_target_get_preload&#160;()</title>
<indexterm zone="gtk-drop-target-get-preload"><primary>gtk_drop_target_get_preload</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_drop_target_get_preload (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>);</programlisting>
<para>Gets the value of the GtkDropTarget:preload property.</para>
<refsect3 id="gtk-drop-target-get-preload.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drop-target-get-preload.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if drop data should be preloaded</para>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-get-drop" role="function">
<title>gtk_drop_target_get_drop&#160;()</title>
<indexterm zone="gtk-drop-target-get-drop"><primary>gtk_drop_target_get_drop</primary></indexterm>
<programlisting language="C"><link linkend="GdkDrop"><returnvalue>GdkDrop</returnvalue></link>&#160;*
gtk_drop_target_get_drop (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>);</programlisting>
<para>Gets the currently handled drop operation.</para>
<para>If no drop operation is going on, <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.</para>
<refsect3 id="gtk-drop-target-get-drop.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drop-target-get-drop.returns" role="returns">
<title>Returns</title>
<para>The current drop. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-get-value" role="function">
<title>gtk_drop_target_get_value&#160;()</title>
<indexterm zone="gtk-drop-target-get-value"><primary>gtk_drop_target_get_value</primary></indexterm>
<programlisting language="C">const <link linkend="GValue"><returnvalue>GValue</returnvalue></link>&#160;*
gtk_drop_target_get_value (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>);</programlisting>
<para>Gets the value of the GtkDropTarget:value porperty.</para>
<refsect3 id="gtk-drop-target-get-value.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drop-target-get-value.returns" role="returns">
<title>Returns</title>
<para>The current drop data. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drop-target-reject" role="function">
<title>gtk_drop_target_reject&#160;()</title>
<indexterm zone="gtk-drop-target-reject"><primary>gtk_drop_target_reject</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drop_target_reject (<parameter><link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self</parameter>);</programlisting>
<para>Rejects the ongoing drop operation.</para>
<para>If no drop operation is ongoing - when GdkDropTarget:drop
returns <link linkend="NULL:CAPS"><literal>NULL</literal></link> - this function does nothing.</para>
<para>This function should be used when delaying the decision
on whether to accept a drag or not until after reading
the data.</para>
<refsect3 id="gtk-drop-target-reject.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>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkDropTarget.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkDropTarget--actions" role="property"><title>The <literal>“actions”</literal> property</title>
<indexterm zone="GtkDropTarget--actions"><primary>GtkDropTarget:actions</primary></indexterm>
<programlisting>  “actions”                  <link linkend="GdkDragAction"><type>GdkDragAction</type></link></programlisting>
<para>The <link linkend="GdkDragActions"><type>GdkDragActions</type></link> that this drop target supports</para>
<para>Owner: GtkDropTarget</para>
<para>Flags: Read / Write</para>
</refsect2>
<refsect2 id="GtkDropTarget--drop" role="property"><title>The <literal>“drop”</literal> property</title>
<indexterm zone="GtkDropTarget--drop"><primary>GtkDropTarget:drop</primary></indexterm>
<programlisting>  “drop”                     <link linkend="GdkDrop"><type>GdkDrop</type></link>&#160;*</programlisting>
<para>The <link linkend="GdkDrop"><type>GdkDrop</type></link> that is currently being performed</para>
<para>Owner: GtkDropTarget</para>
<para>Flags: Read</para>
</refsect2>
<refsect2 id="GtkDropTarget--formats" role="property"><title>The <literal>“formats”</literal> property</title>
<indexterm zone="GtkDropTarget--formats"><primary>GtkDropTarget:formats</primary></indexterm>
<programlisting>  “formats”                  <link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>&#160;*</programlisting>
<para>The <link linkend="GdkContentFormats"><type>GdkContentFormats</type></link> that determine the supported data formats</para>
<para>Owner: GtkDropTarget</para>
<para>Flags: Read</para>
</refsect2>
<refsect2 id="GtkDropTarget--preload" role="property"><title>The <literal>“preload”</literal> property</title>
<indexterm zone="GtkDropTarget--preload"><primary>GtkDropTarget:preload</primary></indexterm>
<programlisting>  “preload”                  <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the drop data should be preloaded when the pointer is only
hovering over the widget but has not been released.</para>
<para>Setting this property allows finer grained reaction to an ongoing
drop at the cost of loading more data.</para>
<para>The default value for this property is <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> to avoid downloading
huge amounts of data by accident.

For example, if somebody drags a full document of gigabytes of text
from a text editor across a widget with a preloading drop target,
this data will be downloaded, even if the data is ultimately dropped
elsewhere.</para>
<para>For a lot of data formats, the amount of data is very small (like
<link linkend="GDK-TYPE-RGBA:CAPS"><literal>GDK_TYPE_RGBA</literal></link>), so enabling this property does not hurt at all.

And for local-only drag'n'drop operations, no data transfer is done,
so enabling it there is free.</para>
<para>Owner: GtkDropTarget</para>
<para>Flags: Read / Write</para>
<para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkDropTarget--value" role="property"><title>The <literal>“value”</literal> property</title>
<indexterm zone="GtkDropTarget--value"><primary>GtkDropTarget:value</primary></indexterm>
<programlisting>  “value”                    <link linkend="GValue"><type>GValue</type></link>&#160;*</programlisting>
<para>The value for this drop operation or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the data has not been
loaded yet or no drop operation is going on.</para>
<para>Data may be available before the GtkDropTarget::drop signal gets emitted -
for example when the GtkDropTarget:preload property is set.
You can use the GObject::notify signal to be notified of available data.</para>
<para>Owner: GtkDropTarget</para>
<para>Flags: Read</para>
</refsect2>

</refsect1>
<refsect1 id="GtkDropTarget.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkDropTarget-accept" role="signal"><title>The <literal>“accept”</literal> signal</title>
<indexterm zone="GtkDropTarget-accept"><primary>GtkDropTarget::accept</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
user_function (<link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self,
               <link linkend="GdkDrop"><type>GdkDrop</type></link>       *drop,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>The ::accept signal is emitted on the drop site when a drop operation
is about to begin.

If the drop is not accepted, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> will be returned and the drop target
will ignore the drop. If <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> is returned, the drop is accepted for now
but may be rejected later via a call to <link linkend="gtk-drop-target-reject"><function>gtk_drop_target_reject()</function></link> or
ultimately by returning <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> from GtkDropTarget::drop</para>
<para>The default handler for this signal decides whether to accept the drop
based on the formats provided by the <parameter>drop</parameter>
.</para>
<para>If the decision whether the drop will be accepted or rejected needs
inspecting the data, this function should return <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, the

GtkDropTarget:preload property should be set and the value
should be inspected via the GObject::notify:value signal and then call
<link linkend="gtk-drop-target-reject"><function>gtk_drop_target_reject()</function></link>.</para>
<refsect3 id="GtkDropTarget-accept.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>self</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>drop</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkDrop"><type>GdkDrop</type></link></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="GtkDropTarget-accept.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>drop</parameter>
is accepted</para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkDropTarget-drop" role="signal"><title>The <literal>“drop”</literal> signal</title>
<indexterm zone="GtkDropTarget-drop"><primary>GtkDropTarget::drop</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
user_function (<link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self,
               <link linkend="GValue"><type>GValue</type></link>        *value,
               <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 ::drop signal is emitted on the drop site when the user drops
the data onto the widget. The signal handler must determine whether
the pointer position is in a drop zone or not. If it is not in a drop
zone, it returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> and no further processing is necessary.</para>
<para>Otherwise, the handler returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>. In this case, this handler will
accept the drop. The handler is responsible for rading the given <parameter>value</parameter>

and performing the drop operation.</para>
<refsect3 id="GtkDropTarget-drop.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>self</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the <link linkend="GValue"><type>GValue</type></link> being dropped</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 current pointer position</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 of the current pointer position</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="GtkDropTarget-drop.returns" role="returns">
<title>Returns</title>
<para> whether the drop was accepted at the given pointer position</para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkDropTarget-enter" role="signal"><title>The <literal>“enter”</literal> signal</title>
<indexterm zone="GtkDropTarget-enter"><primary>GtkDropTarget::enter</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
user_function (<link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self,
               <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 ::enter signal is emitted on the drop site when the pointer
enters the widget. It can be used to set up custom highlighting.</para>
<refsect3 id="GtkDropTarget-enter.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>self</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDropTarget"><type>GtkDropTarget</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 current pointer position</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 of the current pointer position</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="GtkDropTarget-enter.returns" role="returns">
<title>Returns</title>
<para> Preferred action for this drag operation or 0 if dropping is not
supported at the current <parameter>x</parameter>
,<parameter>y</parameter>
location.</para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkDropTarget-leave" role="signal"><title>The <literal>“leave”</literal> signal</title>
<indexterm zone="GtkDropTarget-leave"><primary>GtkDropTarget::leave</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self,
               <link linkend="gpointer"><type>gpointer</type></link>       user_data)</programlisting>
<para>The ::leave signal is emitted on the drop site when the pointer
leaves the widget. Its main purpose it to undo things done in
<link linkend="GtkDropTarget-enter"><type>“enter”</type></link>.</para>
<refsect3 id="GtkDropTarget-leave.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>self</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDropTarget"><type>GtkDropTarget</type></link></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="GtkDropTarget-motion" role="signal"><title>The <literal>“motion”</literal> signal</title>
<indexterm zone="GtkDropTarget-motion"><primary>GtkDropTarget::motion</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
user_function (<link linkend="GtkDropTarget"><type>GtkDropTarget</type></link> *self,
               <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 ::motion signal is emitted while the pointer is moving
over the drop target.</para>
<refsect3 id="GtkDropTarget-motion.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>self</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDropTarget"><type>GtkDropTarget</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 current pointer position</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 of the current pointer position</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="GtkDropTarget-motion.returns" role="returns">
<title>Returns</title>
<para> Preferred action for this drag operation or 0 if dropping is not
supported at the current <parameter>x</parameter>
,<parameter>y</parameter>
location.</para>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>
<refsect1 id="GtkDropTarget.see-also">
<title>See Also</title>
<para><link linkend="GdkDrop"><type>GdkDrop</type></link>, <link linkend="GtkDropTargetAsync"><type>GtkDropTargetAsync</type></link></para>

</refsect1>

</refentry>
