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

<refsect1 id="gtk4-GtkTreeView-drag-and-drop.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-tree-drag-source-drag-data-delete">gtk_tree_drag_source_drag_data_delete</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-drag-source-drag-data-get">gtk_tree_drag_source_drag_data_get</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-tree-drag-source-row-draggable">gtk_tree_drag_source_row_draggable</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-tree-drag-dest-drag-data-received">gtk_tree_drag_dest_drag_data_received</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-tree-drag-dest-row-drop-possible">gtk_tree_drag_dest_row_drop_possible</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-tree-create-row-drag-content">gtk_tree_create_row_drag_content</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-tree-get-row-drag-data">gtk_tree_get_row_drag_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<anchor id="GtkTreeDragSource"/><anchor id="GtkTreeDragDest"/><refsect1 id="gtk4-GtkTreeView-drag-and-drop.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkTreeDragSource-struct">GtkTreeDragSource</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkTreeDragSourceIface">GtkTreeDragSourceIface</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkTreeDragDest-struct">GtkTreeDragDest</link></entry></row>
<row><entry role="datatype_keyword">struct</entry><entry role="function_name"><link linkend="GtkTreeDragDestIface">GtkTreeDragDestIface</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GTK-TYPE-TREE-ROW-DATA:CAPS">GTK_TYPE_TREE_ROW_DATA</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gtk4-GtkTreeView-drag-and-drop.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GInterface">GInterface</link>
    <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> GtkTreeDragDest
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkTreeDragSource
</screen>
</refsect1>
<refsect1 id="gtk4-GtkTreeView-drag-and-drop.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GtkTreeDragSource is implemented by
 <link linkend="GtkListStore">GtkListStore</link>,  <link linkend="GtkTreeModelFilter">GtkTreeModelFilter</link>,  <link linkend="GtkTreeModelSort">GtkTreeModelSort</link> and  <link linkend="GtkTreeStore">GtkTreeStore</link>.</para>
<para>
GtkTreeDragDest is implemented by
 <link linkend="GtkListStore">GtkListStore</link> and  <link linkend="GtkTreeStore">GtkTreeStore</link>.</para>

</refsect1>

<refsect1 id="gtk4-GtkTreeView-drag-and-drop.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="gtk4-GtkTreeView-drag-and-drop.description" role="desc">
<title role="desc.title">Description</title>
<para>GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level
API.</para>
<para>The low-level API consists of the GTK+ DND API, augmented by some treeview
utility functions: <link linkend="gtk-tree-view-set-drag-dest-row"><function>gtk_tree_view_set_drag_dest_row()</function></link>,
<link linkend="gtk-tree-view-get-drag-dest-row"><function>gtk_tree_view_get_drag_dest_row()</function></link>, <link linkend="gtk-tree-view-get-dest-row-at-pos"><function>gtk_tree_view_get_dest_row_at_pos()</function></link>,
<link linkend="gtk-tree-view-create-row-drag-icon"><function>gtk_tree_view_create_row_drag_icon()</function></link>, <link linkend="gtk-tree-set-row-drag-data"><function>gtk_tree_set_row_drag_data()</function></link> and
<link linkend="gtk-tree-get-row-drag-data"><function>gtk_tree_get_row_drag_data()</function></link>. This API leaves a lot of flexibility, but
nothing is done automatically, and implementing advanced features like
hover-to-open-rows or autoscrolling on top of this API is a lot of work.</para>
<para>On the other hand, if you write to the high-level API, then all the
bookkeeping of rows is done for you, as well as things like hover-to-open
and auto-scroll, but your models have to implement the
<link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> and <link linkend="GtkTreeDragDest"><type>GtkTreeDragDest</type></link> interfaces.</para>

