<?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">
]>
<refentry id="gdk4-Drag-and-Drop">
<refmeta>
<refentrytitle role="top_of_page" id="gdk4-Drag-and-Drop.top_of_page">Drag And Drop</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Drag And Drop</refname>
<refpurpose>Functions for controlling drag and drop handling</refpurpose>
</refnamediv>

<refsect1 id="gdk4-Drag-and-Drop.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-drag-drop-done">gdk_drag_drop_done</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDragContext"><returnvalue>GdkDragContext</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-drag-begin">gdk_drag_begin</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-drag-context-get-display">gdk_drag_context_get_display</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="gdk-drag-context-get-actions">gdk_drag_context_get_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="gdk-drag-context-get-suggested-action">gdk_drag_context_get_suggested_action</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="gdk-drag-context-get-selected-action">gdk_drag_context_get_selected_action</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="gdk-drag-context-get-formats">gdk_drag_context_get_formats</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkDevice"><returnvalue>GdkDevice</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-drag-context-get-device">gdk_drag_context_get_device</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-drag-context-get-drag-surface">gdk_drag_context_get_drag_surface</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="gdk-drag-context-set-hotspot">gdk_drag_context_set_hotspot</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="gdk-drag-action-is-unique">gdk_drag_action_is_unique</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-Drag-and-Drop.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="GdkContentProvider"><type>GdkContentProvider</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkDragContext--content">content</link></entry><entry role="property_flags">Read / Write / Construct Only</entry></row>
<row><entry role="property_type"><link linkend="GdkDevice"><type>GdkDevice</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkDragContext--device">device</link></entry><entry role="property_flags">Read / Write / Construct Only</entry></row>
<row><entry role="property_type"><link linkend="GdkDisplay"><type>GdkDisplay</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkDragContext--display">display</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="GdkDragContext--formats">formats</link></entry><entry role="property_flags">Read / Write / Construct Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-Drag-and-Drop.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signals_return" colwidth="150px"/>
<colspec colname="signals_name" colwidth="300px"/>
<colspec colname="signals_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GdkDragContext-action-changed">action-changed</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="GdkDragContext-cancel">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="GdkDragContext-dnd-finished">dnd-finished</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="GdkDragContext-drop-performed">drop-performed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<anchor id="GdkDragContext"/><refsect1 id="gdk4-Drag-and-Drop.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="name" colwidth="150px"/>
<colspec colname="description"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkDragContext-struct">GdkDragContext</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GdkDragCancelReason">GdkDragCancelReason</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GdkDragAction">GdkDragAction</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GDK-ACTION-ALL:CAPS">GDK_ACTION_ALL</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-Drag-and-Drop.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> GdkDragContext
</screen>
</refsect1>

<refsect1 id="gdk4-Drag-and-Drop.includes"><title>Includes</title><synopsis>#include &lt;gdk/gdk.h&gt;
</synopsis></refsect1>

<refsect1 id="gdk4-Drag-and-Drop.description" role="desc">
<title role="desc.title">Description</title>
<para>These functions provide a low level interface for drag and drop.
The X backend of GDK supports both the Xdnd and Motif drag and drop
protocols transparently, the Win32 backend supports the WM_DROPFILES
protocol.</para>
<para>GTK+ provides a higher level abstraction based on top of these functions,
and so they are not normally needed in GTK+ applications.
See the <link linkend="gtk3-Drag-and-Drop">Drag and Drop</link> section of
the GTK+ documentation for more information.</para>

</refsect1>
<refsect1 id="gdk4-Drag-and-Drop.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-drag-drop-done" role="function">
<title>gdk_drag_drop_done&#160;()</title>
<indexterm zone="gdk-drag-drop-done"><primary>gdk_drag_drop_done</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_drag_drop_done (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>,
                    <parameter><link linkend="gboolean"><type>gboolean</type></link> success</parameter>);</programlisting>
<para>Inform GDK if the drop ended successfully. Passing <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
for <parameter>success</parameter>
 may trigger a drag cancellation animation.</para>
