zoomgesture: Port to new API model

This commit is contained in:
Benjamin Otte 2018-03-08 23:40:45 +01:00 committed by Carlos Garnacho
parent 703d5340f1
commit 91efa37fcb
3 changed files with 4 additions and 8 deletions

View File

@ -196,12 +196,12 @@ do_gestures (GtkWidget *do_widget)
gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (gesture));
/* Zoom */
zoom = gesture = gtk_gesture_zoom_new (drawing_area);
zoom = gesture = gtk_gesture_zoom_new ();
g_signal_connect (gesture, "scale-changed",
G_CALLBACK (zoom_scale_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));
}
if (!gtk_widget_get_visible (window))

View File

@ -218,7 +218,6 @@ gtk_gesture_zoom_class_init (GtkGestureZoomClass *klass)
/**
* gtk_gesture_zoom_new:
* @widget: a #GtkWidget
*
* Returns a newly created #GtkGesture that recognizes zoom
* in/out gestures (usually known as pinch/zoom).
@ -226,12 +225,9 @@ gtk_gesture_zoom_class_init (GtkGestureZoomClass *klass)
* Returns: a newly created #GtkGestureZoom
**/
GtkGesture *
gtk_gesture_zoom_new (GtkWidget *widget)
gtk_gesture_zoom_new (void)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
return g_object_new (GTK_TYPE_GESTURE_ZOOM,
"widget", widget,
NULL);
}

View File

@ -43,7 +43,7 @@ GDK_AVAILABLE_IN_ALL
GType gtk_gesture_zoom_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkGesture * gtk_gesture_zoom_new (GtkWidget *widget);
GtkGesture * gtk_gesture_zoom_new (void);
GDK_AVAILABLE_IN_ALL
gdouble gtk_gesture_zoom_get_scale_delta (GtkGestureZoom *gesture);