</refsect1>
<refsect1 id="gtk4-GtkTreeView-drag-and-drop.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-tree-drag-source-drag-data-delete" role="function">
<title>gtk_tree_drag_source_drag_data_delete&#160;()</title>
<indexterm zone="gtk-tree-drag-source-drag-data-delete"><primary>gtk_tree_drag_source_drag_data_delete</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_tree_drag_source_drag_data_delete (<parameter><link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> *drag_source</parameter>,
                                       <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *path</parameter>);</programlisting>
<para>Asks the <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> to delete the row at <parameter>path</parameter>
, because
it was moved somewhere else via drag-and-drop. Returns <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
if the deletion fails because <parameter>path</parameter>
 no longer exists, or for
some model-specific reason. Should robustly handle a <parameter>path</parameter>
 no
longer found in the model!</para>
<refsect3 id="gtk-tree-drag-source-drag-data-delete.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>drag_source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>row that was being dragged</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-drag-source-drag-data-delete.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the row was successfully deleted</para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-drag-source-drag-data-get" role="function">
<title>gtk_tree_drag_source_drag_data_get&#160;()</title>
<indexterm zone="gtk-tree-drag-source-drag-data-get"><primary>gtk_tree_drag_source_drag_data_get</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
gtk_tree_drag_source_drag_data_get (<parameter><link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> *drag_source</parameter>,
                                    <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *path</parameter>);</programlisting>
<para>Asks the <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> to return a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> representing
the row at <parameter>path</parameter>
. Should robustly handle a <parameter>path</parameter>
 no
longer found in the model!</para>
<refsect3 id="gtk-tree-drag-source-drag-data-get.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>drag_source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>row that was dragged</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-drag-source-drag-data-get.returns" role="returns">
<title>Returns</title>
<para>a <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link> for the
given <parameter>path</parameter>
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none exists. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-drag-source-row-draggable" role="function">
<title>gtk_tree_drag_source_row_draggable&#160;()</title>
<indexterm zone="gtk-tree-drag-source-row-draggable"><primary>gtk_tree_drag_source_row_draggable</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_tree_drag_source_row_draggable (<parameter><link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> *drag_source</parameter>,
                                    <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *path</parameter>);</programlisting>
<para>Asks the <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> whether a particular row can be used as
the source of a DND operation. If the source doesn’t implement
this interface, the row is assumed draggable.</para>
<refsect3 id="gtk-tree-drag-source-row-draggable.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>drag_source</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>row on which user is initiating a drag</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-drag-source-row-draggable.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the row can be dragged</para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-drag-dest-drag-data-received" role="function">
<title>gtk_tree_drag_dest_drag_data_received&#160;()</title>
<indexterm zone="gtk-tree-drag-dest-drag-data-received"><primary>gtk_tree_drag_dest_drag_data_received</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_tree_drag_dest_drag_data_received (<parameter><link linkend="GtkTreeDragDest"><type>GtkTreeDragDest</type></link> *drag_dest</parameter>,
                                       <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *dest</parameter>,
                                       <parameter>const <link linkend="GValue"><type>GValue</type></link> *value</parameter>);</programlisting>
<para>Asks the <link linkend="GtkTreeDragDest"><type>GtkTreeDragDest</type></link> to insert a row before the path <parameter>dest</parameter>
,
deriving the contents of the row from <parameter>value</parameter>
. If <parameter>dest</parameter>
 is
outside the tree so that inserting before it is impossible, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>
will be returned. Also, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> may be returned if the new row is
not created for some model-specific reason.  Should robustly handle
a <parameter>dest</parameter>
 no longer found in the model!</para>
<refsect3 id="gtk-tree-drag-dest-drag-data-received.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>drag_dest</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeDragDest"><type>GtkTreeDragDest</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>dest</para></entry>
<entry role="parameter_description"><para>row to drop in front of</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>data to drop</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-drag-dest-drag-data-received.returns" role="returns">
<title>Returns</title>
<para> whether a new row was created before position <parameter>dest</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-drag-dest-row-drop-possible" role="function">
<title>gtk_tree_drag_dest_row_drop_possible&#160;()</title>
<indexterm zone="gtk-tree-drag-dest-row-drop-possible"><primary>gtk_tree_drag_dest_row_drop_possible</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_tree_drag_dest_row_drop_possible (<parameter><link linkend="GtkTreeDragDest"><type>GtkTreeDragDest</type></link> *drag_dest</parameter>,
                                      <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *dest_path</parameter>,
                                      <parameter>const <link linkend="GValue"><type>GValue</type></link> *value</parameter>);</programlisting>