<para>This function is called by the drag source, and should
be the last call before dropping the reference to the
<parameter>context</parameter>
.</para>
<para>The <link linkend="GdkDragContext"><type>GdkDragContext</type></link> will only take the first <link linkend="gdk-drag-drop-done"><function>gdk_drag_drop_done()</function></link>
call as effective, if this function is called multiple times,
all subsequent calls will be ignored.</para>
<refsect3 id="gdk-drag-drop-done.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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>success</para></entry>
<entry role="parameter_description"><para>whether the drag was ultimatively successful</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-drag-begin" role="function">
<title>gdk_drag_begin&#160;()</title>
<indexterm zone="gdk-drag-begin"><primary>gdk_drag_begin</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragContext"><returnvalue>GdkDragContext</returnvalue></link>&#160;*
gdk_drag_begin (<parameter><link linkend="GdkSurface"><type>GdkSurface</type></link> *surface</parameter>,
                <parameter><link linkend="GdkDevice"><type>GdkDevice</type></link> *device</parameter>,
                <parameter><link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> *content</parameter>,
                <parameter><link linkend="GdkDragAction"><type>GdkDragAction</type></link> actions</parameter>,
                <parameter><link linkend="gint"><type>gint</type></link> dx</parameter>,
                <parameter><link linkend="gint"><type>gint</type></link> dy</parameter>);</programlisting>
