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.TouchpadEvent; 26 27 private import gdk.Event; 28 private import gdk.c.functions; 29 public import gdk.c.types; 30 31 32 /** 33 * An event related to a gesture on a touchpad device. 34 * 35 * Unlike touchscreens, where the windowing system sends basic 36 * sequences of begin, update, end events, and leaves gesture 37 * recognition to the clients, touchpad gestures are typically 38 * processed by the system, resulting in these events. 39 */ 40 public class TouchpadEvent : Event 41 { 42 /** the main Gtk struct */ 43 protected GdkTouchpadEvent* gdkTouchpadEvent; 44 45 /** Get the main Gtk struct */ 46 public GdkTouchpadEvent* getTouchpadEventStruct(bool transferOwnership = false) 47 { 48 if (transferOwnership) 49 ownedRef = false; 50 return gdkTouchpadEvent; 51 } 52 53 /** the main Gtk struct as a void* */ 54 protected override void* getStruct() 55 { 56 return cast(void*)gdkTouchpadEvent; 57 } 58 59 /** 60 * Sets our main struct and passes it to the parent class. 61 */ 62 public this (GdkTouchpadEvent* gdkTouchpadEvent, bool ownedRef = false) 63 { 64 this.gdkTouchpadEvent = gdkTouchpadEvent; 65 super(cast(GdkEvent*)gdkTouchpadEvent, ownedRef); 66 } 67 68 69 /** */ 70 public static GType getType() 71 { 72 return gdk_touchpad_event_get_type(); 73 } 74 75 /** 76 * Extracts delta information from a touchpad event. 77 * 78 * Params: 79 * dx = return location for x 80 * dy = return location for y 81 */ 82 public void getDeltas(out double dx, out double dy) 83 { 84 gdk_touchpad_event_get_deltas(cast(GdkEvent*)gdkTouchpadEvent, &dx, &dy); 85 } 86 87 /** 88 * Extracts the touchpad gesture phase from a touchpad event. 89 * 90 * Returns: the gesture phase of @event 91 */ 92 public GdkTouchpadGesturePhase getGesturePhase() 93 { 94 return gdk_touchpad_event_get_gesture_phase(cast(GdkEvent*)gdkTouchpadEvent); 95 } 96 97 /** 98 * Extracts the number of fingers from a touchpad event. 99 * 100 * Returns: the number of fingers for @event 101 */ 102 public uint getNFingers() 103 { 104 return gdk_touchpad_event_get_n_fingers(cast(GdkEvent*)gdkTouchpadEvent); 105 } 106 107 /** 108 * Extracts the angle delta from a touchpad pinch event. 109 * 110 * Returns: the angle delta of @event 111 */ 112 public double getPinchAngleDelta() 113 { 114 return gdk_touchpad_event_get_pinch_angle_delta(cast(GdkEvent*)gdkTouchpadEvent); 115 } 116 117 /** 118 * Extracts the scale from a touchpad pinch event. 119 * 120 * Returns: the scale of @event 121 */ 122 public double getPinchScale() 123 { 124 return gdk_touchpad_event_get_pinch_scale(cast(GdkEvent*)gdkTouchpadEvent); 125 } 126 }