<?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="GtkDragIcon">
<refmeta>
<refentrytitle role="top_of_page" id="GtkDragIcon.top_of_page">GtkDragIcon</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkDragIcon</refname>
<refpurpose>A toplevel to use as drag icon</refpurpose>
</refnamediv>

<refsect1 id="GtkDragIcon.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="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drag-icon-get-for-drag">gtk_drag_icon_get_for_drag</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-icon-set-child">gtk_drag_icon_set_child</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drag-icon-get-child">gtk_drag_icon_get_child</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drag-icon-set-from-paintable">gtk_drag_icon_set_from_paintable</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-drag-icon-create-widget-for-value">gtk_drag_icon_create_widget_for_value</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDragIcon.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GtkWidget"><type>GtkWidget</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkDragIcon--child">child</link></entry><entry role="property_flags">Read / Write</entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDragIcon.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkDragIcon
</screen>
</refsect1>
<refsect1 id="GtkDragIcon.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkDragIcon implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link>,  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link>,  <link linkend="GtkNative">GtkNative</link> and  <link linkend="GtkRoot">GtkRoot</link>.</para>

</refsect1>

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

<refsect1 id="GtkDragIcon.description" role="desc">
<title role="desc.title">Description</title>
<para>GtkDragIcon is a <link linkend="GtkRoot"><type>GtkRoot</type></link> implementation with the sole purpose
to serve as a drag icon during DND operations. A drag icon moves
with the pointer during a drag operation and is destroyed when
the drag ends.</para>
<para>To set up a drag icon and associate it with an ongoing drag operation,
use <link linkend="gtk-drag-icon-get-for-drag"><function>gtk_drag_icon_get_for_drag()</function></link> to get the icon for a drag. You can
then use it like any other widget and use <link linkend="gtk-drag-icon-set-child"><function>gtk_drag_icon_set_child()</function></link> to
set whatever widget should be used for the drag icon.</para>
<para>Keep in mind that drag icons do not allow user input.</para>

</refsect1>
<refsect1 id="GtkDragIcon.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-drag-icon-get-for-drag" role="function">
<title>gtk_drag_icon_get_for_drag&#160;()</title>
<indexterm zone="gtk-drag-icon-get-for-drag"><primary>gtk_drag_icon_get_for_drag</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_drag_icon_get_for_drag (<parameter><link linkend="GdkDrag"><type>GdkDrag</type></link> *drag</parameter>);</programlisting>
<para>Gets the <link linkend="GtkDragIcon"><type>GtkDragIcon</type></link> in use with <parameter>drag</parameter>
.</para>
<para>If no drag icon exists yet, a new one will be created
and shown.</para>
<refsect3 id="gtk-drag-icon-get-for-drag.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</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDrag"><type>GdkDrag</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drag-icon-get-for-drag.returns" role="returns">
<title>Returns</title>
<para>the <link linkend="GtkDragIcon"><type>GtkDragIcon</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drag-icon-set-child" role="function">
<title>gtk_drag_icon_set_child&#160;()</title>
<indexterm zone="gtk-drag-icon-set-child"><primary>gtk_drag_icon_set_child</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drag_icon_set_child (<parameter><link linkend="GtkDragIcon"><type>GtkDragIcon</type></link> *self</parameter>,
                         <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *child</parameter>);</programlisting>
<para>Sets the widget to display as the drag icon.</para>
<refsect3 id="gtk-drag-icon-set-child.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragIcon"><type>GtkDragIcon</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>child</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkWidget"><type>GtkWidget</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drag-icon-get-child" role="function">
<title>gtk_drag_icon_get_child&#160;()</title>
<indexterm zone="gtk-drag-icon-get-child"><primary>gtk_drag_icon_get_child</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_drag_icon_get_child (<parameter><link linkend="GtkDragIcon"><type>GtkDragIcon</type></link> *self</parameter>);</programlisting>
<para>Gets the widget currently used as drag icon.</para>
<refsect3 id="gtk-drag-icon-get-child.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkDragIcon"><type>GtkDragIcon</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drag-icon-get-child.returns" role="returns">
<title>Returns</title>
<para>The drag icon or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-drag-icon-set-from-paintable" role="function">
<title>gtk_drag_icon_set_from_paintable&#160;()</title>
<indexterm zone="gtk-drag-icon-set-from-paintable"><primary>gtk_drag_icon_set_from_paintable</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drag_icon_set_from_paintable (<parameter><link linkend="GdkDrag"><type>GdkDrag</type></link> *drag</parameter>,
                                  <parameter><link linkend="GdkPaintable"><type>GdkPaintable</type></link> *paintable</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> hot_x</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> hot_y</parameter>);</programlisting>
<para>Creates a <link linkend="GtkDragIcon"><type>GtkDragIcon</type></link> that shows <parameter>paintable</parameter>
, and associates
it with the drag operation. The hotspot position on the paintable
is aligned with the hotspot of the cursor.</para>
<refsect3 id="gtk-drag-icon-set-from-paintable.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</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDrag"><type>GdkDrag</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>paintable</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPaintable"><type>GdkPaintable</type></link> to display</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>hot_x</para></entry>
<entry role="parameter_description"><para>X coordinate of the hotspot</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>hot_y</para></entry>
<entry role="parameter_description"><para>Y coordinate of the hotspot</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drag-icon-create-widget-for-value" role="function">
<title>gtk_drag_icon_create_widget_for_value&#160;()</title>
<indexterm zone="gtk-drag-icon-create-widget-for-value"><primary>gtk_drag_icon_create_widget_for_value</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_drag_icon_create_widget_for_value (<parameter>const <link linkend="GValue"><type>GValue</type></link> *value</parameter>);</programlisting>
<para>Creates a widget that can be used as a drag icon for the given
<parameter>value</parameter>
.</para>
<para>If GTK does not know how to create a widget for a given value,
it will return <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<para>This method is used to set the default drag icon on drag'n'drop
operations started by <link linkend="GtkDragSource"><type>GtkDragSource</type></link>, so you don't need to set
a drag icon using this function there.</para>
<refsect3 id="gtk-drag-icon-create-widget-for-value.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>a <link linkend="GValue"><type>GValue</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drag-icon-create-widget-for-value.returns" role="returns">
<title>Returns</title>
<para>A new <link linkend="GtkWidget"><type>GtkWidget</type></link>
for displaying <parameter>value</parameter>
as a drag icon. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkDragIcon.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkDragIcon--child" role="property"><title>The <literal>“child”</literal> property</title>
<indexterm zone="GtkDragIcon--child"><primary>GtkDragIcon:child</primary></indexterm>
<programlisting>  “child”                    <link linkend="GtkWidget"><type>GtkWidget</type></link>&#160;*</programlisting>
<para>The widget to display as drag icon.</para>
<para>Owner: GtkDragIcon</para>
<para>Flags: Read / Write</para>
</refsect2>

</refsect1>

</refentry>