<para>Starts a drag and creates a new drag context for it.</para>
<para>This function is called by the drag source.</para>
<refsect3 id="gdk-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>surface</para></entry>
<entry role="parameter_description"><para>the source surface for this drag</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>device</para></entry>
<entry role="parameter_description"><para>the device that controls this drag</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>content</para></entry>
<entry role="parameter_description"><para>the offered content. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>actions</para></entry>
<entry role="parameter_description"><para>the actions supported by this drag</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>dx</para></entry>
<entry role="parameter_description"><para>the x offset to <parameter>device</parameter>
's position where the drag nominally started</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>dy</para></entry>
<entry role="parameter_description"><para>the y offset to <parameter>device</parameter>
's position where the drag nominally started</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-begin.returns" role="returns">
<title>Returns</title>
<para>a newly created <link linkend="GdkDragContext"><type>GdkDragContext</type></link> or
<link linkend="NULL:CAPS"><literal>NULL</literal></link> on error. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>][<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-drag-context-get-display" role="function">
<title>gdk_drag_context_get_display&#160;()</title>
<indexterm zone="gdk-drag-context-get-display"><primary>gdk_drag_context_get_display</primary></indexterm>
<programlisting language="C"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
gdk_drag_context_get_display (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>);</programlisting>
<para>Gets the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> that the drag context was created for.</para>
<refsect3 id="gdk-drag-context-get-display.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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-context-get-display.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkDisplay"><type>GdkDisplay</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-drag-context-get-actions" role="function">
<title>gdk_drag_context_get_actions&#160;()</title>
<indexterm zone="gdk-drag-context-get-actions"><primary>gdk_drag_context_get_actions</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
gdk_drag_context_get_actions (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>);</programlisting>
<para>Determines the bitmask of actions proposed by the source if
<link linkend="gdk-drag-context-get-suggested-action"><function>gdk_drag_context_get_suggested_action()</function></link> returns <link linkend="GDK-ACTION-ASK:CAPS"><literal>GDK_ACTION_ASK</literal></link>.</para>
<refsect3 id="gdk-drag-context-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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-context-get-actions.returns" role="returns">
<title>Returns</title>
<para> the <link linkend="GdkDragAction"><type>GdkDragAction</type></link> flags</para>
</refsect3></refsect2>
<refsect2 id="gdk-drag-context-get-suggested-action" role="function">
<title>gdk_drag_context_get_suggested_action&#160;()</title>
<indexterm zone="gdk-drag-context-get-suggested-action"><primary>gdk_drag_context_get_suggested_action</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
gdk_drag_context_get_suggested_action (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>);</programlisting>
<para>Determines the suggested drag action of the context.</para>
<refsect3 id="gdk-drag-context-get-suggested-action.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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-context-get-suggested-action.returns" role="returns">
<title>Returns</title>
<para> a <link linkend="GdkDragAction"><type>GdkDragAction</type></link> value</para>
</refsect3></refsect2>
<refsect2 id="gdk-drag-context-get-selected-action" role="function">
<title>gdk_drag_context_get_selected_action&#160;()</title>
<indexterm zone="gdk-drag-context-get-selected-action"><primary>gdk_drag_context_get_selected_action</primary></indexterm>
<programlisting language="C"><link linkend="GdkDragAction"><returnvalue>GdkDragAction</returnvalue></link>
gdk_drag_context_get_selected_action (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>);</programlisting>
<para>Determines the action chosen by the drag destination.</para>
<refsect3 id="gdk-drag-context-get-selected-action.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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-context-get-selected-action.returns" role="returns">
<title>Returns</title>
<para> a <link linkend="GdkDragAction"><type>GdkDragAction</type></link> value</para>
</refsect3></refsect2>
<refsect2 id="gdk-drag-context-get-formats" role="function">
<title>gdk_drag_context_get_formats&#160;()</title>
<indexterm zone="gdk-drag-context-get-formats"><primary>gdk_drag_context_get_formats</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentFormats"><returnvalue>GdkContentFormats</returnvalue></link>&#160;*
gdk_drag_context_get_formats (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>);</programlisting>
<para>Retrieves the formats supported by this context.</para>
<refsect3 id="gdk-drag-context-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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-context-get-formats.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-drag-context-get-device" role="function">
<title>gdk_drag_context_get_device&#160;()</title>
<indexterm zone="gdk-drag-context-get-device"><primary>gdk_drag_context_get_device</primary></indexterm>
<programlisting language="C"><link linkend="GdkDevice"><returnvalue>GdkDevice</returnvalue></link>&#160;*
gdk_drag_context_get_device (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>);</programlisting>
<para>Returns the <link linkend="GdkDevice"><type>GdkDevice</type></link> associated to the drag context.</para>
<refsect3 id="gdk-drag-context-get-device.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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-context-get-device.returns" role="returns">
<title>Returns</title>
<para>The <link linkend="GdkDevice"><type>GdkDevice</type></link> associated to <parameter>context</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-drag-context-get-drag-surface" role="function">
<title>gdk_drag_context_get_drag_surface&#160;()</title>
<indexterm zone="gdk-drag-context-get-drag-surface"><primary>gdk_drag_context_get_drag_surface</primary></indexterm>
<programlisting language="C"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
gdk_drag_context_get_drag_surface (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>);</programlisting>
<para>Returns the surface on which the drag icon should be rendered
during the drag operation. Note that the surface may not be
available until the drag operation has begun. GDK will move
the surface in accordance with the ongoing drag operation.
The surface is owned by <parameter>context</parameter>
 and will be destroyed when
the drag operation is over.</para>
<refsect3 id="gdk-drag-context-get-drag-surface.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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-context-get-drag-surface.returns" role="returns">
<title>Returns</title>
<para>the drag surface, 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="gdk-drag-context-set-hotspot" role="function">
<title>gdk_drag_context_set_hotspot&#160;()</title>
<indexterm zone="gdk-drag-context-set-hotspot"><primary>gdk_drag_context_set_hotspot</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_drag_context_set_hotspot (<parameter><link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context</parameter>,
                              <parameter><link linkend="gint"><type>gint</type></link> hot_x</parameter>,
                              <parameter><link linkend="gint"><type>gint</type></link> hot_y</parameter>);</programlisting>
<para>Sets the position of the drag surface that will be kept
under the cursor hotspot. Initially, the hotspot is at the
top left corner of the drag surface.</para>
<refsect3 id="gdk-drag-context-set-hotspot.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>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragContext"><type>GdkDragContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>hot_x</para></entry>
<entry role="parameter_description"><para>x coordinate of the drag surface hotspot</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>hot_y</para></entry>
<entry role="parameter_description"><para>y coordinate of the drag surface hotspot</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-drag-action-is-unique" role="function">
<title>gdk_drag_action_is_unique&#160;()</title>
<indexterm zone="gdk-drag-action-is-unique"><primary>gdk_drag_action_is_unique</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_drag_action_is_unique (<parameter><link linkend="GdkDragAction"><type>GdkDragAction</type></link> action</parameter>);</programlisting>
<para>Checks if <parameter>action</parameter>
 represents a single action or if it
includes multiple flags that can be selected from.</para>
<para>When <parameter>action</parameter>
 is 0 - ie no action was given, <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>
is returned.</para>
<refsect3 id="gdk-drag-action-is-unique.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>action</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDragAction"><type>GdkDragAction</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-drag-action-is-unique.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if exactly one action was given</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="gdk4-Drag-and-Drop.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkDragContext-struct" role="struct">
<title>GdkDragContext</title>
<indexterm zone="GdkDragContext-struct"><primary>GdkDragContext</primary></indexterm>
<programlisting language="C">typedef struct _GdkDragContext GdkDragContext;</programlisting>
<para>The GdkDragContext struct contains only private fields and
should not be accessed directly.</para>
</refsect2>
<refsect2 id="GdkDragCancelReason" role="enum">
<title>enum GdkDragCancelReason</title>
<indexterm zone="GdkDragCancelReason"><primary>GdkDragCancelReason</primary></indexterm>
<para>Used in <link linkend="GdkDragContext"><type>GdkDragContext</type></link> to the reason of a cancelled DND operation.</para>
<refsect3 id="GdkDragCancelReason.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="GDK-DRAG-CANCEL-NO-TARGET:CAPS">GDK_DRAG_CANCEL_NO_TARGET</para></entry>
<entry role="enum_member_description"><para>There is no suitable drop target.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-DRAG-CANCEL-USER-CANCELLED:CAPS">GDK_DRAG_CANCEL_USER_CANCELLED</para></entry>
<entry role="enum_member_description"><para>Drag cancelled by the user</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-DRAG-CANCEL-ERROR:CAPS">GDK_DRAG_CANCEL_ERROR</para></entry>
<entry role="enum_member_description"><para>Unspecified error.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GdkDragAction" role="enum">
<title>enum GdkDragAction</title>
<indexterm zone="GdkDragAction"><primary>GdkDragAction</primary></indexterm>
<para>Used in <link linkend="GdkDragContext"><type>GdkDragContext</type></link> to indicate what the destination
should do with the dropped data.</para>
<refsect3 id="GdkDragAction.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="GDK-ACTION-COPY:CAPS">GDK_ACTION_COPY</para></entry>
<entry role="enum_member_description"><para>Copy the data.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-ACTION-MOVE:CAPS">GDK_ACTION_MOVE</para></entry>
<entry role="enum_member_description"><para>Move the data, i.e. first copy it, then delete
 it from the source using the DELETE target of the X selection protocol.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-ACTION-LINK:CAPS">GDK_ACTION_LINK</para></entry>
<entry role="enum_member_description"><para>Add a link to the data. Note that this is only
 useful if source and destination agree on what it means.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-ACTION-ASK:CAPS">GDK_ACTION_ASK</para></entry>
<entry role="enum_member_description"><para>Ask the user what to do with the data.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GDK-ACTION-ALL:CAPS" role="macro">
<title>GDK_ACTION_ALL</title>
<indexterm zone="GDK-ACTION-ALL:CAPS"><primary>GDK_ACTION_ALL</primary></indexterm>
<programlisting language="C">#define GDK_ACTION_ALL (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)
</programlisting>
<para>Defines all possible DND actions. This can be used in <link linkend="gdk-drop-status"><function>gdk_drop_status()</function></link>
messages when any drop can be accepted or a more specific drop method
is not yet known.</para>
</refsect2>

</refsect1>
<refsect1 id="gdk4-Drag-and-Drop.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GdkDragContext--content" role="property"><title>The <literal>“content”</literal> property</title>
<indexterm zone="GdkDragContext--content"><primary>GdkDragContext:content</primary></indexterm>
<programlisting>  “content”                  <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>&#160;*</programlisting>
<para>The <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the context is not a source-side
context.</para>
<para>Flags: Read / Write / Construct Only</para>
</refsect2>
<refsect2 id="GdkDragContext--device" role="property"><title>The <literal>“device”</literal> property</title>
<indexterm zone="GdkDragContext--device"><primary>GdkDragContext:device</primary></indexterm>
<programlisting>  “device”                   <link linkend="GdkDevice"><type>GdkDevice</type></link>&#160;*</programlisting>
<para>The <link linkend="GdkDevice"><type>GdkDevice</type></link> that is performing the drag.</para>
<para>Flags: Read / Write / Construct Only</para>
</refsect2>
<refsect2 id="GdkDragContext--display" role="property"><title>The <literal>“display”</literal> property</title>
<indexterm zone="GdkDragContext--display"><primary>GdkDragContext:display</primary></indexterm>
<programlisting>  “display”                  <link linkend="GdkDisplay"><type>GdkDisplay</type></link>&#160;*</programlisting>
<para>The <link linkend="GdkDisplay"><type>GdkDisplay</type></link> that the drag context belongs to.</para>
<para>Flags: Read</para>
</refsect2>
<refsect2 id="GdkDragContext--formats" role="property"><title>The <literal>“formats”</literal> property</title>
<indexterm zone="GdkDragContext--formats"><primary>GdkDragContext:formats</primary></indexterm>
<programlisting>  “formats”                  <link linkend="GdkContentFormats"><type>GdkContentFormats</type></link>&#160;*</programlisting>
<para>The possible formats that the context can provide its data in.</para>
<para>Flags: Read / Write / Construct Only</para>
</refsect2>

</refsect1>
<refsect1 id="gdk4-Drag-and-Drop.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GdkDragContext-action-changed" role="signal"><title>The <literal>“action-changed”</literal> signal</title>
<indexterm zone="GdkDragContext-action-changed"><primary>GdkDragContext::action-changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context,
               <link linkend="GdkDragAction"><type>GdkDragAction</type></link>   action,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>A new action is being chosen for the drag and drop operation.</para>
<refsect3 id="GdkDragContext-action-changed.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>context</para></entry>
<entry role="parameter_description"><para>The object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>action</para></entry>
<entry role="parameter_description"><para>The action currently chosen</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="GdkDragContext-cancel" role="signal"><title>The <literal>“cancel”</literal> signal</title>
<indexterm zone="GdkDragContext-cancel"><primary>GdkDragContext::cancel</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkDragContext"><type>GdkDragContext</type></link>     *context,
               <link linkend="GdkDragCancelReason"><type>GdkDragCancelReason</type></link> reason,
               <link linkend="gpointer"><type>gpointer</type></link>            user_data)</programlisting>
