gtk3/docs/reference/gtk/html/gtk3-Drag-and-Drop.html
2022-11-23 15:09:27 +00:00

2124 lines
109 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Drag and Drop: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="gtkbase.html" title="Part III. GTK+ Core Reference">
<link rel="prev" href="gtk3-Clipboards.html" title="Clipboards">
<link rel="next" href="GtkSettings.html" title="Settings">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#gtk3-Drag-and-Drop.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gtk3-Clipboards.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkSettings.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk3-Drag-and-Drop"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-Drag-and-Drop.top_of_page"></a>Drag and Drop</span></h2>
<p>Drag and Drop — Functions for controlling drag and drop handling</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gtk3-Drag-and-Drop.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set" title="gtk_drag_dest_set ()">gtk_drag_dest_set</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set-proxy" title="gtk_drag_dest_set_proxy ()">gtk_drag_dest_set_proxy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-unset" title="gtk_drag_dest_unset ()">gtk_drag_dest_unset</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkAtom</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-find-target" title="gtk_drag_dest_find_target ()">gtk_drag_dest_find_target</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="returnvalue">GtkTargetList</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-get-target-list" title="gtk_drag_dest_get_target_list ()">gtk_drag_dest_get_target_list</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set-target-list" title="gtk_drag_dest_set_target_list ()">gtk_drag_dest_set_target_list</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-add-text-targets" title="gtk_drag_dest_add_text_targets ()">gtk_drag_dest_add_text_targets</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-add-image-targets" title="gtk_drag_dest_add_image_targets ()">gtk_drag_dest_add_image_targets</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-add-uri-targets" title="gtk_drag_dest_add_uri_targets ()">gtk_drag_dest_add_uri_targets</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set-track-motion" title="gtk_drag_dest_set_track_motion ()">gtk_drag_dest_set_track_motion</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-get-track-motion" title="gtk_drag_dest_get_track_motion ()">gtk_drag_dest_get_track_motion</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-finish" title="gtk_drag_finish ()">gtk_drag_finish</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-get-data" title="gtk_drag_get_data ()">gtk_drag_get_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-get-source-widget" title="gtk_drag_get_source_widget ()">gtk_drag_get_source_widget</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-highlight" title="gtk_drag_highlight ()">gtk_drag_highlight</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-unhighlight" title="gtk_drag_unhighlight ()">gtk_drag_unhighlight</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkDragContext</span> *
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-begin" title="gtk_drag_begin ()">gtk_drag_begin</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkDragContext</span> *
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-begin-with-coordinates" title="gtk_drag_begin_with_coordinates ()">gtk_drag_begin_with_coordinates</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-cancel" title="gtk_drag_cancel ()">gtk_drag_cancel</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-widget" title="gtk_drag_set_icon_widget ()">gtk_drag_set_icon_widget</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-pixbuf" title="gtk_drag_set_icon_pixbuf ()">gtk_drag_set_icon_pixbuf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-stock" title="gtk_drag_set_icon_stock ()">gtk_drag_set_icon_stock</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-surface" title="gtk_drag_set_icon_surface ()">gtk_drag_set_icon_surface</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-name" title="gtk_drag_set_icon_name ()">gtk_drag_set_icon_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-gicon" title="gtk_drag_set_icon_gicon ()">gtk_drag_set_icon_gicon</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-default" title="gtk_drag_set_icon_default ()">gtk_drag_set_icon_default</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-check-threshold" title="gtk_drag_check_threshold ()">gtk_drag_check_threshold</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set" title="gtk_drag_source_set ()">gtk_drag_source_set</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-icon-pixbuf" title="gtk_drag_source_set_icon_pixbuf ()">gtk_drag_source_set_icon_pixbuf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-icon-stock" title="gtk_drag_source_set_icon_stock ()">gtk_drag_source_set_icon_stock</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-icon-name" title="gtk_drag_source_set_icon_name ()">gtk_drag_source_set_icon_name</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-icon-gicon" title="gtk_drag_source_set_icon_gicon ()">gtk_drag_source_set_icon_gicon</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-unset" title="gtk_drag_source_unset ()">gtk_drag_source_unset</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-target-list" title="gtk_drag_source_set_target_list ()">gtk_drag_source_set_target_list</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="returnvalue">GtkTargetList</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-get-target-list" title="gtk_drag_source_get_target_list ()">gtk_drag_source_get_target_list</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-add-text-targets" title="gtk_drag_source_add_text_targets ()">gtk_drag_source_add_text_targets</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-add-image-targets" title="gtk_drag_source_add_image_targets ()">gtk_drag_source_add_image_targets</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-add-uri-targets" title="gtk_drag_source_add_uri_targets ()">gtk_drag_source_add_uri_targets</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-Drag-and-Drop.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="gtk3-Drag-and-Drop.html#GtkDestDefaults" title="enum GtkDestDefaults">GtkDestDefaults</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="gtk3-Drag-and-Drop.html#GtkTargetFlags" title="enum GtkTargetFlags">GtkTargetFlags</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="gtk3-Drag-and-Drop.html#GtkDragResult" title="enum GtkDragResult">GtkDragResult</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-Drag-and-Drop.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gtk3-Drag-and-Drop.description"></a><h2>Description</h2>
<p>GTK+ has a rich set of functions for doing inter-process communication
via the drag-and-drop metaphor.</p>
<p>As well as the functions listed here, applications may need to use some
facilities provided for <a class="link" href="gtk3-Selections.html" title="Selections">Selections</a>. Also, the Drag and
Drop API makes use of signals in the <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> class.</p>
</div>
<div class="refsect1">
<a name="gtk3-Drag-and-Drop.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-drag-dest-set"></a><h3>gtk_drag_dest_set ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_set (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><a class="link" href="gtk3-Drag-and-Drop.html#GtkDestDefaults" title="enum GtkDestDefaults"><span class="type">GtkDestDefaults</span></a> flags</code></em>,
<em class="parameter"><code>const <a class="link" href="gtk3-Selections.html#GtkTargetEntry" title="struct GtkTargetEntry"><span class="type">GtkTargetEntry</span></a> *targets</code></em>,
<em class="parameter"><code><span class="type">gint</span> n_targets</code></em>,
<em class="parameter"><code><span class="type">GdkDragAction</span> actions</code></em>);</pre>
<p>Sets a widget as a potential drop destination, and adds default behaviors.</p>
<p>The default behaviors listed in <em class="parameter"><code>flags</code></em>
have an effect similar
to installing default handlers for the widgets drag-and-drop signals
(<a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a>, <a class="link" href="GtkWidget.html#GtkWidget-drag-drop" title="The “drag-drop” signal"><span class="type">“drag-drop”</span></a>, ...). They all exist
for convenience. When passing <a class="link" href="gtk3-Drag-and-Drop.html#GTK-DEST-DEFAULT-ALL:CAPS"><span class="type">GTK_DEST_DEFAULT_ALL</span></a> for instance it is
sufficient to connect to the widgets <a class="link" href="GtkWidget.html#GtkWidget-drag-data-received" title="The “drag-data-received” signal"><span class="type">“drag-data-received”</span></a>
signal to get primitive, but consistent drag-and-drop support.</p>
<p>Things become more complicated when you try to preview the dragged data,
as described in the documentation for <a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a>. The default
behaviors described by <em class="parameter"><code>flags</code></em>
make some assumptions, that can conflict
with your own signal handlers. For instance <a class="link" href="gtk3-Drag-and-Drop.html#GTK-DEST-DEFAULT-DROP:CAPS"><span class="type">GTK_DEST_DEFAULT_DROP</span></a> causes
invokations of <code class="function">gdk_drag_status()</code> in the context of <a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a>,
and invokations of <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-finish" title="gtk_drag_finish ()"><code class="function">gtk_drag_finish()</code></a> in <a class="link" href="GtkWidget.html#GtkWidget-drag-data-received" title="The “drag-data-received” signal"><span class="type">“drag-data-received”</span></a>.
Especially the later is dramatic, when your own <a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a>
handler calls <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-get-data" title="gtk_drag_get_data ()"><code class="function">gtk_drag_get_data()</code></a> to inspect the dragged data.</p>
<p>Theres no way to set a default action here, you can use the
<a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a> callback for that. Heres an example which selects
the action to use depending on whether the control key is pressed or not:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="k">static</span><span class="w"> </span><span class="kt">void</span><span class="w"></span>
<span class="nf">drag_motion</span><span class="w"> </span><span class="p">(</span><span class="n">GtkWidget</span><span class="w"> </span><span class="o">*</span><span class="n">widget</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">GdkDragContext</span><span class="w"> </span><span class="o">*</span><span class="n">context</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">gint</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">gint</span><span class="w"> </span><span class="n">y</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">guint</span><span class="w"> </span><span class="n">time</span><span class="p">)</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="n">GdkModifierType</span><span class="w"> </span><span class="n">mask</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">gdk_window_get_pointer</span><span class="w"> </span><span class="p">(</span><span class="n">gtk_widget_get_window</span><span class="w"> </span><span class="p">(</span><span class="n">widget</span><span class="p">),</span><span class="w"></span>
<span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">mask</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">mask</span><span class="w"> </span><span class="o">&amp;</span><span class="w"> </span><span class="n">GDK_CONTROL_MASK</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">gdk_drag_status</span><span class="w"> </span><span class="p">(</span><span class="n">context</span><span class="p">,</span><span class="w"> </span><span class="n">GDK_ACTION_COPY</span><span class="p">,</span><span class="w"> </span><span class="n">time</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="k">else</span><span class="w"></span>
<span class="w"> </span><span class="n">gdk_drag_status</span><span class="w"> </span><span class="p">(</span><span class="n">context</span><span class="p">,</span><span class="w"> </span><span class="n">GDK_ACTION_MOVE</span><span class="p">,</span><span class="w"> </span><span class="n">time</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-set.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>which types of default drag behavior to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>targets</p></td>
<td class="parameter_description"><p>a pointer to an array of
<a href="gtk3-Selections.html#GtkTargetEntry"><span class="type">GtkTargetEntrys</span></a> indicating the drop types that this <em class="parameter"><code>widget</code></em>
will
accept, or <code class="literal">NULL</code>. Later you can access the list with
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-get-target-list" title="gtk_drag_dest_get_target_list ()"><code class="function">gtk_drag_dest_get_target_list()</code></a> and <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-find-target" title="gtk_drag_dest_find_target ()"><code class="function">gtk_drag_dest_find_target()</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_targets]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_targets</p></td>
<td class="parameter_description"><p>the number of entries in <em class="parameter"><code>targets</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>actions</p></td>
<td class="parameter_description"><p>a bitmask of possible actions for a drop onto this <em class="parameter"><code>widget</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-set-proxy"></a><h3>gtk_drag_dest_set_proxy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_set_proxy (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GdkWindow</span> *proxy_window</code></em>,
<em class="parameter"><code><span class="type">GdkDragProtocol</span> protocol</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> use_coordinates</code></em>);</pre>
<div class="warning"><p><code class="literal">gtk_drag_dest_set_proxy</code> has been deprecated since version 3.22 and should not be used in newly-written code.</p></div>
<p>Sets this widget as a proxy for drops to another window.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-set-proxy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>proxy_window</p></td>
<td class="parameter_description"><p>the window to which to forward drag events</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>protocol</p></td>
<td class="parameter_description"><p>the drag protocol which the <em class="parameter"><code>proxy_window</code></em>
accepts
(You can use <code class="function">gdk_drag_get_protocol()</code> to determine this)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>use_coordinates</p></td>
<td class="parameter_description"><p>If <code class="literal">TRUE</code>, send the same coordinates to the
destination, because it is an embedded
subwindow.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-unset"></a><h3>gtk_drag_dest_unset ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_unset (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Clears information about a drop destination set with
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set" title="gtk_drag_dest_set ()"><code class="function">gtk_drag_dest_set()</code></a>. The widget will no longer receive
notification of drags.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-unset.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-find-target"></a><h3>gtk_drag_dest_find_target ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkAtom</span>
gtk_drag_dest_find_target (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code><a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="type">GtkTargetList</span></a> *target_list</code></em>);</pre>
<p>Looks for a match between the supported targets of <em class="parameter"><code>context</code></em>
and the
<em class="parameter"><code>dest_target_list</code></em>
, returning the first matching target, otherwise
returning <code class="literal">GDK_NONE</code>. <em class="parameter"><code>dest_target_list</code></em>
should usually be the return
value from <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-get-target-list" title="gtk_drag_dest_get_target_list ()"><code class="function">gtk_drag_dest_get_target_list()</code></a>, but some widgets may
have different valid targets for different parts of the widget; in
that case, they will have to implement a drag_motion handler that
passes the correct target list to this function.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-find-target.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>drag destination widget</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>drag context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>target_list</p></td>
<td class="parameter_description"><p>list of droppable targets, or <code class="literal">NULL</code> to use
gtk_drag_dest_get_target_list (<em class="parameter"><code>widget</code></em>
). </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-dest-find-target.returns"></a><h4>Returns</h4>
<p>first target that the source offers
and the dest can accept, or <code class="literal">GDK_NONE</code>. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-get-target-list"></a><h3>gtk_drag_dest_get_target_list ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="returnvalue">GtkTargetList</span></a> *
gtk_drag_dest_get_target_list (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Returns the list of targets this widget can accept from
drag-and-drop.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-get-target-list.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-dest-get-target-list.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="type">GtkTargetList</span></a>, or <code class="literal">NULL</code> if none. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-set-target-list"></a><h3>gtk_drag_dest_set_target_list ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_set_target_list (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="type">GtkTargetList</span></a> *target_list</code></em>);</pre>
<p>Sets the target types that this widget can accept from drag-and-drop.
The widget must first be made into a drag destination with
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set" title="gtk_drag_dest_set ()"><code class="function">gtk_drag_dest_set()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-set-target-list.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats a drag destination</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>target_list</p></td>
<td class="parameter_description"><p>list of droppable targets, or <code class="literal">NULL</code> for none. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-add-text-targets"></a><h3>gtk_drag_dest_add_text_targets ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_add_text_targets (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Add the text targets supported by <a class="link" href="gtk3-Selections.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to
the target list of the drag destination. The targets
are added with <em class="parameter"><code>info</code></em>
= 0. If you need another value,
use <a class="link" href="gtk3-Selections.html#gtk-target-list-add-text-targets" title="gtk_target_list_add_text_targets ()"><code class="function">gtk_target_list_add_text_targets()</code></a> and
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set-target-list" title="gtk_drag_dest_set_target_list ()"><code class="function">gtk_drag_dest_set_target_list()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-add-text-targets.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats a drag destination</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-add-image-targets"></a><h3>gtk_drag_dest_add_image_targets ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_add_image_targets (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Add the image targets supported by <a class="link" href="gtk3-Selections.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to
the target list of the drag destination. The targets
are added with <em class="parameter"><code>info</code></em>
= 0. If you need another value,
use <a class="link" href="gtk3-Selections.html#gtk-target-list-add-image-targets" title="gtk_target_list_add_image_targets ()"><code class="function">gtk_target_list_add_image_targets()</code></a> and
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set-target-list" title="gtk_drag_dest_set_target_list ()"><code class="function">gtk_drag_dest_set_target_list()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-add-image-targets.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats a drag destination</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-add-uri-targets"></a><h3>gtk_drag_dest_add_uri_targets ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_add_uri_targets (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Add the URI targets supported by <a class="link" href="gtk3-Selections.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to
the target list of the drag destination. The targets
are added with <em class="parameter"><code>info</code></em>
= 0. If you need another value,
use <a class="link" href="gtk3-Selections.html#gtk-target-list-add-uri-targets" title="gtk_target_list_add_uri_targets ()"><code class="function">gtk_target_list_add_uri_targets()</code></a> and
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-dest-set-target-list" title="gtk_drag_dest_set_target_list ()"><code class="function">gtk_drag_dest_set_target_list()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-add-uri-targets.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats a drag destination</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-set-track-motion"></a><h3>gtk_drag_dest_set_track_motion ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_dest_set_track_motion (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> track_motion</code></em>);</pre>
<p>Tells the widget to emit <a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a> and
<a class="link" href="GtkWidget.html#GtkWidget-drag-leave" title="The “drag-leave” signal"><span class="type">“drag-leave”</span></a> events regardless of the targets and the
<a class="link" href="gtk3-Drag-and-Drop.html#GTK-DEST-DEFAULT-MOTION:CAPS"><code class="literal">GTK_DEST_DEFAULT_MOTION</code></a> flag.</p>
<p>This may be used when a widget wants to do generic
actions regardless of the targets that the source offers.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-set-track-motion.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats a drag destination</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>track_motion</p></td>
<td class="parameter_description"><p>whether to accept all targets</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.10</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-dest-get-track-motion"></a><h3>gtk_drag_dest_get_track_motion ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_drag_dest_get_track_motion (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Returns whether the widget has been configured to always
emit <a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a> signals.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-dest-get-track-motion.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats a drag destination</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-dest-get-track-motion.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the widget always emits
<a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a> events</p>
</div>
<p class="since">Since: 2.10</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-finish"></a><h3>gtk_drag_finish ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_finish (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> success</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> del</code></em>,
<em class="parameter"><code><span class="type">guint32</span> time_</code></em>);</pre>
<p>Informs the drag source that the drop is finished, and
that the data of the drag will no longer be required.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-finish.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the drag context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>success</p></td>
<td class="parameter_description"><p>a flag indicating whether the drop was successful</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>del</p></td>
<td class="parameter_description"><p>a flag indicating whether the source should delete the
original data. (This should be <code class="literal">TRUE</code> for a move)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>time_</p></td>
<td class="parameter_description"><p>the timestamp from the <a class="link" href="GtkWidget.html#GtkWidget-drag-drop" title="The “drag-drop” signal"><span class="type">“drag-drop”</span></a> signal</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-get-data"></a><h3>gtk_drag_get_data ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_get_data (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code><span class="type">GdkAtom</span> target</code></em>,
<em class="parameter"><code><span class="type">guint32</span> time_</code></em>);</pre>
<p>Gets the data associated with a drag. When the data
is received or the retrieval fails, GTK+ will emit a
<a class="link" href="GtkWidget.html#GtkWidget-drag-data-received" title="The “drag-data-received” signal"><span class="type">“drag-data-received”</span></a> signal. Failure of the retrieval
is indicated by the length field of the <em class="parameter"><code>selection_data</code></em>
signal parameter being negative. However, when <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-get-data" title="gtk_drag_get_data ()"><code class="function">gtk_drag_get_data()</code></a>
is called implicitely because the <a class="link" href="gtk3-Drag-and-Drop.html#GTK-DEST-DEFAULT-DROP:CAPS"><code class="literal">GTK_DEST_DEFAULT_DROP</code></a> was set,
then the widget will not receive notification of failed
drops.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-get-data.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>the widget that will receive the
<a class="link" href="GtkWidget.html#GtkWidget-drag-data-received" title="The “drag-data-received” signal"><span class="type">“drag-data-received”</span></a> signal</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the drag context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>target</p></td>
<td class="parameter_description"><p>the target (form of the data) to retrieve</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>time_</p></td>
<td class="parameter_description"><p>a timestamp for retrieving the data. This will
generally be the time received in a <a class="link" href="GtkWidget.html#GtkWidget-drag-motion" title="The “drag-motion” signal"><span class="type">“drag-motion”</span></a>
or <a class="link" href="GtkWidget.html#GtkWidget-drag-drop" title="The “drag-drop” signal"><span class="type">“drag-drop”</span></a> signal</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-get-source-widget"></a><h3>gtk_drag_get_source_widget ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_drag_get_source_widget (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>);</pre>
<p>Determines the source widget for a drag.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-get-source-widget.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>a (destination side) drag context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-get-source-widget.returns"></a><h4>Returns</h4>
<p>if the drag is occurring
within a single application, a pointer to the source widget.
Otherwise, <code class="literal">NULL</code>. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-highlight"></a><h3>gtk_drag_highlight ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_highlight (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Highlights a widget as a currently hovered drop target.
To end the highlight, call <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-unhighlight" title="gtk_drag_unhighlight ()"><code class="function">gtk_drag_unhighlight()</code></a>.
GTK+ calls this automatically if <a class="link" href="gtk3-Drag-and-Drop.html#GTK-DEST-DEFAULT-HIGHLIGHT:CAPS"><code class="literal">GTK_DEST_DEFAULT_HIGHLIGHT</code></a> is set.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-highlight.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a widget to highlight</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-unhighlight"></a><h3>gtk_drag_unhighlight ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_unhighlight (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Removes a highlight set by <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-highlight" title="gtk_drag_highlight ()"><code class="function">gtk_drag_highlight()</code></a> from
a widget.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-unhighlight.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a widget to remove the highlight from</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-begin"></a><h3>gtk_drag_begin ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkDragContext</span> *
gtk_drag_begin (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="type">GtkTargetList</span></a> *targets</code></em>,
<em class="parameter"><code><span class="type">GdkDragAction</span> actions</code></em>,
<em class="parameter"><code><span class="type">gint</span> button</code></em>,
<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_drag_begin</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-begin-with-coordinates" title="gtk_drag_begin_with_coordinates ()"><code class="function">gtk_drag_begin_with_coordinates()</code></a> instead</p>
</div>
<p>This function is equivalent to <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-begin-with-coordinates" title="gtk_drag_begin_with_coordinates ()"><code class="function">gtk_drag_begin_with_coordinates()</code></a>,
passing -1, -1 as coordinates.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-begin.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>the source widget</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>targets</p></td>
<td class="parameter_description"><p>The targets (data formats) in which the
source can provide the data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>actions</p></td>
<td class="parameter_description"><p>A bitmask of the allowed drag actions for this drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>button</p></td>
<td class="parameter_description"><p>The button the user clicked to start the drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>The event that triggered the start of the drag,
or <code class="literal">NULL</code> if none can be obtained. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-begin.returns"></a><h4>Returns</h4>
<p>the context for this drag. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-begin-with-coordinates"></a><h3>gtk_drag_begin_with_coordinates ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkDragContext</span> *
gtk_drag_begin_with_coordinates (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="type">GtkTargetList</span></a> *targets</code></em>,
<em class="parameter"><code><span class="type">GdkDragAction</span> actions</code></em>,
<em class="parameter"><code><span class="type">gint</span> button</code></em>,
<em class="parameter"><code><span class="type">GdkEvent</span> *event</code></em>,
<em class="parameter"><code><span class="type">gint</span> x</code></em>,
<em class="parameter"><code><span class="type">gint</span> y</code></em>);</pre>
<p>Initiates a drag on the source side. The function only needs to be used
when the application is starting drags itself, and is not needed when
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set" title="gtk_drag_source_set ()"><code class="function">gtk_drag_source_set()</code></a> is used.</p>
<p>The <em class="parameter"><code>event</code></em>
is used to retrieve the timestamp that will be used internally to
grab the pointer. If <em class="parameter"><code>event</code></em>
is <code class="literal">NULL</code>, then <code class="literal">GDK_CURRENT_TIME</code> will be used.
However, you should try to pass a real event in all cases, since that can be
used to get information about the drag.</p>
<p>Generally there are three cases when you want to start a drag by hand by
calling this function:</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><p>During a <a class="link" href="GtkWidget.html#GtkWidget-button-press-event" title="The “button-press-event” signal"><span class="type">“button-press-event”</span></a> handler, if you want to start a drag
immediately when the user presses the mouse button. Pass the <em class="parameter"><code>event</code></em>
that you have in your <a class="link" href="GtkWidget.html#GtkWidget-button-press-event" title="The “button-press-event” signal"><span class="type">“button-press-event”</span></a> handler.</p></li>
<li class="listitem"><p>During a <a class="link" href="GtkWidget.html#GtkWidget-motion-notify-event" title="The “motion-notify-event” signal"><span class="type">“motion-notify-event”</span></a> handler, if you want to start a drag
when the mouse moves past a certain threshold distance after a button-press.
Pass the <em class="parameter"><code>event</code></em>
that you have in your <a class="link" href="GtkWidget.html#GtkWidget-motion-notify-event" title="The “motion-notify-event” signal"><span class="type">“motion-notify-event”</span></a> handler.</p></li>
<li class="listitem"><p>During a timeout handler, if you want to start a drag after the mouse
button is held down for some time. Try to save the last event that you got
from the mouse, using <code class="function">gdk_event_copy()</code>, and pass it to this function
(remember to free the event with <code class="function">gdk_event_free()</code> when you are done).
If you really cannot pass a real event, pass <code class="literal">NULL</code> instead.</p></li>
</ol></div>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-begin-with-coordinates.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>the source widget</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>targets</p></td>
<td class="parameter_description"><p>The targets (data formats) in which the
source can provide the data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>actions</p></td>
<td class="parameter_description"><p>A bitmask of the allowed drag actions for this drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>button</p></td>
<td class="parameter_description"><p>The button the user clicked to start the drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event</p></td>
<td class="parameter_description"><p>The event that triggered the start of the drag,
or <code class="literal">NULL</code> if none can be obtained. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>x</p></td>
<td class="parameter_description"><p>The initial x coordinate to start dragging from, in the coordinate space
of <em class="parameter"><code>widget</code></em>
. If -1 is passed, the coordinates are retrieved from <em class="parameter"><code>event</code></em>
or
the current pointer position</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y</p></td>
<td class="parameter_description"><p>The initial y coordinate to start dragging from, in the coordinate space
of <em class="parameter"><code>widget</code></em>
. If -1 is passed, the coordinates are retrieved from <em class="parameter"><code>event</code></em>
or
the current pointer position</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-begin-with-coordinates.returns"></a><h4>Returns</h4>
<p>the context for this drag. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-10.html#api-index-3.10">3.10</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-cancel"></a><h3>gtk_drag_cancel ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_cancel (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>);</pre>
<p>Cancels an ongoing drag operation on the source side.</p>
<p>If you want to be able to cancel a drag operation in this way,
you need to keep a pointer to the drag context, either from an
explicit call to <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-begin-with-coordinates" title="gtk_drag_begin_with_coordinates ()"><code class="function">gtk_drag_begin_with_coordinates()</code></a>, or by
connecting to <a class="link" href="GtkWidget.html#GtkWidget-drag-begin" title="The “drag-begin” signal"><span class="type">“drag-begin”</span></a>.</p>
<p>If <em class="parameter"><code>context</code></em>
does not refer to an ongoing drag operation, this
function does nothing.</p>
<p>If a drag is cancelled in this way, the <em class="parameter"><code>result</code></em>
argument of
<a class="link" href="GtkWidget.html#GtkWidget-drag-failed" title="The “drag-failed” signal"><span class="type">“drag-failed”</span></a> is set to <em class="parameter"><code>GTK_DRAG_RESULT_ERROR</code></em>
.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-cancel.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>a <span class="type">GdkDragContext</span>, as e.g. returned by <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-begin-with-coordinates" title="gtk_drag_begin_with_coordinates ()"><code class="function">gtk_drag_begin_with_coordinates()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-16.html#api-index-3.16">3.16</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-set-icon-widget"></a><h3>gtk_drag_set_icon_widget ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_set_icon_widget (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_x</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_y</code></em>);</pre>
<p>Changes the icon for drag operation to a given widget.
GTK+ will not destroy the widget, so if you dont want
it to persist, you should connect to the “drag-end”
signal and destroy it yourself.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-set-icon-widget.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the context for a drag. (This must be called
with a context for the source side of a drag)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a widget to use as an icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_x</p></td>
<td class="parameter_description"><p>the X offset within <em class="parameter"><code>widget</code></em>
of the hotspot</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_y</p></td>
<td class="parameter_description"><p>the Y offset within <em class="parameter"><code>widget</code></em>
of the hotspot</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-set-icon-pixbuf"></a><h3>gtk_drag_set_icon_pixbuf ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_set_icon_pixbuf (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code><span class="type">GdkPixbuf</span> *pixbuf</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_x</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_y</code></em>);</pre>
<p>Sets <em class="parameter"><code>pixbuf</code></em>
as the icon for a given drag.</p>
<div class="refsect3">
<a name="gtk-drag-set-icon-pixbuf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the context for a drag (This must be called
with a context for the source side of a drag)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pixbuf</p></td>
<td class="parameter_description"><p>the <span class="type">GdkPixbuf</span> to use as the drag icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_x</p></td>
<td class="parameter_description"><p>the X offset within <em class="parameter"><code>widget</code></em>
of the hotspot</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_y</p></td>
<td class="parameter_description"><p>the Y offset within <em class="parameter"><code>widget</code></em>
of the hotspot</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-set-icon-stock"></a><h3>gtk_drag_set_icon_stock ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_set_icon_stock (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *stock_id</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_x</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_y</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_drag_set_icon_stock</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-name" title="gtk_drag_set_icon_name ()"><code class="function">gtk_drag_set_icon_name()</code></a> instead.</p>
</div>
<p>Sets the icon for a given drag from a stock ID.</p>
<div class="refsect3">
<a name="gtk-drag-set-icon-stock.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the context for a drag (This must be called
with a context for the source side of a drag)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stock_id</p></td>
<td class="parameter_description"><p>the ID of the stock icon to use for the drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_x</p></td>
<td class="parameter_description"><p>the X offset within the icon of the hotspot</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_y</p></td>
<td class="parameter_description"><p>the Y offset within the icon of the hotspot</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-set-icon-surface"></a><h3>gtk_drag_set_icon_surface ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_set_icon_surface (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html#cairo-surface-t"><span class="type">cairo_surface_t</span></a> *surface</code></em>);</pre>
<p>Sets <em class="parameter"><code>surface</code></em>
as the icon for a given drag. GTK+ retains
references for the arguments, and will release them when
they are no longer needed.</p>
<p>To position the surface relative to the mouse, use
<a href="/usr/share/gtk-doc/html/cairo/cairo-cairo-surface-t.html#cairo-surface-set-device-offset"><code class="function">cairo_surface_set_device_offset()</code></a> on <em class="parameter"><code>surface</code></em>
. The mouse
cursor will be positioned at the (0,0) coordinate of the
surface.</p>
<div class="refsect3">
<a name="gtk-drag-set-icon-surface.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the context for a drag (This must be called
with a context for the source side of a drag)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>surface</p></td>
<td class="parameter_description"><p>the surface to use as icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-set-icon-name"></a><h3>gtk_drag_set_icon_name ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_set_icon_name (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *icon_name</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_x</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_y</code></em>);</pre>
<p>Sets the icon for a given drag from a named themed icon. See
the docs for <a class="link" href="GtkIconTheme.html" title="GtkIconTheme"><span class="type">GtkIconTheme</span></a> for more details. Note that the
size of the icon depends on the icon theme (the icon is
loaded at the symbolic size <a class="link" href="gtk3-Themeable-Stock-Images.html#GTK-ICON-SIZE-DND:CAPS"><span class="type">GTK_ICON_SIZE_DND</span></a>), thus
<em class="parameter"><code>hot_x</code></em>
and <em class="parameter"><code>hot_y</code></em>
have to be used with care.</p>
<div class="refsect3">
<a name="gtk-drag-set-icon-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the context for a drag (This must be called
with a context for the source side of a drag)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>icon_name</p></td>
<td class="parameter_description"><p>name of icon to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_x</p></td>
<td class="parameter_description"><p>the X offset of the hotspot within the icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_y</p></td>
<td class="parameter_description"><p>the Y offset of the hotspot within the icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-set-icon-gicon"></a><h3>gtk_drag_set_icon_gicon ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_set_icon_gicon (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>,
<em class="parameter"><code><span class="type">GIcon</span> *icon</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_x</code></em>,
<em class="parameter"><code><span class="type">gint</span> hot_y</code></em>);</pre>
<p>Sets the icon for a given drag from the given <em class="parameter"><code>icon</code></em>
.
See the documentation for <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-set-icon-name" title="gtk_drag_set_icon_name ()"><code class="function">gtk_drag_set_icon_name()</code></a>
for more details about using icons in drag and drop.</p>
<div class="refsect3">
<a name="gtk-drag-set-icon-gicon.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the context for a drag (This must be called
with a context for the source side of a drag)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>icon</p></td>
<td class="parameter_description"><p>a <span class="type">GIcon</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_x</p></td>
<td class="parameter_description"><p>the X offset of the hotspot within the icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>hot_y</p></td>
<td class="parameter_description"><p>the Y offset of the hotspot within the icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-set-icon-default"></a><h3>gtk_drag_set_icon_default ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_set_icon_default (<em class="parameter"><code><span class="type">GdkDragContext</span> *context</code></em>);</pre>
<p>Sets the icon for a particular drag to the default
icon.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-set-icon-default.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>the context for a drag (This must be called
with a context for the source side of a drag)</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-check-threshold"></a><h3>gtk_drag_check_threshold ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_drag_check_threshold (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">gint</span> start_x</code></em>,
<em class="parameter"><code><span class="type">gint</span> start_y</code></em>,
<em class="parameter"><code><span class="type">gint</span> current_x</code></em>,
<em class="parameter"><code><span class="type">gint</span> current_y</code></em>);</pre>
<p>Checks to see if a mouse drag starting at (<em class="parameter"><code>start_x</code></em>
, <em class="parameter"><code>start_y</code></em>
) and ending
at (<em class="parameter"><code>current_x</code></em>
, <em class="parameter"><code>current_y</code></em>
) has passed the GTK+ drag threshold, and thus
should trigger the beginning of a drag-and-drop operation.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-check-threshold.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_x</p></td>
<td class="parameter_description"><p>X coordinate of start of drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_y</p></td>
<td class="parameter_description"><p>Y coordinate of start of drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>current_x</p></td>
<td class="parameter_description"><p>current X coordinate</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>current_y</p></td>
<td class="parameter_description"><p>current Y coordinate</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-check-threshold.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the drag threshold has been passed.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-set"></a><h3>gtk_drag_source_set ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_set (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GdkModifierType</span> start_button_mask</code></em>,
<em class="parameter"><code>const <a class="link" href="gtk3-Selections.html#GtkTargetEntry" title="struct GtkTargetEntry"><span class="type">GtkTargetEntry</span></a> *targets</code></em>,
<em class="parameter"><code><span class="type">gint</span> n_targets</code></em>,
<em class="parameter"><code><span class="type">GdkDragAction</span> actions</code></em>);</pre>
<p>Sets up a widget so that GTK+ will start a drag operation when the user
clicks and drags on the widget. The widget must have a window.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-set.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_button_mask</p></td>
<td class="parameter_description"><p>the bitmask of buttons that can start the drag</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>targets</p></td>
<td class="parameter_description"><p>the table of targets
that the drag will support, may be <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_targets]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_targets</p></td>
<td class="parameter_description"><p>the number of items in <em class="parameter"><code>targets</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>actions</p></td>
<td class="parameter_description"><p>the bitmask of possible actions for a drag from this widget</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-set-icon-pixbuf"></a><h3>gtk_drag_source_set_icon_pixbuf ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_set_icon_pixbuf (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GdkPixbuf</span> *pixbuf</code></em>);</pre>
<p>Sets the icon that will be used for drags from a particular widget
from a <span class="type">GdkPixbuf</span>. GTK+ retains a reference for <em class="parameter"><code>pixbuf</code></em>
and will
release it when it is no longer needed.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-set-icon-pixbuf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pixbuf</p></td>
<td class="parameter_description"><p>the <span class="type">GdkPixbuf</span> for the drag icon</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-set-icon-stock"></a><h3>gtk_drag_source_set_icon_stock ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_set_icon_stock (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *stock_id</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_drag_source_set_icon_stock</code> has been deprecated since version 3.10 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-icon-name" title="gtk_drag_source_set_icon_name ()"><code class="function">gtk_drag_source_set_icon_name()</code></a> instead.</p>
</div>
<p>Sets the icon that will be used for drags from a particular source
to a stock icon.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-set-icon-stock.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>stock_id</p></td>
<td class="parameter_description"><p>the ID of the stock icon to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-set-icon-name"></a><h3>gtk_drag_source_set_icon_name ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_set_icon_name (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *icon_name</code></em>);</pre>
<p>Sets the icon that will be used for drags from a particular source
to a themed icon. See the docs for <a class="link" href="GtkIconTheme.html" title="GtkIconTheme"><span class="type">GtkIconTheme</span></a> for more details.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-set-icon-name.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>icon_name</p></td>
<td class="parameter_description"><p>name of icon to use</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-set-icon-gicon"></a><h3>gtk_drag_source_set_icon_gicon ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_set_icon_gicon (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><span class="type">GIcon</span> *icon</code></em>);</pre>
<p>Sets the icon that will be used for drags from a particular source
to <em class="parameter"><code>icon</code></em>
. See the docs for <a class="link" href="GtkIconTheme.html" title="GtkIconTheme"><span class="type">GtkIconTheme</span></a> for more details.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-set-icon-gicon.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>icon</p></td>
<td class="parameter_description"><p>A <span class="type">GIcon</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-unset"></a><h3>gtk_drag_source_unset ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_unset (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Undoes the effects of <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set" title="gtk_drag_source_set ()"><code class="function">gtk_drag_source_set()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-unset.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-set-target-list"></a><h3>gtk_drag_source_set_target_list ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_set_target_list (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>,
<em class="parameter"><code><a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="type">GtkTargetList</span></a> *target_list</code></em>);</pre>
<p>Changes the target types that this widget offers for drag-and-drop.
The widget must first be made into a drag source with
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set" title="gtk_drag_source_set ()"><code class="function">gtk_drag_source_set()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-set-target-list.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats a drag source</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>target_list</p></td>
<td class="parameter_description"><p>list of draggable targets, or <code class="literal">NULL</code> for none. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-get-target-list"></a><h3>gtk_drag_source_get_target_list ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="returnvalue">GtkTargetList</span></a> *
gtk_drag_source_get_target_list (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Gets the list of targets this widget can provide for
drag-and-drop.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-get-target-list.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-drag-source-get-target-list.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="gtk3-Selections.html#GtkTargetList"><span class="type">GtkTargetList</span></a>, or <code class="literal">NULL</code> if none. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-add-text-targets"></a><h3>gtk_drag_source_add_text_targets ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_add_text_targets (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Add the text targets supported by <a class="link" href="gtk3-Selections.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to
the target list of the drag source. The targets
are added with <em class="parameter"><code>info</code></em>
= 0. If you need another value,
use <a class="link" href="gtk3-Selections.html#gtk-target-list-add-text-targets" title="gtk_target_list_add_text_targets ()"><code class="function">gtk_target_list_add_text_targets()</code></a> and
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-target-list" title="gtk_drag_source_set_target_list ()"><code class="function">gtk_drag_source_set_target_list()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-add-text-targets.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats is a drag source</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-add-image-targets"></a><h3>gtk_drag_source_add_image_targets ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_add_image_targets (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Add the writable image targets supported by <a class="link" href="gtk3-Selections.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to
the target list of the drag source. The targets
are added with <em class="parameter"><code>info</code></em>
= 0. If you need another value,
use <a class="link" href="gtk3-Selections.html#gtk-target-list-add-image-targets" title="gtk_target_list_add_image_targets ()"><code class="function">gtk_target_list_add_image_targets()</code></a> and
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-target-list" title="gtk_drag_source_set_target_list ()"><code class="function">gtk_drag_source_set_target_list()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-add-image-targets.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats is a drag source</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-drag-source-add-uri-targets"></a><h3>gtk_drag_source_add_uri_targets ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_drag_source_add_uri_targets (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre>
<p>Add the URI targets supported by <a class="link" href="gtk3-Selections.html#GtkSelectionData"><span class="type">GtkSelectionData</span></a> to
the target list of the drag source. The targets
are added with <em class="parameter"><code>info</code></em>
= 0. If you need another value,
use <a class="link" href="gtk3-Selections.html#gtk-target-list-add-uri-targets" title="gtk_target_list_add_uri_targets ()"><code class="function">gtk_target_list_add_uri_targets()</code></a> and
<a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-source-set-target-list" title="gtk_drag_source_set_target_list ()"><code class="function">gtk_drag_source_set_target_list()</code></a>.</p>
<p><span class="annotation">[<acronym title="This is a method"><span class="acronym">method</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-drag-source-add-uri-targets.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>widget</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> thats is a drag source</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-Drag-and-Drop.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkDestDefaults"></a><h3>enum GtkDestDefaults</h3>
<p>The <a class="link" href="gtk3-Drag-and-Drop.html#GtkDestDefaults" title="enum GtkDestDefaults"><span class="type">GtkDestDefaults</span></a> enumeration specifies the various
types of action that will be taken on behalf
of the user for a drag destination site.</p>
<div class="refsect3">
<a name="GtkDestDefaults.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GTK-DEST-DEFAULT-MOTION:CAPS"></a>GTK_DEST_DEFAULT_MOTION</p></td>
<td class="enum_member_description">
<p>If set for a widget, GTK+, during a drag over this
widget will check if the drag matches this widgets list of possible targets
and actions.
GTK+ will then call <code class="function">gdk_drag_status()</code> as appropriate.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DEST-DEFAULT-HIGHLIGHT:CAPS"></a>GTK_DEST_DEFAULT_HIGHLIGHT</p></td>
<td class="enum_member_description">
<p>If set for a widget, GTK+ will draw a highlight on
this widget as long as a drag is over this widget and the widget drag format
and action are acceptable.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DEST-DEFAULT-DROP:CAPS"></a>GTK_DEST_DEFAULT_DROP</p></td>
<td class="enum_member_description">
<p>If set for a widget, when a drop occurs, GTK+ will
will check if the drag matches this widgets list of possible targets and
actions. If so, GTK+ will call <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-get-data" title="gtk_drag_get_data ()"><code class="function">gtk_drag_get_data()</code></a> on behalf of the widget.
Whether or not the drop is successful, GTK+ will call <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-finish" title="gtk_drag_finish ()"><code class="function">gtk_drag_finish()</code></a>. If
the action was a move, then if the drag was successful, then <code class="literal">TRUE</code> will be
passed for the <em class="parameter"><code>delete</code></em>
parameter to <a class="link" href="gtk3-Drag-and-Drop.html#gtk-drag-finish" title="gtk_drag_finish ()"><code class="function">gtk_drag_finish()</code></a>.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DEST-DEFAULT-ALL:CAPS"></a>GTK_DEST_DEFAULT_ALL</p></td>
<td class="enum_member_description">
<p>If set, specifies that all default actions should
be taken.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkTargetFlags"></a><h3>enum GtkTargetFlags</h3>
<p>The <a class="link" href="gtk3-Drag-and-Drop.html#GtkTargetFlags" title="enum GtkTargetFlags"><span class="type">GtkTargetFlags</span></a> enumeration is used to specify
constraints on a <a class="link" href="gtk3-Selections.html#GtkTargetEntry" title="struct GtkTargetEntry"><span class="type">GtkTargetEntry</span></a>.</p>
<div class="refsect3">
<a name="GtkTargetFlags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GTK-TARGET-SAME-APP:CAPS"></a>GTK_TARGET_SAME_APP</p></td>
<td class="enum_member_description">
<p>If this is set, the target will only be selected
for drags within a single application.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-TARGET-SAME-WIDGET:CAPS"></a>GTK_TARGET_SAME_WIDGET</p></td>
<td class="enum_member_description">
<p>If this is set, the target will only be selected
for drags within a single widget.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-TARGET-OTHER-APP:CAPS"></a>GTK_TARGET_OTHER_APP</p></td>
<td class="enum_member_description">
<p>If this is set, the target will not be selected
for drags within a single application.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-TARGET-OTHER-WIDGET:CAPS"></a>GTK_TARGET_OTHER_WIDGET</p></td>
<td class="enum_member_description">
<p>If this is set, the target will not be selected
for drags withing a single widget.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkDragResult"></a><h3>enum GtkDragResult</h3>
<p>Gives an indication why a drag operation failed.
The value can by obtained by connecting to the
<a class="link" href="GtkWidget.html#GtkWidget-drag-failed" title="The “drag-failed” signal"><span class="type">“drag-failed”</span></a> signal.</p>
<div class="refsect3">
<a name="GtkDragResult.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GTK-DRAG-RESULT-SUCCESS:CAPS"></a>GTK_DRAG_RESULT_SUCCESS</p></td>
<td class="enum_member_description">
<p>The drag operation was successful.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DRAG-RESULT-NO-TARGET:CAPS"></a>GTK_DRAG_RESULT_NO_TARGET</p></td>
<td class="enum_member_description">
<p>No suitable drag target.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DRAG-RESULT-USER-CANCELLED:CAPS"></a>GTK_DRAG_RESULT_USER_CANCELLED</p></td>
<td class="enum_member_description">
<p>The user cancelled the drag operation.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DRAG-RESULT-TIMEOUT-EXPIRED:CAPS"></a>GTK_DRAG_RESULT_TIMEOUT_EXPIRED</p></td>
<td class="enum_member_description">
<p>The drag operation timed out.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DRAG-RESULT-GRAB-BROKEN:CAPS"></a>GTK_DRAG_RESULT_GRAB_BROKEN</p></td>
<td class="enum_member_description">
<p>The pointer or keyboard grab used
for the drag operation was broken.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-DRAG-RESULT-ERROR:CAPS"></a>GTK_DRAG_RESULT_ERROR</p></td>
<td class="enum_member_description">
<p>The drag operation failed due to some
unspecified error.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>