<?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="GtkGestureSingle">
<refmeta>
<refentrytitle role="top_of_page" id="GtkGestureSingle.top_of_page">GtkGestureSingle</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkGestureSingle</refname>
<refpurpose>Base class for mouse/single-touch gestures</refpurpose>
</refnamediv>

<refsect1 id="GtkGestureSingle.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-gesture-single-get-exclusive">gtk_gesture_single_get_exclusive</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-gesture-single-set-exclusive">gtk_gesture_single_set_exclusive</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-single-get-touch-only">gtk_gesture_single_get_touch_only</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-gesture-single-set-touch-only">gtk_gesture_single_set_touch_only</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-gesture-single-get-button">gtk_gesture_single_get_button</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-gesture-single-set-button">gtk_gesture_single_set_button</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-gesture-single-get-current-button">gtk_gesture_single_get_current_button</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkEventSequence"><returnvalue>GdkEventSequence</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-gesture-single-get-current-sequence">gtk_gesture_single_get_current_sequence</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkGestureSingle.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="guint"><type>guint</type></link></entry><entry role="property_name"><link linkend="GtkGestureSingle--button">button</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkGestureSingle--exclusive">exclusive</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkGestureSingle--touch-only">touch-only</link></entry><entry role="property_flags">Read / Write</entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkGestureSingle.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> GtkGestureSingle
                <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> <link linkend="GtkDragSource">GtkDragSource</link>
                <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> <link linkend="GtkGestureClick">GtkGestureClick</link>
                <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> <link linkend="GtkGestureDrag">GtkGestureDrag</link>
                <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> <link linkend="GtkGestureLongPress">GtkGestureLongPress</link>
                <phrase role="lineart">&#9500;&#9472;&#9472;</phrase> <link linkend="GtkGestureStylus">GtkGestureStylus</link>
                <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkGestureSwipe">GtkGestureSwipe</link>
</screen>
</refsect1>

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

<refsect1 id="GtkGestureSingle.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> is a subclass of <link linkend="GtkGesture"><type>GtkGesture</type></link>, optimized (although
not restricted) for dealing with mouse and single-touch gestures. Under
interaction, these gestures stick to the first interacting sequence, which
is accessible through <link linkend="gtk-gesture-single-get-current-sequence"><function>gtk_gesture_single_get_current_sequence()</function></link> while the
gesture is being interacted with.</para>
<para>By default gestures react to both <link linkend="GDK-BUTTON-PRIMARY:CAPS"><literal>GDK_BUTTON_PRIMARY</literal></link> and touch
events, <link linkend="gtk-gesture-single-set-touch-only"><function>gtk_gesture_single_set_touch_only()</function></link> can be used to change the
touch behavior. Callers may also specify a different mouse button number
to interact with through <link linkend="gtk-gesture-single-set-button"><function>gtk_gesture_single_set_button()</function></link>, or react to any
mouse button by setting 0. While the gesture is active, the button being
currently pressed can be known through <link linkend="gtk-gesture-single-get-current-button"><function>gtk_gesture_single_get_current_button()</function></link>.</para>

</refsect1>
<refsect1 id="GtkGestureSingle.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-gesture-single-get-exclusive" role="function">
<title>gtk_gesture_single_get_exclusive&#160;()</title>
<indexterm zone="gtk-gesture-single-get-exclusive"><primary>gtk_gesture_single_get_exclusive</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_gesture_single_get_exclusive (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>);</programlisting>
<para>Gets whether a gesture is exclusive. For more information, see
<link linkend="gtk-gesture-single-set-exclusive"><function>gtk_gesture_single_set_exclusive()</function></link>.</para>
<refsect3 id="gtk-gesture-single-get-exclusive.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-single-get-exclusive.returns" role="returns">
<title>Returns</title>
<para> Whether the gesture is exclusive</para>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-single-set-exclusive" role="function">
<title>gtk_gesture_single_set_exclusive&#160;()</title>
<indexterm zone="gtk-gesture-single-set-exclusive"><primary>gtk_gesture_single_set_exclusive</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_gesture_single_set_exclusive (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>,
                                  <parameter><link linkend="gboolean"><type>gboolean</type></link> exclusive</parameter>);</programlisting>
<para>Sets whether <parameter>gesture</parameter>
 is exclusive. An exclusive gesture will
only handle pointer and "pointer emulated" touch events, so at
any given time, there is only one sequence able to interact with
those.</para>
<refsect3 id="gtk-gesture-single-set-exclusive.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>exclusive</para></entry>
<entry role="parameter_description"><para><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> to make <parameter>gesture</parameter>
exclusive</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-single-get-touch-only" role="function">
<title>gtk_gesture_single_get_touch_only&#160;()</title>
<indexterm zone="gtk-gesture-single-get-touch-only"><primary>gtk_gesture_single_get_touch_only</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_gesture_single_get_touch_only (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>);</programlisting>
<para>Returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the gesture is only triggered by touch events.</para>
<refsect3 id="gtk-gesture-single-get-touch-only.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-single-get-touch-only.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the gesture only handles touch events</para>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-single-set-touch-only" role="function">
<title>gtk_gesture_single_set_touch_only&#160;()</title>
<indexterm zone="gtk-gesture-single-set-touch-only"><primary>gtk_gesture_single_set_touch_only</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_gesture_single_set_touch_only (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>,
                                   <parameter><link linkend="gboolean"><type>gboolean</type></link> touch_only</parameter>);</programlisting>
<para>If <parameter>touch_only</parameter>
 is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, <parameter>gesture</parameter>
 will only handle events of type
<link linkend="GDK-TOUCH-BEGIN:CAPS"><type>GDK_TOUCH_BEGIN</type></link>, <link linkend="GDK-TOUCH-UPDATE:CAPS"><type>GDK_TOUCH_UPDATE</type></link> or <link linkend="GDK-TOUCH-END:CAPS"><type>GDK_TOUCH_END</type></link>. If <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>,
mouse events will be handled too.</para>
<refsect3 id="gtk-gesture-single-set-touch-only.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>touch_only</para></entry>
<entry role="parameter_description"><para>whether <parameter>gesture</parameter>
handles only touch events</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-single-get-button" role="function">
<title>gtk_gesture_single_get_button&#160;()</title>
<indexterm zone="gtk-gesture-single-get-button"><primary>gtk_gesture_single_get_button</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gtk_gesture_single_get_button (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>);</programlisting>
<para>Returns the button number <parameter>gesture</parameter>
 listens for, or 0 if <parameter>gesture</parameter>

reacts to any button press.</para>
<refsect3 id="gtk-gesture-single-get-button.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-single-get-button.returns" role="returns">
<title>Returns</title>
<para> The button number, or 0 for any button</para>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-single-set-button" role="function">
<title>gtk_gesture_single_set_button&#160;()</title>
<indexterm zone="gtk-gesture-single-set-button"><primary>gtk_gesture_single_set_button</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_gesture_single_set_button (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>,
                               <parameter><link linkend="guint"><type>guint</type></link> button</parameter>);</programlisting>
<para>Sets the button number <parameter>gesture</parameter>
 listens to. If non-0, every
button press from a different button number will be ignored.
Touch events implicitly match with button 1.</para>
<refsect3 id="gtk-gesture-single-set-button.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>button</para></entry>
<entry role="parameter_description"><para>button number to listen to, or 0 for any button</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-single-get-current-button" role="function">
<title>gtk_gesture_single_get_current_button&#160;()</title>
<indexterm zone="gtk-gesture-single-get-current-button"><primary>gtk_gesture_single_get_current_button</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gtk_gesture_single_get_current_button (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>);</programlisting>
<para>Returns the button number currently interacting with <parameter>gesture</parameter>
, or 0 if there
is none.</para>
<refsect3 id="gtk-gesture-single-get-current-button.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-single-get-current-button.returns" role="returns">
<title>Returns</title>
<para> The current button number</para>
</refsect3></refsect2>
<refsect2 id="gtk-gesture-single-get-current-sequence" role="function">
<title>gtk_gesture_single_get_current_sequence&#160;()</title>
<indexterm zone="gtk-gesture-single-get-current-sequence"><primary>gtk_gesture_single_get_current_sequence</primary></indexterm>
<programlisting language="C"><link linkend="GdkEventSequence"><returnvalue>GdkEventSequence</returnvalue></link>&#160;*
gtk_gesture_single_get_current_sequence
                               (<parameter><link linkend="GtkGestureSingle"><type>GtkGestureSingle</type></link> *gesture</parameter>);</programlisting>
<para>Returns the event sequence currently interacting with <parameter>gesture</parameter>
.
This is only meaningful if <link linkend="gtk-gesture-is-active"><function>gtk_gesture_is_active()</function></link> returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.</para>
<refsect3 id="gtk-gesture-single-get-current-sequence.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="GtkGestureSingle"><type>GtkGestureSingle</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-gesture-single-get-current-sequence.returns" role="returns">
<title>Returns</title>
<para>the current sequence. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkGestureSingle.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkGestureSingle--button" role="property"><title>The <literal>“button”</literal> property</title>
<indexterm zone="GtkGestureSingle--button"><primary>GtkGestureSingle:button</primary></indexterm>
<programlisting>  “button”                   <link linkend="guint"><type>guint</type></link></programlisting>
<para>Mouse button number to listen to, or 0 to listen for any button.</para>
<para>Owner: GtkGestureSingle</para>
<para>Flags: Read / Write</para>
<para>Default value: 1</para>
</refsect2>
<refsect2 id="GtkGestureSingle--exclusive" role="property"><title>The <literal>“exclusive”</literal> property</title>
<indexterm zone="GtkGestureSingle--exclusive"><primary>GtkGestureSingle:exclusive</primary></indexterm>
<programlisting>  “exclusive”                <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the gesture is exclusive. Exclusive gestures only listen to pointer
and pointer emulated events.</para>
<para>Owner: GtkGestureSingle</para>
<para>Flags: Read / Write</para>
<para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkGestureSingle--touch-only" role="property"><title>The <literal>“touch-only”</literal> property</title>
<indexterm zone="GtkGestureSingle--touch-only"><primary>GtkGestureSingle:touch-only</primary></indexterm>
<programlisting>  “touch-only”               <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the gesture handles only touch events.</para>
<para>Owner: GtkGestureSingle</para>
<para>Flags: Read / Write</para>
<para>Default value: FALSE</para>
</refsect2>

</refsect1>

</refentry>