<para>The drag and drop operation was cancelled.</para>
<refsect3 id="GdkDragContext-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>context</para></entry>
<entry role="parameter_description"><para>The object on which the signal is emitted</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>reason</para></entry>
<entry role="parameter_description"><para>The reason the context was cancelled</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="GdkDragContext-dnd-finished" role="signal"><title>The <literal>“dnd-finished”</literal> signal</title>
<indexterm zone="GdkDragContext-dnd-finished"><primary>GdkDragContext::dnd-finished</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>The drag and drop operation was finished, the drag destination
finished reading all data. The drag source can now free all
miscellaneous data.</para>
<refsect3 id="GdkDragContext-dnd-finished.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>context</para></entry>
<entry role="parameter_description"><para>The object on which the signal is emitted</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="GdkDragContext-drop-performed" role="signal"><title>The <literal>“drop-performed”</literal> signal</title>
<indexterm zone="GdkDragContext-drop-performed"><primary>GdkDragContext::drop-performed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkDragContext"><type>GdkDragContext</type></link> *context,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>The drag and drop operation was performed on an accepting client.</para>
<refsect3 id="GdkDragContext-drop-performed.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>context</para></entry>
<entry role="parameter_description"><para>The object on which the signal is emitted</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>
</refsect1>

</refentry>
