<?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="GtkGestureDrag">
<refmeta>
<refentrytitle role="top_of_page" id="GtkGestureDrag.top_of_page">GtkGestureDrag</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkGestureDrag</refname>
<refpurpose>Drag gesture</refpurpose>
</refnamediv>

<refsect1 id="GtkGestureDrag.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="GtkGesture"><returnvalue>GtkGesture</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-gesture-drag-new">gtk_gesture_drag_new</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-gesture-drag-get-start-point">gtk_gesture_drag_get_start_point</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-gesture-drag-get-offset">gtk_gesture_drag_get_offset</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkGestureDrag.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkGestureDrag-drag-begin">drag-begin</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkGestureDrag-drag-end">drag-end</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkGestureDrag-drag-update">drag-update</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkGestureDrag.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="GtkEventController">GtkEventController</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkGesture">GtkGesture</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkGestureSingle">GtkGestureSingle</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkGestureDrag
                    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkGesturePan">GtkGesturePan</link>
</screen>
</refsect1>

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

<refsect1 id="GtkGestureDrag.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkGestureDrag"><type>GtkGestureDrag</type></link> is a <link linkend="GtkGesture"><type>GtkGesture</type></link> implementation that recognizes drag
operations. The drag operation itself can be tracked throught the
<link linkend="GtkGestureDrag-drag-begin"><type>“drag-begin”</type></link>, <link linkend="GtkGestureDrag-drag-update"><type>“drag-update”</type></link> and
<link linkend="GtkGestureDrag-drag-end"><type>“drag-end”</type></link> signals, or the relevant coordinates be
extracted through <link linkend="gtk-gesture-drag-get-offset"><function>gtk_gesture_drag_get_offset()</function></link> and
<link linkend="gtk-gesture-drag-get-start-point"><function>gtk_gesture_drag_get_start_point()</function></link>.</para>

</refsect1>
<refsect1 id="GtkGestureDrag.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-gesture-drag-new" role="function">
<title>gtk_gesture_drag_new&#160;()</title>
<indexterm zone="gtk-gesture-drag-new"><primary>gtk_gesture_drag_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkGesture"><returnvalue>GtkGesture</returnvalue></link>&#160;*
gtk_gesture_drag_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Returns a newly created <link linkend="GtkGesture"><type>GtkGesture</type></link> that recognizes drags.</para>
<refsect3 id="gtk-gesture-drag-new.returns" role="returns">
<title>Returns</title>
<para> a newly created <link linkend="GtkGestureDrag"><type>GtkGestureDrag</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-drag-get-start-point" role="function">
<title>gtk_gesture_drag_get_start_point&#160;()</title>
<indexterm zone="gtk-gesture-drag-get-start-point"><primary>gtk_gesture_drag_get_start_point</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_gesture_drag_get_start_point (<parameter><link linkend="GtkGestureDrag"><type>GtkGestureDrag</type></link> *gesture</parameter>,
                                  <parameter><link linkend="gdouble"><type>gdouble</type></link> *x</parameter>,
                                  <parameter><link linkend="gdouble"><type>gdouble</type></link> *y</parameter>);</programlisting>
<para>If the <parameter>gesture</parameter>
 is active, this function returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>
and fills in <parameter>x</parameter>
 and <parameter>y</parameter>
 with the drag start coordinates,
in window-relative coordinates.</para>
<refsect3 id="gtk-gesture-drag-get-start-point.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>gesture</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkGesture"><type>GtkGesture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>x</para></entry>
<entry role="parameter_description"><para>X coordinate for the drag start point. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>y</para></entry>
<entry role="parameter_description"><para>Y coordinate for the drag start point. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-drag-get-start-point.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the gesture is active</para>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-drag-get-offset" role="function">
<title>gtk_gesture_drag_get_offset&#160;()</title>
<indexterm zone="gtk-gesture-drag-get-offset"><primary>gtk_gesture_drag_get_offset</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_gesture_drag_get_offset (<parameter><link linkend="GtkGestureDrag"><type>GtkGestureDrag</type></link> *gesture</parameter>,
                             <parameter><link linkend="gdouble"><type>gdouble</type></link> *x</parameter>,
                             <parameter><link linkend="gdouble"><type>gdouble</type></link> *y</parameter>);</programlisting>
<para>If the <parameter>gesture</parameter>
 is active, this function returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> and
fills in <parameter>x</parameter>
 and <parameter>y</parameter>
 with the coordinates of the current point,
as an offset to the starting drag point.</para>
<refsect3 id="gtk-gesture-drag-get-offset.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>gesture</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkGesture"><type>GtkGesture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>x</para></entry>
<entry role="parameter_description"><para>X offset for the current point. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>y</para></entry>
<entry role="parameter_description"><para>Y offset for the current point. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-drag-get-offset.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the gesture is active</para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkGestureDrag.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkGestureDrag-drag-begin" role="signal"><title>The <literal>“drag-begin”</literal> signal</title>
<indexterm zone="GtkGestureDrag-drag-begin"><primary>GtkGestureDrag::drag-begin</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkGestureDrag"><type>GtkGestureDrag</type></link> *gesture,
               <link linkend="gdouble"><type>gdouble</type></link>         start_x,
               <link linkend="gdouble"><type>gdouble</type></link>         start_y,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>This signal is emitted whenever dragging starts.</para>
<refsect3 id="GtkGestureDrag-drag-begin.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>gesture</para></entry>
<entry role="parameter_description"><para>the object which received the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>start_x</para></entry>
<entry role="parameter_description"><para>X coordinate, relative to the widget allocation</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>start_y</para></entry>
<entry role="parameter_description"><para>Y coordinate, relative to the widget allocation</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkGestureDrag-drag-end" role="signal"><title>The <literal>“drag-end”</literal> signal</title>
<indexterm zone="GtkGestureDrag-drag-end"><primary>GtkGestureDrag::drag-end</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkGestureDrag"><type>GtkGestureDrag</type></link> *gesture,
               <link linkend="gdouble"><type>gdouble</type></link>         offset_x,
               <link linkend="gdouble"><type>gdouble</type></link>         offset_y,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>This signal is emitted whenever the dragging is finished.</para>
<refsect3 id="GtkGestureDrag-drag-end.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>gesture</para></entry>
<entry role="parameter_description"><para>the object which received the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>offset_x</para></entry>
<entry role="parameter_description"><para>X offset, relative to the start point</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>offset_y</para></entry>
<entry role="parameter_description"><para>Y offset, relative to the start point</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2><refsect2 id="GtkGestureDrag-drag-update" role="signal"><title>The <literal>“drag-update”</literal> signal</title>
<indexterm zone="GtkGestureDrag-drag-update"><primary>GtkGestureDrag::drag-update</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkGestureDrag"><type>GtkGestureDrag</type></link> *gesture,
               <link linkend="gdouble"><type>gdouble</type></link>         offset_x,
               <link linkend="gdouble"><type>gdouble</type></link>         offset_y,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>This signal is emitted whenever the dragging point moves.</para>
<refsect3 id="GtkGestureDrag-drag-update.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>gesture</para></entry>
<entry role="parameter_description"><para>the object which received the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>offset_x</para></entry>
<entry role="parameter_description"><para>X offset, relative to the start point</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>offset_y</para></entry>
<entry role="parameter_description"><para>Y offset, relative to the start point</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>
<refsect1 id="GtkGestureDrag.see-also">
<title>See Also</title>
<para><link linkend="GtkGestureSwipe"><type>GtkGestureSwipe</type></link></para>

</refsect1>

</refentry>