<para>Determines whether a drop is possible before the given <parameter>dest_path</parameter>
,
at the same depth as <parameter>dest_path</parameter>
. i.e., can we drop the data in
<parameter>value</parameter>
 at that location. <parameter>dest_path</parameter>
 does not have to
exist; the return value will almost certainly be <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if the
parent of <parameter>dest_path</parameter>
 doesn’t exist, though.</para>
<refsect3 id="gtk-tree-drag-dest-row-drop-possible.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>drag_dest</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeDragDest"><type>GtkTreeDragDest</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>dest_path</para></entry>
<entry role="parameter_description"><para>destination row</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>the data being dropped</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-drag-dest-row-drop-possible.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a drop is possible before <parameter>dest_path</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-create-row-drag-content" role="function">
<title>gtk_tree_create_row_drag_content&#160;()</title>
<indexterm zone="gtk-tree-create-row-drag-content"><primary>gtk_tree_create_row_drag_content</primary></indexterm>
<programlisting language="C"><link linkend="GdkContentProvider"><returnvalue>GdkContentProvider</returnvalue></link>&#160;*
gtk_tree_create_row_drag_content (<parameter><link linkend="GtkTreeModel"><type>GtkTreeModel</type></link> *tree_model</parameter>,
                                  <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> *path</parameter>);</programlisting>
<para>Creates a content provider for dragging <parameter>path</parameter>
 from <parameter>tree_model</parameter>
.</para>
<refsect3 id="gtk-tree-create-row-drag-content.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>tree_model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>a row in <parameter>tree_model</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-create-row-drag-content.returns" role="returns">
<title>Returns</title>
<para>a new <link linkend="GdkContentProvider"><type>GdkContentProvider</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-tree-get-row-drag-data" role="function">
<title>gtk_tree_get_row_drag_data&#160;()</title>
<indexterm zone="gtk-tree-get-row-drag-data"><primary>gtk_tree_get_row_drag_data</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_tree_get_row_drag_data (<parameter>const <link linkend="GValue"><type>GValue</type></link> *value</parameter>,
                            <parameter><link linkend="GtkTreeModel"><type>GtkTreeModel</type></link> **tree_model</parameter>,
                            <parameter><link linkend="GtkTreePath"><type>GtkTreePath</type></link> **path</parameter>);</programlisting>
<para>Obtains a <parameter>tree_model</parameter>
 and <parameter>path</parameter>
 from value of target type
