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 gdk.c.functions; 28 public import gdk.c.types; 29 public import gtkc.gdktypes; 30 31 32 /** 33 * #GdkDevicePad is an interface implemented by devices of type 34 * %GDK_SOURCE_TABLET_PAD, it allows querying the features provided 35 * 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. gdk_device_pad_get_n_groups() 39 * can be used to obtain the number of groups, gdk_device_pad_get_n_features() 40 * and gdk_device_pad_get_feature_group() can be combined to find out the 41 * 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 44 * each individual pad feature to multiple actions. Only one mode is 45 * effective (current) for each given group, different groups may have 46 * different current modes. The number of available modes in a group can 47 * be found out through gdk_device_pad_get_group_n_modes(), and the current 48 * mode for a given group will be notified through the #GdkEventPadGroupMode 49 * event. 50 */ 51 public template DevicePadT(TStruct) 52 { 53 /** Get the main Gtk struct */ 54 public GdkDevicePad* getDevicePadStruct(bool transferOwnership = false) 55 { 56 if (transferOwnership) 57 ownedRef = false; 58 return cast(GdkDevicePad*)getStruct(); 59 } 60 61 62 /** 63 * Returns the group the given @feature and @idx belong to, 64 * or -1 if feature/index do not exist in @pad. 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 * Since: 3.22 73 */ 74 public int getFeatureGroup(GdkDevicePadFeature feature, int featureIdx) 75 { 76 return gdk_device_pad_get_feature_group(getDevicePadStruct(), feature, featureIdx); 77 } 78 79 /** 80 * Returns the number of modes that @group may have. 81 * 82 * Params: 83 * groupIdx = group to get the number of available modes from 84 * 85 * Returns: The number of modes available in @group. 86 * 87 * Since: 3.22 88 */ 89 public int getGroupNModes(int groupIdx) 90 { 91 return gdk_device_pad_get_group_n_modes(getDevicePadStruct(), groupIdx); 92 } 93 94 /** 95 * Returns the number of features a tablet pad has. 96 * 97 * Params: 98 * feature = a pad feature 99 * 100 * Returns: The amount of elements of type @feature that this pad has. 101 * 102 * Since: 3.22 103 */ 104 public int getNFeatures(GdkDevicePadFeature feature) 105 { 106 return gdk_device_pad_get_n_features(getDevicePadStruct(), feature); 107 } 108 109 /** 110 * Returns the number of groups this pad device has. Pads have 111 * at least one group. A pad group is a subcollection of 112 * buttons/strip/rings that is affected collectively by a same 113 * current mode. 114 * 115 * Returns: The number of button/ring/strip groups in the pad. 116 * 117 * Since: 3.22 118 */ 119 public int getNGroups() 120 { 121 return gdk_device_pad_get_n_groups(getDevicePadStruct()); 122 } 123 }