1 /*
2 * This file is part of gtkD.
3 *
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 3
7 * of the License, or (at your option) any later version, with
8 * some exceptions, please read the COPYING file.
9 *
10 * gtkD is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with gtkD; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18 */19 20 // generated automatically - do not change21 // find conversion definition on APILookup.txt22 // implement new conversion functionalities on the wrap.utils pakage23 24 25 modulegdk.DevicePadT;
26 27 publicimportgdk.c.functions;
28 publicimportgdk.c.types;
29 30 31 /**
32 * `GdkDevicePad` is an interface implemented by devices of type
33 * %GDK_SOURCE_TABLET_PAD
34 *
35 * It allows querying the features provided by the pad device.
36 *
37 * Tablet pads may contain one or more groups, each containing a subset
38 * of the buttons/rings/strips available. [method@Gdk.DevicePad.get_n_groups]
39 * can be used to obtain the number of groups, [method@Gdk.DevicePad.get_n_features]
40 * and [method@Gdk.DevicePad.get_feature_group] can be combined to find out
41 * the number of buttons/rings/strips the device has, and how are they grouped.
42 *
43 * Each of those groups have different modes, which may be used to map each
44 * individual pad feature to multiple actions. Only one mode is effective
45 * (current) for each given group, different groups may have different
46 * current modes. The number of available modes in a group can be found
47 * out through [method@Gdk.DevicePad.get_group_n_modes], and the current mode
48 * for a given group will be notified through events of type #GDK_PAD_GROUP_MODE.
49 */50 publictemplateDevicePadT(TStruct)
51 {
52 /** Get the main Gtk struct */53 publicGdkDevicePad* getDevicePadStruct(booltransferOwnership = false)
54 {
55 if (transferOwnership)
56 ownedRef = false;
57 returncast(GdkDevicePad*)getStruct();
58 }
59 60 61 /**
62 * Returns the group the given @feature and @idx belong to.
63 *
64 * f the feature or index do not exist in @pad, -1 is returned.
65 *
66 * Params:
67 * feature = the feature type to get the group from
68 * featureIdx = the index of the feature to get the group from
69 *
70 * Returns: The group number of the queried pad feature.
71 */72 publicintgetFeatureGroup(GdkDevicePadFeaturefeature, intfeatureIdx)
73 {
74 returngdk_device_pad_get_feature_group(getDevicePadStruct(), feature, featureIdx);
75 }
76 77 /**
78 * Returns the number of modes that @group may have.
79 *
80 * Params:
81 * groupIdx = group to get the number of available modes from
82 *
83 * Returns: The number of modes available in @group.
84 */85 publicintgetGroupNModes(intgroupIdx)
86 {
87 returngdk_device_pad_get_group_n_modes(getDevicePadStruct(), groupIdx);
88 }
89 90 /**
91 * Returns the number of features a tablet pad has.
92 *
93 * Params:
94 * feature = a pad feature
95 *
96 * Returns: The amount of elements of type @feature that this pad has.
97 */98 publicintgetNFeatures(GdkDevicePadFeaturefeature)
99 {
100 returngdk_device_pad_get_n_features(getDevicePadStruct(), feature);
101 }
102 103 /**
104 * Returns the number of groups this pad device has.
105 *
106 * Pads have at least one group. A pad group is a subcollection of
107 * buttons/strip/rings that is affected collectively by a same
108 * current mode.
109 *
110 * Returns: The number of button/ring/strip groups in the pad.
111 */112 publicintgetNGroups()
113 {
114 returngdk_device_pad_get_n_groups(getDevicePadStruct());
115 }
116 }