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(bool transferOwnership = false) 54 { 55 if (transferOwnership) 56 ownedRef = false; 57 return cast(GdkDevicePad*)getStruct(); 58 } 59 60 61 /** 62 * Returns the group the given @feature and @idx belong to, 63 * or -1 if feature/index do not exist in @pad. 64 * 65 * Params: 66 * feature = the feature type to get the group from 67 * featureIdx = the index of the feature to get the group from 68 * 69 * Returns: The group number of the queried pad feature. 70 * 71 * Since: 3.22 72 */ 73 public int getFeatureGroup(GdkDevicePadFeature feature, int featureIdx) 74 { 75 return gdk_device_pad_get_feature_group(getDevicePadStruct(), feature, featureIdx); 76 } 77 78 /** 79 * Returns the number of modes that @group may have. 80 * 81 * Params: 82 * groupIdx = group to get the number of available modes from 83 * 84 * Returns: The number of modes available in @group. 85 * 86 * Since: 3.22 87 */ 88 public int getGroupNModes(int groupIdx) 89 { 90 return gdk_device_pad_get_group_n_modes(getDevicePadStruct(), groupIdx); 91 } 92 93 /** 94 * Returns the number of features a tablet pad has. 95 * 96 * Params: 97 * feature = a pad feature 98 * 99 * Returns: The amount of elements of type @feature that this pad has. 100 * 101 * Since: 3.22 102 */ 103 public int getNFeatures(GdkDevicePadFeature feature) 104 { 105 return gdk_device_pad_get_n_features(getDevicePadStruct(), feature); 106 } 107 108 /** 109 * Returns the number of groups this pad device has. Pads have 110 * at least one group. A pad group is a subcollection of 111 * buttons/strip/rings that is affected collectively by a same 112 * current mode. 113 * 114 * Returns: The number of button/ring/strip groups in the pad. 115 * 116 * Since: 3.22 117 */ 118 public int getNGroups() 119 { 120 return gdk_device_pad_get_n_groups(getDevicePadStruct()); 121 } 122 }