Commit 703d5340 authored by Benjamin Otte's avatar Benjamin Otte Committed by Carlos Garnacho
Browse files

rotategesture: Port to new API model

parent 6fb92a0a
......@@ -188,12 +188,12 @@ do_gestures (GtkWidget *do_widget)
g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture);
/* Rotate */
rotate = gesture = gtk_gesture_rotate_new (drawing_area);
rotate = gesture = gtk_gesture_rotate_new ();
g_signal_connect (gesture, "angle-changed",
G_CALLBACK (rotation_angle_changed), drawing_area);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE);
g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture);
gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture));
/* Zoom */
zoom = gesture = gtk_gesture_zoom_new (drawing_area);
......
......@@ -248,7 +248,6 @@ gtk_gesture_rotate_class_init (GtkGestureRotateClass *klass)
/**
* gtk_gesture_rotate_new:
* @widget: a #GtkWidget
*
* Returns a newly created #GtkGesture that recognizes 2-touch
* rotation gestures.
......@@ -256,12 +255,9 @@ gtk_gesture_rotate_class_init (GtkGestureRotateClass *klass)
* Returns: a newly created #GtkGestureRotate
**/
GtkGesture *
gtk_gesture_rotate_new (GtkWidget *widget)
gtk_gesture_rotate_new (void)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
return g_object_new (GTK_TYPE_GESTURE_ROTATE,
"widget", widget,
NULL);
}
......
......@@ -43,7 +43,7 @@ GDK_AVAILABLE_IN_ALL
GType gtk_gesture_rotate_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkGesture * gtk_gesture_rotate_new (GtkWidget *widget);
GtkGesture * gtk_gesture_rotate_new (void);
GDK_AVAILABLE_IN_ALL
gdouble gtk_gesture_rotate_get_angle_delta (GtkGestureRotate *gesture);
......
......@@ -356,8 +356,9 @@ add_mt_gesture (GtkWidget *w, const gchar *name, GtkPropagationPhase phase, GStr
data->str = str;
data->state = state;
g = gtk_gesture_rotate_new (w);
g = gtk_gesture_rotate_new ();
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (g), phase);
gtk_widget_add_controller (w, GTK_EVENT_CONTROLLER (g));
g_object_set_data (G_OBJECT (g), "name", (gpointer)name);
......
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