<?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">
]>
<refentry id="GdkDevicePad">
<refmeta>
<refentrytitle role="top_of_page" id="GdkDevicePad.top_of_page">GtkDevicePad</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkDevicePad</refname>
<refpurpose>Pad device interface</refpurpose>
</refnamediv>

<refsect1 id="GdkDevicePad.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="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-device-pad-get-n-groups">gdk_device_pad_get_n_groups</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-device-pad-get-group-n-modes">gdk_device_pad_get_group_n_modes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-device-pad-get-n-features">gdk_device_pad_get_n_features</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-device-pad-get-feature-group">gdk_device_pad_get_feature_group</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkDevicePad.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="GdkDevicePad-struct">GdkDevicePad</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GdkDevicePadFeature">GdkDevicePadFeature</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkDevicePad.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GInterface">GInterface</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkDevicePad
</screen>
</refsect1>
<refsect1 id="GdkDevicePad.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GdkDevicePad requires
 <link linkend="GdkDevice">GdkDevice</link>.</para>

</refsect1>

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

<refsect1 id="GdkDevicePad.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GdkDevicePad"><type>GdkDevicePad</type></link> is an interface implemented by devices of type
<link linkend="GDK-SOURCE-TABLET-PAD:CAPS"><literal>GDK_SOURCE_TABLET_PAD</literal></link>, it allows querying the features provided
by the pad device.</para>
<para>Tablet pads may contain one or more groups, each containing a subset
of the buttons/rings/strips available. <link linkend="gdk-device-pad-get-n-groups"><function>gdk_device_pad_get_n_groups()</function></link>
can be used to obtain the number of groups, <link linkend="gdk-device-pad-get-n-features"><function>gdk_device_pad_get_n_features()</function></link>
and <link linkend="gdk-device-pad-get-feature-group"><function>gdk_device_pad_get_feature_group()</function></link> can be combined to find out the
number of buttons/rings/strips the device has, and how are they grouped.</para>
<para>Each of those groups have different modes, which may be used to map each
individual pad feature to multiple actions. Only one mode is effective
(current) for each given group, different groups may have different
current modes. The number of available modes in a group can be found
out through <link linkend="gdk-device-pad-get-group-n-modes"><function>gdk_device_pad_get_group_n_modes()</function></link>, and the current mode for
a given group will be notified through events of type <link linkend="GDK-PAD-GROUP-MODE:CAPS"><type>GDK_PAD_GROUP_MODE</type></link>.</para>

</refsect1>
<refsect1 id="GdkDevicePad.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-device-pad-get-n-groups" role="function">
<title>gdk_device_pad_get_n_groups&#160;()</title>
<indexterm zone="gdk-device-pad-get-n-groups"><primary>gdk_device_pad_get_n_groups</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_device_pad_get_n_groups (<parameter><link linkend="GdkDevicePad"><type>GdkDevicePad</type></link> *pad</parameter>);</programlisting>
<para>Returns the number of groups this pad device has. Pads have
at least one group. A pad group is a subcollection of
buttons/strip/rings that is affected collectively by a same
current mode.</para>
<refsect3 id="gdk-device-pad-get-n-groups.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>pad</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDevicePad"><type>GdkDevicePad</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-device-pad-get-n-groups.returns" role="returns">
<title>Returns</title>
<para> The number of button/ring/strip groups in the pad.</para>
</refsect3></refsect2>
<refsect2 id="gdk-device-pad-get-group-n-modes" role="function">
<title>gdk_device_pad_get_group_n_modes&#160;()</title>
<indexterm zone="gdk-device-pad-get-group-n-modes"><primary>gdk_device_pad_get_group_n_modes</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_device_pad_get_group_n_modes (<parameter><link linkend="GdkDevicePad"><type>GdkDevicePad</type></link> *pad</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> group_idx</parameter>);</programlisting>
<para>Returns the number of modes that <parameter>group</parameter>
 may have.</para>
<refsect3 id="gdk-device-pad-get-group-n-modes.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>pad</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDevicePad"><type>GdkDevicePad</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>group_idx</para></entry>
<entry role="parameter_description"><para>group to get the number of available modes from</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-device-pad-get-group-n-modes.returns" role="returns">
<title>Returns</title>
<para> The number of modes available in <parameter>group</parameter>
.</para>
</refsect3></refsect2>
<refsect2 id="gdk-device-pad-get-n-features" role="function">
<title>gdk_device_pad_get_n_features&#160;()</title>
<indexterm zone="gdk-device-pad-get-n-features"><primary>gdk_device_pad_get_n_features</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_device_pad_get_n_features (<parameter><link linkend="GdkDevicePad"><type>GdkDevicePad</type></link> *pad</parameter>,
                               <parameter><link linkend="GdkDevicePadFeature"><type>GdkDevicePadFeature</type></link> feature</parameter>);</programlisting>
<para>Returns the number of features a tablet pad has.</para>
<refsect3 id="gdk-device-pad-get-n-features.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>pad</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDevicePad"><type>GdkDevicePad</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>feature</para></entry>
<entry role="parameter_description"><para>a pad feature</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-device-pad-get-n-features.returns" role="returns">
<title>Returns</title>
<para> The amount of elements of type <parameter>feature</parameter>
that this pad has.</para>
</refsect3></refsect2>
<refsect2 id="gdk-device-pad-get-feature-group" role="function">
<title>gdk_device_pad_get_feature_group&#160;()</title>
<indexterm zone="gdk-device-pad-get-feature-group"><primary>gdk_device_pad_get_feature_group</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_device_pad_get_feature_group (<parameter><link linkend="GdkDevicePad"><type>GdkDevicePad</type></link> *pad</parameter>,
                                  <parameter><link linkend="GdkDevicePadFeature"><type>GdkDevicePadFeature</type></link> feature</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> feature_idx</parameter>);</programlisting>
<para>Returns the group the given <parameter>feature</parameter>
 and <parameter>idx</parameter>
 belong to,
or -1 if feature/index do not exist in <parameter>pad</parameter>
.</para>
<refsect3 id="gdk-device-pad-get-feature-group.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>pad</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkDevicePad"><type>GdkDevicePad</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>feature</para></entry>
<entry role="parameter_description"><para>the feature type to get the group from</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>feature_idx</para></entry>
<entry role="parameter_description"><para>the index of the feature to get the group from</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-device-pad-get-feature-group.returns" role="returns">
<title>Returns</title>
<para> The group number of the queried pad feature.</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GdkDevicePad.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkDevicePad-struct" role="struct">
<title>GdkDevicePad</title>
<indexterm zone="GdkDevicePad-struct"><primary>GdkDevicePad</primary></indexterm>
<programlisting language="C">typedef struct _GdkDevicePad GdkDevicePad;</programlisting>
<para>The GdkDevicePad struct contains only private fields and
should not be accessed directly.</para>
</refsect2>
<refsect2 id="GdkDevicePadFeature" role="enum">
<title>enum GdkDevicePadFeature</title>
<indexterm zone="GdkDevicePadFeature"><primary>GdkDevicePadFeature</primary></indexterm>
<para>A pad feature.</para>
<refsect3 id="GdkDevicePadFeature.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="GDK-DEVICE-PAD-FEATURE-BUTTON:CAPS">GDK_DEVICE_PAD_FEATURE_BUTTON</para></entry>
<entry role="enum_member_description"><para>a button</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-DEVICE-PAD-FEATURE-RING:CAPS">GDK_DEVICE_PAD_FEATURE_RING</para></entry>
<entry role="enum_member_description"><para>a ring-shaped interactive area</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GDK-DEVICE-PAD-FEATURE-STRIP:CAPS">GDK_DEVICE_PAD_FEATURE_STRIP</para></entry>
<entry role="enum_member_description"><para>a straight interactive area</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>

</refentry>