<link linkend="GTK-TYPE-TREE-ROW-DATA:CAPS"><literal>GTK_TYPE_TREE_ROW_DATA</literal></link>.</para>
<para>The returned path must be freed with <link linkend="gtk-tree-path-free"><function>gtk_tree_path_free()</function></link>.</para>
<refsect3 id="gtk-tree-get-row-drag-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>a <link linkend="GValue"><type>GValue</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tree_model</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkTreeModel"><type>GtkTreeModel</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>transfer none</acronym>][<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>path</para></entry>
<entry role="parameter_description"><para>row in <parameter>tree_model</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>optional</acronym>][<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-tree-get-row-drag-data.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>selection_data</parameter>
had target type <link linkend="GTK-TYPE-TREE-ROW-DATA:CAPS"><literal>GTK_TYPE_TREE_ROW_DATA</literal></link>
is otherwise valid</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="gtk4-GtkTreeView-drag-and-drop.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkTreeDragSource-struct" role="struct">
<title>GtkTreeDragSource</title>
<indexterm zone="GtkTreeDragSource-struct"><primary>GtkTreeDragSource</primary></indexterm>
<programlisting language="C">typedef struct _GtkTreeDragSource GtkTreeDragSource;</programlisting>
</refsect2>
<refsect2 id="GtkTreeDragSourceIface" role="struct">
<title>struct GtkTreeDragSourceIface</title>
<indexterm zone="GtkTreeDragSourceIface"><primary>GtkTreeDragSourceIface</primary></indexterm>
<programlisting language="C">struct GtkTreeDragSourceIface {
  /* VTable - not signals */

  gboolean     (* row_draggable)        (GtkTreeDragSource   *drag_source,
                                         GtkTreePath         *path);

  GdkContentProvider * (* drag_data_get)(GtkTreeDragSource   *drag_source,
                                         GtkTreePath         *path);

  gboolean     (* drag_data_delete)     (GtkTreeDragSource *drag_source,
                                         GtkTreePath       *path);
};
</programlisting>
<refsect3 id="GtkTreeDragSourceIface.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkTreeDragSourceIface.row-draggable">row_draggable</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Asks the <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> whether a particular
row can be used as the source of a DND operation.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkTreeDragSourceIface.drag-data-get">drag_data_get</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Asks the <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> to fill in
selection_data with a representation of the row at path.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkTreeDragSourceIface.drag-data-delete">drag_data_delete</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Asks the <link linkend="GtkTreeDragSource"><type>GtkTreeDragSource</type></link> to delete the row at
path, because it was moved somewhere else via drag-and-drop.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="GtkTreeDragDest-struct" role="struct">
<title>GtkTreeDragDest</title>
<indexterm zone="GtkTreeDragDest-struct"><primary>GtkTreeDragDest</primary></indexterm>
<programlisting language="C">typedef struct _GtkTreeDragDest GtkTreeDragDest;</programlisting>
</refsect2>
<refsect2 id="GtkTreeDragDestIface" role="struct">
<title>struct GtkTreeDragDestIface</title>
<indexterm zone="GtkTreeDragDestIface"><primary>GtkTreeDragDestIface</primary></indexterm>
<programlisting language="C">struct GtkTreeDragDestIface {
  /* VTable - not signals */

  gboolean     (* drag_data_received) (GtkTreeDragDest   *drag_dest,
                                       GtkTreePath       *dest,
                                       const GValue      *value);

  gboolean     (* row_drop_possible)  (GtkTreeDragDest   *drag_dest,
                                       GtkTreePath       *dest_path,
                                       const GValue      *value);
};
</programlisting>
<refsect3 id="GtkTreeDragDestIface.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkTreeDragDestIface.drag-data-received">drag_data_received</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Asks the <link linkend="GtkTreeDragDest"><type>GtkTreeDragDest</type></link> to insert a row
before the path dest, deriving the contents of the row from
selection_data.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><structfield id="GtkTreeDragDestIface.row-drop-possible">row_drop_possible</structfield>&#160;()</para></entry>
<entry role="struct_member_description"><para>Determines whether a drop is possible before
the given dest_path, at the same depth as dest_path.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
</refsect2>
<refsect2 id="GTK-TYPE-TREE-ROW-DATA:CAPS" role="macro">
<title>GTK_TYPE_TREE_ROW_DATA</title>
<indexterm zone="GTK-TYPE-TREE-ROW-DATA:CAPS"><primary>GTK_TYPE_TREE_ROW_DATA</primary></indexterm>
<programlisting language="C">#define GTK_TYPE_TREE_ROW_DATA (gtk_tree_row_data_get_type ())
</programlisting>
<para>Data in this format will be provided by <link linkend="gtk-tree-create-row-drag-content"><function>gtk_tree_create_row_drag_content()</function></link>
and can be consumed via <link linkend="gtk-tree-get-row-drag-data"><function>gtk_tree_get_row_drag_data()</function></link>.</para>
</refsect2>

</refsect1>

</refentry>
