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 change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gdk.DevicePadT; 26 27 public import gtkc.gdk; 28 public import gtkc.gdktypes; 29 30 31 /** 32 * #GdkDevicePad is an interface implemented by devices of type 33 * %GDK_SOURCE_TABLET_PAD, it allows querying the features provided 34 * by the pad device. 35 * 36 * Tablet pads may contain one or more groups, each containing a subset 37 * of the buttons/rings/strips available. gdk_device_pad_get_n_groups() 38 * can be used to obtain the number of groups, gdk_device_pad_get_n_features() 39 * and gdk_device_pad_get_feature_group() can be combined to find out the 40 * number of buttons/rings/strips the device has, and how are they grouped. 41 * 42 * Each of those groups have different modes, which may be used to map 43 * each individual pad feature to multiple actions. Only one mode is 44 * effective (current) for each given group, different groups may have 45 * different current modes. The number of available modes in a group can 46 * be found out through gdk_device_pad_get_group_n_modes(), and the current 47 * mode for a given group will be notified through the #GdkEventPadGroupMode 48 * event. 49 */ 50 public template DevicePadT(TStruct) 51 { 52 /** Get the main Gtk struct */ 53 public GdkDevicePad* getDevicePadStruct() 54 { 55 return cast(GdkDevicePad*)getStruct(); 56 } 57 58 59 /** 60 * Returns the group the given @feature and @idx belong to, 61 * or -1 if feature/index do not exist in @pad. 62 * 63 * Params: 64 * feature = the feature type to get the group from 65 * featureIdx = the index of the feature to get the group from 66 * 67 * Returns: The group number of the queried pad feature. 68 * 69 * Since: 3.22 70 */ 71 public int getFeatureGroup(GdkDevicePadFeature feature, int featureIdx) 72 { 73 return gdk_device_pad_get_feature_group(getDevicePadStruct(), feature, featureIdx); 74 } 75 76 /** 77 * Returns the number of modes that @group may have. 78 * 79 * Params: 80 * groupIdx = group to get the number of available modes from 81 * 82 * Returns: The number of modes available in @group. 83 * 84 * Since: 3.22 85 */ 86 public int getGroupNModes(int groupIdx) 87 { 88 return gdk_device_pad_get_group_n_modes(getDevicePadStruct(), groupIdx); 89 } 90 91 /** 92 * Returns the number of features a tablet pad has. 93 * 94 * Params: 95 * feature = a pad feature 96 * 97 * Returns: The amount of elements of type @feature that this pad has. 98 * 99 * Since: 3.22 100 */ 101 public int getNFeatures(GdkDevicePadFeature feature) 102 { 103 return gdk_device_pad_get_n_features(getDevicePadStruct(), feature); 104 } 105 106 /** 107 * Returns the number of groups this pad device has. Pads have 108 * at least one group. A pad group is a subcollection of 109 * buttons/strip/rings that is affected collectively by a same 110 * current mode. 111 * 112 * Returns: The number of button/ring/strip groups in the pad. 113 * 114 * Since: 3.22 115 */ 116 public int getNGroups() 117 { 118 return gdk_device_pad_get_n_groups(getDevicePadStruct()); 119 } 120 }