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

<refsect1 id="GtkGestureSwipe.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-swipe-new">gtk_gesture_swipe_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-swipe-get-velocity">gtk_gesture_swipe_get_velocity</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkGestureSwipe.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="GtkGestureSwipe-swipe">swipe</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkGestureSwipe.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> GtkGestureSwipe
</screen>
</refsect1>

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

<refsect1 id="GtkGestureSwipe.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkGestureSwipe"><type>GtkGestureSwipe</type></link> is a <link linkend="GtkGesture"><type>GtkGesture</type></link> implementation able to recognize
swipes, after a press/move/.../move/release sequence happens, the
<link linkend="GtkGestureSwipe-swipe"><type>“swipe”</type></link> signal will be emitted, providing the velocity
and directionality of the sequence at the time it was lifted.</para>
<para>If the velocity is desired in intermediate points,
<link linkend="gtk-gesture-swipe-get-velocity"><function>gtk_gesture_swipe_get_velocity()</function></link> can be called on eg. a
<link linkend="GtkGesture-update"><type>“update”</type></link> handler.</para>
<para>All velocities are reported in pixels/sec units.</para>

</refsect1>
<refsect1 id="GtkGestureSwipe.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-gesture-swipe-new" role="function">
<title>gtk_gesture_swipe_new&#160;()</title>
<indexterm zone="gtk-gesture-swipe-new"><primary>gtk_gesture_swipe_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkGesture"><returnvalue>GtkGesture</returnvalue></link>&#160;*
gtk_gesture_swipe_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Returns a newly created <link linkend="GtkGesture"><type>GtkGesture</type></link> that recognizes swipes.</para>
<refsect3 id="gtk-gesture-swipe-new.returns" role="returns">
<title>Returns</title>
<para> a newly created <link linkend="GtkGestureSwipe"><type>GtkGestureSwipe</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-swipe-get-velocity" role="function">
<title>gtk_gesture_swipe_get_velocity&#160;()</title>
<indexterm zone="gtk-gesture-swipe-get-velocity"><primary>gtk_gesture_swipe_get_velocity</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_gesture_swipe_get_velocity (<parameter><link linkend="GtkGestureSwipe"><type>GtkGestureSwipe</type></link> *gesture</parameter>,
                                <parameter><link linkend="gdouble"><type>gdouble</type></link> *velocity_x</parameter>,
                                <parameter><link linkend="gdouble"><type>gdouble</type></link> *velocity_y</parameter>);</programlisting>
<para>If the gesture is recognized, this function returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> and fill in
<parameter>velocity_x</parameter>
 and <parameter>velocity_y</parameter>
 with the recorded velocity, as per the
last event(s) processed.</para>
<refsect3 id="gtk-gesture-swipe-get-velocity.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="GtkGestureSwipe"><type>GtkGestureSwipe</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>velocity_x</para></entry>
<entry role="parameter_description"><para>return value for the velocity in the X axis, in pixels/sec. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>velocity_y</para></entry>
<entry role="parameter_description"><para>return value for the velocity in the Y axis, in pixels/sec. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>out</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-swipe-get-velocity.returns" role="returns">
<title>Returns</title>
<para> whether velocity could be calculated</para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkGestureSwipe.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkGestureSwipe-swipe" role="signal"><title>The <literal>“swipe”</literal> signal</title>
<indexterm zone="GtkGestureSwipe-swipe"><primary>GtkGestureSwipe::swipe</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkGestureSwipe"><type>GtkGestureSwipe</type></link> *gesture,
               <link linkend="gdouble"><type>gdouble</type></link>          velocity_x,
               <link linkend="gdouble"><type>gdouble</type></link>          velocity_y,
               <link linkend="gpointer"><type>gpointer</type></link>         user_data)</programlisting>
<para>This signal is emitted when the recognized gesture is finished, velocity
and direction are a product of previously recorded events.</para>
<refsect3 id="GtkGestureSwipe-swipe.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>object which received the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>velocity_x</para></entry>
<entry role="parameter_description"><para>velocity in the X axis, in pixels/sec</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>velocity_y</para></entry>
<entry role="parameter_description"><para>velocity in the Y axis, in pixels/sec</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>

</refentry>
