File: //usr/local/ssl/share/gtk-doc/html/gdk/gdk-Drag-and-Drop.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Drag and Drop</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-Selections.html" title="Selections">
<link rel="next" href="gdk-Properties-and-Atoms.html" title="Properties and Atoms">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</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="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-Selections.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-Properties-and-Atoms.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3103353" class="shortcut">Top</a>
 | 
<a href="#id3103988" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-Drag-and-Drop"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3103353"></a><span class="refentrytitle">Drag and Drop</span>
</h2>
<p>Drag and Drop — Functions for controlling drag and drop handling</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk/gdk.h>
<a href="gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> <a href="gdk-Drag-and-Drop.html#gdk-drag-get-selection">gdk_drag_get_selection</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);
void <a href="gdk-Drag-and-Drop.html#gdk-drag-abort">gdk_drag_abort</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
void <a href="gdk-Drag-and-Drop.html#gdk-drop-reply">gdk_drop_reply</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> ok,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a>* <a href="gdk-Drag-and-Drop.html#gdk-drag-context-new">gdk_drag_context_new</a> (void);
void <a href="gdk-Drag-and-Drop.html#gdk-drag-drop">gdk_drag_drop</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
void <a href="gdk-Drag-and-Drop.html#gdk-drag-find-window">gdk_drag_find_window</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *drag_window,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_root,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_root,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> **dest_window,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);
void <a href="gdk-Drag-and-Drop.html#gdk-drag-find-window-for-screen">gdk_drag_find_window_for_screen</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *drag_window,
<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_root,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_root,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> **dest_window,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);
void <a href="gdk-Drag-and-Drop.html#gdk-drag-context-ref">gdk_drag_context_ref</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);
<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a>* <a href="gdk-Drag-and-Drop.html#gdk-drag-begin">gdk_drag_begin</a> (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
>GList</a> *targets);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-Drag-and-Drop.html#gdk-drag-motion">gdk_drag_motion</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *dest_window,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> protocol,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_root,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_root,
<a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> suggested_action,
<a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> possible_actions,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
void <a href="gdk-Drag-and-Drop.html#gdk-drop-finish">gdk_drop_finish</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> success,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> <a href="gdk-Drag-and-Drop.html#gdk-drag-get-protocol">gdk_drag_get_protocol</a> (<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> xid,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> <a href="gdk-Drag-and-Drop.html#gdk-drag-get-protocol-for-display">gdk_drag_get_protocol_for_display</a>
(<a href="GdkDisplay.html" title="GdkDisplay">GdkDisplay</a> *display,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> xid,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);
enum <a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a>;
void <a href="gdk-Drag-and-Drop.html#gdk-drag-context-unref">gdk_drag_context_unref</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);
<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a>;
enum <a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a>;
void <a href="gdk-Drag-and-Drop.html#gdk-drag-status">gdk_drag_status</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> action,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-Drag-and-Drop.html#gdk-drag-drop-succeeded">gdk_drag_drop_succeeded</a> (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3103988"></a><h2>Description</h2>
<p>
These functions provide a low level interface for drag and drop.
The X backend of GDK supports both the Xdnd and Motif drag and drop protocols
transparently, the Win32 backend supports the WM_DROPFILES protocol.
</p>
<p>
GTK+ provides a higher level abstraction based on top of these functions,
and so they are not normally needed in GTK+ applications.
See the <a
href="../gtk/gtk-Drag-and-Drop.html"
>Drag and Drop</a> section of
the GTK+ documentation for more information.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3104022"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3104032"></a><h3>
<a name="gdk-drag-get-selection"></a>gdk_drag_get_selection ()</h3>
<a class="indexterm" name="id3104045"></a><pre class="programlisting"><a href="gdk-Properties-and-Atoms.html#GdkAtom">GdkAtom</a> gdk_drag_get_selection (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);</pre>
<p>
Returns the selection atom for the current source window.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the selection atom.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3104115"></a><h3>
<a name="gdk-drag-abort"></a>gdk_drag_abort ()</h3>
<a class="indexterm" name="id3104128"></a><pre class="programlisting">void gdk_drag_abort (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Aborts a drag without dropping.
</p>
<p>
This function is called by the drag source.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> the timestamp for this operation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3104212"></a><h3>
<a name="gdk-drop-reply"></a>gdk_drop_reply ()</h3>
<a class="indexterm" name="id3104225"></a><pre class="programlisting">void gdk_drop_reply (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> ok,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Accepts or rejects a drop.
</p>
<p>
This function is called by the drag destination in response
to a drop initiated by the drag source.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>ok</code></em> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the drop is accepted.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> the timestamp for this operation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3104341"></a><h3>
<a name="gdk-drag-context-new"></a>gdk_drag_context_new ()</h3>
<a class="indexterm" name="id3104355"></a><pre class="programlisting"><a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a>* gdk_drag_context_new (void);</pre>
<p>
Creates a new <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the newly created <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3104411"></a><h3>
<a name="gdk-drag-drop"></a>gdk_drag_drop ()</h3>
<a class="indexterm" name="id3104424"></a><pre class="programlisting">void gdk_drag_drop (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Drops on the current destination.
</p>
<p>
This function is called by the drag source.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> the timestamp for this operation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3104508"></a><h3>
<a name="gdk-drag-find-window"></a>gdk_drag_find_window ()</h3>
<a class="indexterm" name="id3104522"></a><pre class="programlisting">void gdk_drag_find_window (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *drag_window,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_root,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_root,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> **dest_window,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);</pre>
<p>
Finds the destination window and DND protocol to use at the
given pointer position.
</p>
<p>
This function is called by the drag source to obtain the
<em class="parameter"><code>dest_window</code></em> and <em class="parameter"><code>protocol</code></em> parameters for <a href="gdk-Drag-and-Drop.html#gdk-drag-motion"><code class="function">gdk_drag_motion()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>drag_window</code></em> :</span></td>
<td> a window which may be at the pointer position, but
should be ignored, since it is put up by the drag source as an icon.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x_root</code></em> :</span></td>
<td> the x position of the pointer in root coordinates.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y_root</code></em> :</span></td>
<td> the y position of the pointer in root coordinates.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_window</code></em> :</span></td>
<td> location to store the destination window in.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>protocol</code></em> :</span></td>
<td> location to store the DND protocol in.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3104721"></a><h3>
<a name="gdk-drag-find-window-for-screen"></a>gdk_drag_find_window_for_screen ()</h3>
<a class="indexterm" name="id3104737"></a><pre class="programlisting">void gdk_drag_find_window_for_screen (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *drag_window,
<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a> *screen,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_root,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_root,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> **dest_window,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);</pre>
<p>
Finds the destination window and DND protocol to use at the
given pointer position.
</p>
<p>
This function is called by the drag source to obtain the
<em class="parameter"><code>dest_window</code></em> and <em class="parameter"><code>protocol</code></em> parameters for <a href="gdk-Drag-and-Drop.html#gdk-drag-motion"><code class="function">gdk_drag_motion()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>drag_window</code></em> :</span></td>
<td> a window which may be at the pointer position, but
should be ignored, since it is put up by the drag source as an icon.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>screen</code></em> :</span></td>
<td> the screen where the destination window is sought.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x_root</code></em> :</span></td>
<td> the x position of the pointer in root coordinates.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y_root</code></em> :</span></td>
<td> the y position of the pointer in root coordinates.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_window</code></em> :</span></td>
<td> location to store the destination window in.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>protocol</code></em> :</span></td>
<td> location to store the DND protocol in.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3104962"></a><h3>
<a name="gdk-drag-context-ref"></a>gdk_drag_context_ref ()</h3>
<a class="indexterm" name="id3104978"></a><pre class="programlisting">void gdk_drag_context_ref (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_drag_context_ref</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Deprecated function; use <a
href="../gobject/gobject-The-Base-Object-Type.html#g-object-ref"
><code class="function">g_object_ref()</code></a> instead.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3105060"></a><h3>
<a name="gdk-drag-begin"></a>gdk_drag_begin ()</h3>
<a class="indexterm" name="id3105073"></a><pre class="programlisting"><a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a>* gdk_drag_begin (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
>GList</a> *targets);</pre>
<p>
Starts a drag and creates a new drag context for it.
</p>
<p>
This function is called by the drag source.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>window</code></em> :</span></td>
<td> the source window for this drag.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>targets</code></em> :</span></td>
<td> the list of offered targets.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a newly created <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3105168"></a><h3>
<a name="gdk-drag-motion"></a>gdk_drag_motion ()</h3>
<a class="indexterm" name="id3105181"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_drag_motion (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *dest_window,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> protocol,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> x_root,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> y_root,
<a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> suggested_action,
<a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> possible_actions,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Updates the drag context when the pointer moves or the
set of actions changes.
</p>
<p>
This function is called by the drag source.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>dest_window</code></em> :</span></td>
<td> the new destination window, obtained by
<a href="gdk-Drag-and-Drop.html#gdk-drag-find-window"><code class="function">gdk_drag_find_window()</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>protocol</code></em> :</span></td>
<td> the DND protocol in use, obtained by <a href="gdk-Drag-and-Drop.html#gdk-drag-find-window"><code class="function">gdk_drag_find_window()</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x_root</code></em> :</span></td>
<td> the x position of the pointer in root coordinates.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y_root</code></em> :</span></td>
<td> the y position of the pointer in root coordinates.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>suggested_action</code></em> :</span></td>
<td> the suggested action.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>possible_actions</code></em> :</span></td>
<td> the possible actions.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> the timestamp for this operation.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> FIXME
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3105432"></a><h3>
<a name="gdk-drop-finish"></a>gdk_drop_finish ()</h3>
<a class="indexterm" name="id3105445"></a><pre class="programlisting">void gdk_drop_finish (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> success,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Ends the drag operation after a drop.
</p>
<p>
This function is called by the drag destination.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <span class="type">GtkDragContext</span>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>success</code></em> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the data was successfully received.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> the timestamp for this operation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3105563"></a><h3>
<a name="gdk-drag-get-protocol"></a>gdk_drag_get_protocol ()</h3>
<a class="indexterm" name="id3105576"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> gdk_drag_get_protocol (<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> xid,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);</pre>
<p>
Finds out the DND protocol supported by a window.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>xid</code></em> :</span></td>
<td> the X id of the destination window.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>protocol</code></em> :</span></td>
<td> location where the supported DND protocol is returned.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the X id of the window where the drop should happen. This
may be <em class="parameter"><code>xid</code></em> or the X id of a proxy window, or None if <em class="parameter"><code>xid</code></em> doesn't
support Drag and Drop.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3105674"></a><h3>
<a name="gdk-drag-get-protocol-for-display"></a>gdk_drag_get_protocol_for_display ()</h3>
<a class="indexterm" name="id3105691"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> gdk_drag_get_protocol_for_display
(<a href="GdkDisplay.html" title="GdkDisplay">GdkDisplay</a> *display,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> xid,
<a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> *protocol);</pre>
<p>
Finds out the DND protocol supported by a window.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>display</code></em> :</span></td>
<td> the <a href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> where the destination window resides
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>xid</code></em> :</span></td>
<td> the X id of the destination window.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>protocol</code></em> :</span></td>
<td> location where the supported DND protocol is returned.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the X id of the window where the drop should happen. This
may be <em class="parameter"><code>xid</code></em> or the X id of a proxy window, or None if <em class="parameter"><code>xid</code></em> doesn't
support Drag and Drop.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3105823"></a><h3>
<a name="GdkDragProtocol"></a>enum GdkDragProtocol</h3>
<a class="indexterm" name="id3105836"></a><pre class="programlisting">typedef enum
{
GDK_DRAG_PROTO_MOTIF,
GDK_DRAG_PROTO_XDND,
GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming
* drags */
GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */
GDK_DRAG_PROTO_LOCAL /* Intra-app */
} GdkDragProtocol;
</pre>
<p>
Used in <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a> to indicate the protocol according to
which DND is done.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-DRAG-PROTO-MOTIF:CAPS"></a><code class="literal">GDK_DRAG_PROTO_MOTIF</code></span></td>
<td>The Motif DND protocol.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-DRAG-PROTO-XDND:CAPS"></a><code class="literal">GDK_DRAG_PROTO_XDND</code></span></td>
<td>The Xdnd protocol.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-DRAG-PROTO-ROOTWIN:CAPS"></a><code class="literal">GDK_DRAG_PROTO_ROOTWIN</code></span></td>
<td>An extension to the Xdnd protocol for
unclaimed root window drops.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-DRAG-PROTO-NONE:CAPS"></a><code class="literal">GDK_DRAG_PROTO_NONE</code></span></td>
<td>no protocol.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-DRAG-PROTO-WIN32-DROPFILES:CAPS"></a><code class="literal">GDK_DRAG_PROTO_WIN32_DROPFILES</code></span></td>
<td>The simple WM_DROPFILES protocol.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-DRAG-PROTO-OLE2:CAPS"></a><code class="literal">GDK_DRAG_PROTO_OLE2</code></span></td>
<td>The complex OLE2 DND protocol (not implemented).
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-DRAG-PROTO-LOCAL:CAPS"></a><code class="literal">GDK_DRAG_PROTO_LOCAL</code></span></td>
<td>Intra-application DND.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3106033"></a><h3>
<a name="gdk-drag-context-unref"></a>gdk_drag_context_unref ()</h3>
<a class="indexterm" name="id3106049"></a><pre class="programlisting">void gdk_drag_context_unref (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_drag_context_unref</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Deprecated function; use <a
href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"
><code class="function">g_object_unref()</code></a> instead.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3106130"></a><h3>
<a name="GdkDragContext"></a>GdkDragContext</h3>
<a class="indexterm" name="id3106143"></a><pre class="programlisting">typedef struct {
GObject parent_instance;
GdkDragProtocol protocol;
gboolean is_source;
GdkWindow *source_window;
GdkWindow *dest_window;
GList *targets;
GdkDragAction actions;
GdkDragAction suggested_action;
GdkDragAction action;
guint32 start_time;
} GdkDragContext;
</pre>
<p>
A <span class="structname">GdkDragContext</span> holds information about a
drag in progress. It is used on both source and destination sides.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a> <em class="structfield"><code>parent_instance</code></em>;</span></td>
<td>the parent instance
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Drag-and-Drop.html#GdkDragProtocol">GdkDragProtocol</a> <em class="structfield"><code>protocol</code></em>;</span></td>
<td>the DND protocol which governs this drag.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <em class="structfield"><code>is_source</code></em>;</span></td>
<td>
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the context is used on the source side.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *<em class="structfield"><code>source_window</code></em>;</span></td>
<td>the source of this drag.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *<em class="structfield"><code>dest_window</code></em>;</span></td>
<td>the destination window of this drag.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
>GList</a> *<em class="structfield"><code>targets</code></em>;</span></td>
<td>a list of targets offered by the source.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> <em class="structfield"><code>actions</code></em>;</span></td>
<td>a bitmask of actions proposed by the source when
<em class="parameter"><code>suggested_action</code></em> is <a href="gdk-Drag-and-Drop.html#GDK-ACTION-ASK:CAPS"><code class="literal">GDK_ACTION_ASK</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> <em class="structfield"><code>suggested_action</code></em>;</span></td>
<td>the action suggested by the source.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> <em class="structfield"><code>action</code></em>;</span></td>
<td>the action chosen by the destination.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> <em class="structfield"><code>start_time</code></em>;</span></td>
<td>a timestamp recording the start time of this drag.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3106410"></a><h3>
<a name="GdkDragAction"></a>enum GdkDragAction</h3>
<a class="indexterm" name="id3106423"></a><pre class="programlisting">typedef enum
{
GDK_ACTION_DEFAULT = 1 << 0,
GDK_ACTION_COPY = 1 << 1,
GDK_ACTION_MOVE = 1 << 2,
GDK_ACTION_LINK = 1 << 3,
GDK_ACTION_PRIVATE = 1 << 4,
GDK_ACTION_ASK = 1 << 5
} GdkDragAction;
</pre>
<p>
Used in <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a> to indicate what the destination
should do with the dropped data.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-ACTION-DEFAULT:CAPS"></a><code class="literal">GDK_ACTION_DEFAULT</code></span></td>
<td>Means nothing, and should not be used.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-ACTION-COPY:CAPS"></a><code class="literal">GDK_ACTION_COPY</code></span></td>
<td>Copy the data.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-ACTION-MOVE:CAPS"></a><code class="literal">GDK_ACTION_MOVE</code></span></td>
<td>Move the data, i.e. first copy it, then delete
it from the source using the DELETE target of the X selection protocol.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-ACTION-LINK:CAPS"></a><code class="literal">GDK_ACTION_LINK</code></span></td>
<td>Add a link to the data. Note that this is only
useful if source and destination agree on what it means.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-ACTION-PRIVATE:CAPS"></a><code class="literal">GDK_ACTION_PRIVATE</code></span></td>
<td>Special action which tells the source that the
destination will do something that the source doesn't understand.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-ACTION-ASK:CAPS"></a><code class="literal">GDK_ACTION_ASK</code></span></td>
<td>Ask the user what to do with the data.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3106596"></a><h3>
<a name="gdk-drag-status"></a>gdk_drag_status ()</h3>
<a class="indexterm" name="id3106609"></a><pre class="programlisting">void gdk_drag_status (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context,
<a href="gdk-Drag-and-Drop.html#GdkDragAction">GdkDragAction</a> action,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Selects one of the actions offered by the drag source.
</p>
<p>
This function is called by the drag destination in response to
<a href="gdk-Drag-and-Drop.html#gdk-drag-motion"><code class="function">gdk_drag_motion()</code></a> called by the drag source.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>action</code></em> :</span></td>
<td> the selected action which will be taken when a drop happens,
or 0 to indicate that a drop will not be accepted.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> the timestamp for this operation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3106729"></a><h3>
<a name="gdk-drag-drop-succeeded"></a>gdk_drag_drop_succeeded ()</h3>
<a class="indexterm" name="id3106744"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_drag_drop_succeeded (<a href="gdk-Drag-and-Drop.html#GdkDragContext">GdkDragContext</a> *context);</pre>
<p>
Returns wether the dropped data has been successfully
transferred. This function is intended to be used while
handling a <a href="gdk-Events.html#GDK-DROP-FINISHED:CAPS"><code class="literal">GDK_DROP_FINISHED</code></a> event, its return value is
meaningless at other times.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
<td> a <a href="gdk-Drag-and-Drop.html#GdkDragContext"><span class="type">GdkDragContext</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the drop was successful.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.6
</p>
</div>
</div>
</div>
</body>
</html>