Commit 6433a545 authored by Carlos Garnacho's avatar Carlos Garnacho

gesture: Add gtk_gesture_set_state() helper.

This function sets the state on all sequences where it actually
can, just a helper function to avoid iterating over sequences
yourself.
parent 72f8c673
......@@ -672,6 +672,28 @@ gtk_gesture_set_sequence_state (GtkGesture *gesture,
return TRUE;
}
gboolean
gtk_gesture_set_state (GtkGesture *gesture,
GtkEventSequenceState state)
{
GdkEventSequence *sequence;
gboolean handled = FALSE;
GtkGesturePrivate *priv;
GHashTableIter iter;
g_return_val_if_fail (GTK_IS_GESTURE (gesture), FALSE);
g_return_val_if_fail (state >= GTK_EVENT_SEQUENCE_NONE &&
state <= GTK_EVENT_SEQUENCE_DENIED, FALSE);
priv = gtk_gesture_get_instance_private (gesture);
g_hash_table_iter_init (&iter, priv->points);
while (g_hash_table_iter_next (&iter, (gpointer*) &sequence, NULL))
handled |= gtk_gesture_set_sequence_state (gesture, sequence, state);
return handled;
}
/**
* gtk_gesture_get_sequences:
* @gesture: a #GtkGesture
......
......@@ -74,6 +74,9 @@ GType gtk_gesture_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_14
GdkDevice * gtk_gesture_get_device (GtkGesture *gesture);
GDK_AVAILABLE_IN_3_14
gboolean gtk_gesture_set_state (GtkGesture *gesture,
GtkEventSequenceState state);
GDK_AVAILABLE_IN_3_14
GtkEventSequenceState
gtk_gesture_get_sequence_state (GtkGesture *gesture,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment