| 1 | /* GTK - The GIMP Toolkit |
| 2 | * Copyright (C) 2012, One Laptop Per Child. |
| 3 | * Copyright (C) 2014, Red Hat, Inc. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library 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 GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 17 | * |
| 18 | * Author(s): Carlos Garnacho <[email protected]> |
| 19 | */ |
| 20 | |
| 21 | /** |
| 22 | * GtkGestureSwipe: |
| 23 | * |
| 24 | * Recognizes swipe gestures. |
| 25 | * |
| 26 | * After a press/move/.../move/release sequence happens, the |
| 27 | * [[email protected]::swipe] signal will be emitted, |
| 28 | * providing the velocity and directionality of the sequence |
| 29 | * at the time it was lifted. |
| 30 | * |
| 31 | * If the velocity is desired in intermediate points, |
| 32 | * [[email protected]_velocity] can be called in a |
| 33 | * [[email protected]::update] handler. |
| 34 | * |
| 35 | * All velocities are reported in pixels/sec units. |
| 36 | */ |
| 37 | |
| 38 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 39 | #include "gtkgestureswipe.h"cxx . . $ `<file>/gtk/gtkgestureswipe.h`/ |
| 40 | #include "gtkgestureswipeprivate.h"cxx . . $ `<file>/gtk/gtkgestureswipeprivate.h`/ |
| 41 | #include "gtkgestureprivate.h"cxx . . $ `<file>/gtk/gtkgestureprivate.h`/ |
| 42 | #include "gtkmarshalers.h"cxx . . $ `<file>/build/gtk/gtkmarshalers.h`/ |
| 43 | #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/ |
| 44 | |
| 45 | #define CAPTURE_THRESHOLD_MScxx . . $ `gtk/gtkgestureswipe.c:45:9`! 150 |
| 46 | |
| 47 | typedef struct _GtkGestureSwipePrivatecxx . . $ _GtkGestureSwipePrivate# GtkGestureSwipePrivatecxx . . $ GtkGestureSwipePrivate#; |
| 48 | typedef struct _EventDatacxx . . $ _EventData# EventDatacxx . . $ EventData#; |
| 49 | |
| 50 | struct _EventDatacxx . . $ _EventData# |
| 51 | { |
| 52 | guint32cxx . . $ guint32# evtimecxx . . $ _EventData#evtime.; |
| 53 | int xcxx . . $ _EventData#x.; |
| 54 | int ycxx . . $ _EventData#y.; |
| 55 | }; |
| 56 | |
| 57 | struct _GtkGestureSwipePrivatecxx . . $ _GtkGestureSwipePrivate# |
| 58 | { |
| 59 | GArraycxx . . $ GArray# *eventscxx . . $ _GtkGestureSwipePrivate#events.; |
| 60 | }; |
| 61 | |
| 62 | enumcxx . . $ $anonymous_type_f599590c1c503f05_0# { |
| 63 | SWIPEcxx . . $ SWIPE., |
| 64 | N_SIGNALScxx . . $ N_SIGNALS. |
| 65 | }; |
| 66 | |
| 67 | static guintcxx . . $ guint# signalscxx . . $ signals.[N_SIGNALScxx . . $ N_SIGNALS.] = { 0 }; |
| 68 | |
| 69 | G_DEFINE_TYPE_WITH_PRIVATEcxx . . $ `<external>/9567554376676449156/gtype.h:1876:9`! (GtkGestureSwipe, gtk_gesture_swipe, GTK_TYPE_GESTURE_SINGLEcxx . . $ `gtk/gtkgesturesingle.h:31:9`!) |
| 70 | |
| 71 | static void |
| 72 | gtk_gesture_swipe_finalizecxx . . $ gtk_gesture_swipe_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 73 | { |
| 74 | GtkGestureSwipePrivatecxx . . $ GtkGestureSwipePrivate# *priv; |
| 75 | |
| 76 | priv = gtk_gesture_swipe_get_instance_privatecxx . . $ gtk_gesture_swipe_get_instance_private(792fb018c98f6e16). (GTK_GESTURE_SWIPEcxx . . $ `gtk/gtkgestureswipe.h:32:9`! (object)); |
| 77 | g_array_freecxx . . $ g_array_free(59928813d5e6bdfc). (priv->eventscxx . . $ _GtkGestureSwipePrivate#events., TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 78 | |
| 79 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gtk_gesture_swipe_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 80 | } |
| 81 | |
| 82 | static gbooleancxx . . $ gboolean# |
| 83 | gtk_gesture_swipe_filter_eventcxx . . $ gtk_gesture_swipe_filter_event(7ad650e377e57494). (GtkEventControllercxx . . $ GtkEventController# *controller, |
| 84 | GdkEventcxx . . $ GdkEvent# *event) |
| 85 | { |
| 86 | /* Let touchpad swipe and hold events go through, only if they match n-points */ |
| 87 | if (gdk_event_get_event_typecxx . . $ gdk_event_get_event_type(af0289f7121992bc). (event) == GDK_TOUCHPAD_SWIPEcxx . . $ GDK_TOUCHPAD_SWIPE. || |
| 88 | gdk_event_get_event_typecxx . . $ gdk_event_get_event_type(af0289f7121992bc). (event) == GDK_TOUCHPAD_HOLDcxx . . $ GDK_TOUCHPAD_HOLD.) |
| 89 | { |
| 90 | guintcxx . . $ guint# n_points; |
| 91 | guintcxx . . $ guint# n_fingers; |
| 92 | |
| 93 | g_object_getcxx . . $ g_object_get(1ac911bdc4e9a14d). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (controller), "n-points", &n_points, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 94 | |
| 95 | n_fingers = gdk_touchpad_event_get_n_fingerscxx . . $ gdk_touchpad_event_get_n_fingers(2d406c81f4428913). (event); |
| 96 | |
| 97 | if (n_fingers == n_points) |
| 98 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 99 | else |
| 100 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 101 | } |
| 102 | |
| 103 | return GTK_EVENT_CONTROLLER_CLASScxx . . $ `gtk/gtkeventcontroller.h:36:9`! (gtk_gesture_swipe_parent_class)->filter_eventcxx . . $ _GtkEventControllerClass#filter_event. (controller, event); |
| 104 | } |
| 105 | |
| 106 | static void |
| 107 | _gtk_gesture_swipe_clear_backlogcxx . . $ _gtk_gesture_swipe_clear_backlog(da7b403b4d737c2d). (GtkGestureSwipecxx . . $ GtkGestureSwipe# *gesture, |
| 108 | guint32cxx . . $ guint32# evtime) |
| 109 | { |
| 110 | GtkGestureSwipePrivatecxx . . $ GtkGestureSwipePrivate# *priv; |
| 111 | int i, length = 0; |
| 112 | |
| 113 | priv = gtk_gesture_swipe_get_instance_privatecxx . . $ gtk_gesture_swipe_get_instance_private(792fb018c98f6e16). (gesture); |
| 114 | |
| 115 | for (i = 0; i < (int) priv->eventscxx . . $ _GtkGestureSwipePrivate#events.->lencxx . . $ _GArray#len.; i++) |
| 116 | { |
| 117 | EventDatacxx . . $ EventData# *data; |
| 118 | |
| 119 | data = &g_array_indexcxx . . $ `<external>/13165152102340786875/garray.h:69:9`! (priv->events, EventData, i); |
| 120 | |
| 121 | if (data->evtimecxx . . $ _EventData#evtime. >= evtime - CAPTURE_THRESHOLD_MScxx . . $ `gtk/gtkgestureswipe.c:45:9`!) |
| 122 | { |
| 123 | length = i - 1; |
| 124 | break; |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | if (length > 0) |
| 129 | g_array_remove_rangecxx . . $ g_array_remove_range(fb8faca21ceffb0b). (priv->eventscxx . . $ _GtkGestureSwipePrivate#events., 0, length); |
| 130 | } |
| 131 | |
| 132 | static void |
| 133 | gtk_gesture_swipe_append_eventcxx . . $ gtk_gesture_swipe_append_event(33094a89a87a742c). (GtkGestureSwipecxx . . $ GtkGestureSwipe# *swipe, |
| 134 | GdkEventSequencecxx . . $ GdkEventSequence# *sequence) |
| 135 | { |
| 136 | GtkGestureSwipePrivatecxx . . $ GtkGestureSwipePrivate# *priv; |
| 137 | EventDatacxx . . $ EventData# new; |
| 138 | double x, y; |
| 139 | |
| 140 | priv = gtk_gesture_swipe_get_instance_privatecxx . . $ gtk_gesture_swipe_get_instance_private(792fb018c98f6e16). (swipe); |
| 141 | _gtk_gesture_get_last_update_timecxx . . $ _gtk_gesture_get_last_update_time(b22408fed21b103a). (GTK_GESTUREcxx . . $ `gtk/gtkgesture.h:32:9`! (swipe), sequence, &new.evtimecxx . . $ _EventData#evtime.); |
| 142 | gtk_gesture_get_pointcxx . . $ gtk_gesture_get_point(c2c448b15d15778f). (GTK_GESTUREcxx . . $ `gtk/gtkgesture.h:32:9`! (swipe), sequence, &x, &y); |
| 143 | |
| 144 | new.xcxx . . $ _EventData#x. = x; |
| 145 | new.ycxx . . $ _EventData#y. = y; |
| 146 | |
| 147 | _gtk_gesture_swipe_clear_backlogcxx . . $ _gtk_gesture_swipe_clear_backlog(da7b403b4d737c2d). (swipe, new.evtimecxx . . $ _EventData#evtime.); |
| 148 | g_array_append_valcxx . . $ `<external>/13165152102340786875/garray.h:66:9`! (priv->events, new); |
| 149 | } |
| 150 | |
| 151 | static void |
| 152 | gtk_gesture_swipe_updatecxx . . $ gtk_gesture_swipe_update(4613efcc89ef386). (GtkGesturecxx . . $ GtkGesture# *gesture, |
| 153 | GdkEventSequencecxx . . $ GdkEventSequence# *sequence) |
| 154 | { |
| 155 | GtkGestureSwipecxx . . $ GtkGestureSwipe# *swipe = GTK_GESTURE_SWIPEcxx . . $ `gtk/gtkgestureswipe.h:32:9`! (gesture); |
| 156 | |
| 157 | gtk_gesture_swipe_append_eventcxx . . $ gtk_gesture_swipe_append_event(33094a89a87a742c). (swipe, sequence); |
| 158 | } |
| 159 | |
| 160 | static void |
| 161 | _gtk_gesture_swipe_calculate_velocitycxx . . $ _gtk_gesture_swipe_calculate_velocity(48fd149ae09e6d13). (GtkGestureSwipecxx . . $ GtkGestureSwipe# *gesture, |
| 162 | double *velocity_x, |
| 163 | double *velocity_y) |
| 164 | { |
| 165 | GtkGestureSwipePrivatecxx . . $ GtkGestureSwipePrivate# *priv; |
| 166 | GdkEventSequencecxx . . $ GdkEventSequence# *sequence; |
| 167 | guint32cxx . . $ guint32# evtime, diff_time; |
| 168 | EventDatacxx . . $ EventData# *start, *end; |
| 169 | double diff_x, diff_y; |
| 170 | |
| 171 | priv = gtk_gesture_swipe_get_instance_privatecxx . . $ gtk_gesture_swipe_get_instance_private(792fb018c98f6e16). (gesture); |
| 172 | *velocity_x = *velocity_y = 0; |
| 173 | |
| 174 | sequence = gtk_gesture_single_get_current_sequencecxx . . $ gtk_gesture_single_get_current_sequence(eacc6d2458a1513d). (GTK_GESTURE_SINGLEcxx . . $ `gtk/gtkgesturesingle.h:32:9`! (gesture)); |
| 175 | _gtk_gesture_get_last_update_timecxx . . $ _gtk_gesture_get_last_update_time(b22408fed21b103a). (GTK_GESTUREcxx . . $ `gtk/gtkgesture.h:32:9`! (gesture), sequence, &evtime); |
| 176 | _gtk_gesture_swipe_clear_backlogcxx . . $ _gtk_gesture_swipe_clear_backlog(da7b403b4d737c2d). (gesture, evtime); |
| 177 | |
| 178 | if (priv->eventscxx . . $ _GtkGestureSwipePrivate#events.->lencxx . . $ _GArray#len. == 0) |
| 179 | return; |
| 180 | |
| 181 | start = &g_array_indexcxx . . $ `<external>/13165152102340786875/garray.h:69:9`! (priv->events, EventData, 0); |
| 182 | end = &g_array_indexcxx . . $ `<external>/13165152102340786875/garray.h:69:9`! (priv->events, EventData, priv->events->len - 1); |
| 183 | |
| 184 | diff_time = end->evtimecxx . . $ _EventData#evtime. - start->evtimecxx . . $ _EventData#evtime.; |
| 185 | diff_x = end->xcxx . . $ _EventData#x. - start->xcxx . . $ _EventData#x.; |
| 186 | diff_y = end->ycxx . . $ _EventData#y. - start->ycxx . . $ _EventData#y.; |
| 187 | |
| 188 | if (diff_time == 0) |
| 189 | return; |
| 190 | |
| 191 | /* Velocity in pixels/sec */ |
| 192 | *velocity_x = diff_x * 1000 / diff_time; |
| 193 | *velocity_y = diff_y * 1000 / diff_time; |
| 194 | } |
| 195 | |
| 196 | static void |
| 197 | gtk_gesture_swipe_endcxx . . $ gtk_gesture_swipe_end(4613efcc89ef386). (GtkGesturecxx . . $ GtkGesture# *gesture, |
| 198 | GdkEventSequencecxx . . $ GdkEventSequence# *sequence) |
| 199 | { |
| 200 | GtkGestureSwipecxx . . $ GtkGestureSwipe# *swipe = GTK_GESTURE_SWIPEcxx . . $ `gtk/gtkgestureswipe.h:32:9`! (gesture); |
| 201 | GtkGestureSwipePrivatecxx . . $ GtkGestureSwipePrivate# *priv; |
| 202 | double velocity_x, velocity_y; |
| 203 | GdkEventSequencecxx . . $ GdkEventSequence# *seq; |
| 204 | |
| 205 | seq = gtk_gesture_single_get_current_sequencecxx . . $ gtk_gesture_single_get_current_sequence(eacc6d2458a1513d). (GTK_GESTURE_SINGLEcxx . . $ `gtk/gtkgesturesingle.h:32:9`! (gesture)); |
| 206 | |
| 207 | if (gtk_gesture_get_sequence_statecxx . . $ gtk_gesture_get_sequence_state(7ed3205cdc9bf84c). (gesture, seq) == GTK_EVENT_SEQUENCE_DENIEDcxx . . $ GTK_EVENT_SEQUENCE_DENIED.) |
| 208 | return; |
| 209 | |
| 210 | if (gtk_gesture_is_activecxx . . $ gtk_gesture_is_active(7d3530d02874564). (gesture)) |
| 211 | return; |
| 212 | |
| 213 | gtk_gesture_swipe_append_eventcxx . . $ gtk_gesture_swipe_append_event(33094a89a87a742c). (swipe, sequence); |
| 214 | |
| 215 | priv = gtk_gesture_swipe_get_instance_privatecxx . . $ gtk_gesture_swipe_get_instance_private(792fb018c98f6e16). (swipe); |
| 216 | _gtk_gesture_swipe_calculate_velocitycxx . . $ _gtk_gesture_swipe_calculate_velocity(48fd149ae09e6d13). (swipe, &velocity_x, &velocity_y); |
| 217 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (gesture, signalscxx . . $ signals.[SWIPEcxx . . $ SWIPE.], 0, velocity_x, velocity_y); |
| 218 | |
| 219 | if (priv->eventscxx . . $ _GtkGestureSwipePrivate#events.->lencxx . . $ _GArray#len. > 0) |
| 220 | g_array_remove_rangecxx . . $ g_array_remove_range(fb8faca21ceffb0b). (priv->eventscxx . . $ _GtkGestureSwipePrivate#events., 0, priv->eventscxx . . $ _GtkGestureSwipePrivate#events.->lencxx . . $ _GArray#len.); |
| 221 | } |
| 222 | |
| 223 | static void |
| 224 | gtk_gesture_swipe_class_initcxx . . $ gtk_gesture_swipe_class_init(f3227748f0a1eb9d). (GtkGestureSwipeClasscxx . . $ GtkGestureSwipeClass# *klass) |
| 225 | { |
| 226 | GtkGestureClasscxx . . $ GtkGestureClass# *gesture_class = GTK_GESTURE_CLASScxx . . $ `gtk/gtkgesture.h:33:9`! (klass); |
| 227 | GtkEventControllerClasscxx . . $ GtkEventControllerClass# *event_controller_class = GTK_EVENT_CONTROLLER_CLASScxx . . $ `gtk/gtkeventcontroller.h:36:9`! (klass); |
| 228 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 229 | |
| 230 | object_class->finalizecxx . . $ _GObjectClass#finalize. = gtk_gesture_swipe_finalizecxx . . $ gtk_gesture_swipe_finalize(6087475fa43034d3).; |
| 231 | |
| 232 | event_controller_class->filter_eventcxx . . $ _GtkEventControllerClass#filter_event. = gtk_gesture_swipe_filter_eventcxx . . $ gtk_gesture_swipe_filter_event(7ad650e377e57494).; |
| 233 | |
| 234 | gesture_class->updatecxx . . $ _GtkGestureClass#update. = gtk_gesture_swipe_updatecxx . . $ gtk_gesture_swipe_update(4613efcc89ef386).; |
| 235 | gesture_class->endcxx . . $ _GtkGestureClass#end. = gtk_gesture_swipe_endcxx . . $ gtk_gesture_swipe_end(4613efcc89ef386).; |
| 236 | |
| 237 | /** |
| 238 | * GtkGestureSwipe::swipe: |
| 239 | * @gesture: object which received the signal |
| 240 | * @velocity_x: velocity in the X axis, in pixels/sec |
| 241 | * @velocity_y: velocity in the Y axis, in pixels/sec |
| 242 | * |
| 243 | * Emitted when the recognized gesture is finished. |
| 244 | * |
| 245 | * Velocity and direction are a product of previously recorded events. |
| 246 | */ |
| 247 | signalscxx . . $ signals.[SWIPEcxx . . $ SWIPE.] = |
| 248 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (I_cxx . . $ `gdk/gdkprivate.h:35:9`!("swipe"), |
| 249 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (klass), |
| 250 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 251 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GtkGestureSwipeClass, swipe), |
| 252 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 253 | _gtk_marshal_VOID__DOUBLE_DOUBLEcxx . . $ _gtk_marshal_VOID__DOUBLE_DOUBLE(cba270afb0f82555)., |
| 254 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 2, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!, G_TYPE_DOUBLEcxx . . $ `<external>/9567554376676449156/gtype.h:159:9`!); |
| 255 | g_signal_set_va_marshallercxx . . $ g_signal_set_va_marshaller(4fd870c04a9d6fe7). (signalscxx . . $ signals.[SWIPEcxx . . $ SWIPE.], |
| 256 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (klass), |
| 257 | _gtk_marshal_VOID__DOUBLE_DOUBLEvcxx . . $ _gtk_marshal_VOID__DOUBLE_DOUBLEv(d309f4be92d1737c).); |
| 258 | } |
| 259 | |
| 260 | static void |
| 261 | gtk_gesture_swipe_initcxx . . $ gtk_gesture_swipe_init(b0cef03ed28f9aff). (GtkGestureSwipecxx . . $ GtkGestureSwipe# *gesture) |
| 262 | { |
| 263 | GtkGestureSwipePrivatecxx . . $ GtkGestureSwipePrivate# *priv; |
| 264 | |
| 265 | priv = gtk_gesture_swipe_get_instance_privatecxx . . $ gtk_gesture_swipe_get_instance_private(792fb018c98f6e16). (gesture); |
| 266 | priv->eventscxx . . $ _GtkGestureSwipePrivate#events. = g_array_newcxx . . $ g_array_new(fe898421933afc00). (FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, sizeof (EventDatacxx . . $ EventData#)); |
| 267 | } |
| 268 | |
| 269 | /** |
| 270 | * gtk_gesture_swipe_new: |
| 271 | * |
| 272 | * Returns a newly created `GtkGesture` that recognizes swipes. |
| 273 | * |
| 274 | * Returns: a newly created `GtkGestureSwipe` |
| 275 | */ |
| 276 | GtkGesturecxx . . $ GtkGesture# * |
| 277 | gtk_gesture_swipe_newcxx . . $ gtk_gesture_swipe_new(5d22ad75f7119eec). (void) |
| 278 | { |
| 279 | return g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GTK_TYPE_GESTURE_SWIPEcxx . . $ `gtk/gtkgestureswipe.h:31:9`!, |
| 280 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * gtk_gesture_swipe_get_velocity: |
| 285 | * @gesture: a `GtkGestureSwipe` |
| 286 | * @velocity_x: (out): return value for the velocity in the X axis, in pixels/sec |
| 287 | * @velocity_y: (out): return value for the velocity in the Y axis, in pixels/sec |
| 288 | * |
| 289 | * Gets the current velocity. |
| 290 | * |
| 291 | * If the gesture is recognized, this function returns %TRUE and fills |
| 292 | * in @velocity_x and @velocity_y with the recorded velocity, as per the |
| 293 | * last events processed. |
| 294 | * |
| 295 | * Returns: whether velocity could be calculated |
| 296 | */ |
| 297 | gbooleancxx . . $ gboolean# |
| 298 | gtk_gesture_swipe_get_velocitycxx . . $ gtk_gesture_swipe_get_velocity(d1a10aea1023c8d2). (GtkGestureSwipecxx . . $ GtkGestureSwipe# *gesture, |
| 299 | double *velocity_x, |
| 300 | double *velocity_y) |
| 301 | { |
| 302 | double vel_x, vel_y; |
| 303 | |
| 304 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GTK_IS_GESTUREcxx . . $ `gtk/gtkgesture.h:34:9`! (gesture), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 305 | |
| 306 | if (!gtk_gesture_is_recognizedcxx . . $ gtk_gesture_is_recognized(7d3530d02874564). (GTK_GESTUREcxx . . $ `gtk/gtkgesture.h:32:9`! (gesture))) |
| 307 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 308 | |
| 309 | _gtk_gesture_swipe_calculate_velocitycxx . . $ _gtk_gesture_swipe_calculate_velocity(48fd149ae09e6d13). (gesture, &vel_x, &vel_y); |
| 310 | |
| 311 | if (velocity_x) |
| 312 | *velocity_x = vel_x; |
| 313 | if (velocity_y) |
| 314 | *velocity_y = vel_y; |
| 315 | |
| 316 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 317 | } |