diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-05-29 17:10:46 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-05-29 17:10:46 +0000 |
commit | 7f65e5f96b545fe071b37256eb61770a7ee2f085 (patch) | |
tree | 1efed96fd471162df7d838b781ca79f018aabbe7 /gtk | |
parent | 5675d585f40adc407f7f0f56289654dc785b4610 (diff) | |
download | gtk+-7f65e5f96b545fe071b37256eb61770a7ee2f085.tar.gz |
Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
Diffstat (limited to 'gtk')
48 files changed, 592 insertions, 596 deletions
diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h index edd4664b40..2e11f477d4 100644 --- a/gtk/gtk-autocleanups.h +++ b/gtk/gtk-autocleanups.h @@ -85,7 +85,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGLArea, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGesture, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureDrag, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureLongPress, g_object_unref) -G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureMultiPress, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureClick, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGesturePan, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureRotate, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureSingle, g_object_unref) @@ -119,9 +119,9 @@ #include <gtk/gtkfontchooserwidget.h> #include <gtk/gtkframe.h> #include <gtk/gtkgesture.h> +#include <gtk/gtkgestureclick.h> #include <gtk/gtkgesturedrag.h> #include <gtk/gtkgesturelongpress.h> -#include <gtk/gtkgesturemultipress.h> #include <gtk/gtkgesturepan.h> #include <gtk/gtkgesturerotate.h> #include <gtk/gtkgesturesingle.h> diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 29370a3fb9..4b38d343f4 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -60,7 +60,7 @@ #include "gtkdialogprivate.h" #include "gtkeventcontrollermotion.h" #include "gtkeventcontrollerkey.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" /** @@ -260,7 +260,7 @@ static gboolean text_view_key_pressed (GtkEventController guint keycode, GdkModifierType state, GtkAboutDialog *about); -static void text_view_released (GtkGestureMultiPress *press, +static void text_view_released (GtkGestureClick *press, int n, double x, double y, @@ -1938,7 +1938,7 @@ text_view_key_pressed (GtkEventController *controller, } static void -text_view_released (GtkGestureMultiPress *gesture, +text_view_released (GtkGestureClick *gesture, int n_press, double x, double y, diff --git a/gtk/gtkappchooserwidget.c b/gtk/gtkappchooserwidget.c index 16815ed1db..1fc75e7f1f 100644 --- a/gtk/gtkappchooserwidget.c +++ b/gtk/gtkappchooserwidget.c @@ -37,7 +37,7 @@ #include "gtkorientable.h" #include "gtkscrolledwindow.h" #include "gtklabel.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include <string.h> #include <glib/gi18n-lib.h> @@ -1213,7 +1213,7 @@ gtk_app_chooser_widget_init (GtkAppChooserWidget *self) g_signal_connect (priv->monitor, "changed", G_CALLBACK (app_info_changed), self); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY); g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_app_chooser_row_pressed_cb), self); diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 402ebdfa28..3b701d9959 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -58,7 +58,7 @@ #include "gtkactionhelperprivate.h" #include "gtkcheckbutton.h" #include "gtkcontainerprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkeventcontrollerkey.h" #include "gtkimage.h" #include "gtkintl.h" @@ -287,11 +287,11 @@ gtk_button_class_init (GtkButtonClass *klass) } static void -multipress_pressed_cb (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkWidget *widget) +click_pressed_cb (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkWidget *widget) { GtkButton *button = GTK_BUTTON (widget); GtkButtonPrivate *priv = gtk_button_get_instance_private (button); @@ -335,11 +335,11 @@ touch_release_in_button (GtkButton *button) } static void -multipress_released_cb (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkWidget *widget) +click_released_cb (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkWidget *widget) { GtkButton *button = GTK_BUTTON (widget); GtkButtonPrivate *priv = gtk_button_get_instance_private (button); @@ -357,9 +357,9 @@ multipress_released_cb (GtkGestureMultiPress *gesture, } static void -multipress_gesture_cancel_cb (GtkGesture *gesture, - GdkEventSequence *sequence, - GtkButton *button) +click_gesture_cancel_cb (GtkGesture *gesture, + GdkEventSequence *sequence, + GtkButton *button) { gtk_button_do_release (button, FALSE); } @@ -419,13 +419,13 @@ gtk_button_init (GtkButton *button) priv->use_underline = FALSE; priv->child_type = WIDGET_CHILD; - priv->gesture = gtk_gesture_multi_press_new (); + priv->gesture = gtk_gesture_click_new (); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->gesture), FALSE); gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->gesture), TRUE); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->gesture), GDK_BUTTON_PRIMARY); - g_signal_connect (priv->gesture, "pressed", G_CALLBACK (multipress_pressed_cb), button); - g_signal_connect (priv->gesture, "released", G_CALLBACK (multipress_released_cb), button); - g_signal_connect (priv->gesture, "cancel", G_CALLBACK (multipress_gesture_cancel_cb), button); + g_signal_connect (priv->gesture, "pressed", G_CALLBACK (click_pressed_cb), button); + g_signal_connect (priv->gesture, "released", G_CALLBACK (click_released_cb), button); + g_signal_connect (priv->gesture, "cancel", G_CALLBACK (click_gesture_cancel_cb), button); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->gesture), GTK_PHASE_CAPTURE); gtk_widget_add_controller (GTK_WIDGET (button), GTK_EVENT_CONTROLLER (priv->gesture)); diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index ffabd022bc..0b45d241f2 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -83,7 +83,7 @@ #include "gtksnapshot.h" #include "gtkstylecontextprivate.h" #include "gtkwidgetprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturedrag.h" #include "gtkeventcontrollerscroll.h" #include "gtkeventcontrollerkey.h" @@ -290,18 +290,18 @@ static void gtk_calendar_size_allocate (GtkWidget *widget, int width, int height, int baseline); -static void gtk_calendar_snapshot (GtkWidget *widget, - GtkSnapshot *snapshot); -static void gtk_calendar_button_press (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data); -static void gtk_calendar_button_release (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data); +static void gtk_calendar_snapshot (GtkWidget *widget, + GtkSnapshot *snapshot); +static void gtk_calendar_button_press (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data); +static void gtk_calendar_button_release (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data); static void gtk_calendar_drag_begin (GtkGestureDrag *gesture, double x, double y, @@ -681,7 +681,7 @@ gtk_calendar_init (GtkCalendar *calendar) gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (calendar)), GTK_STYLE_CLASS_VIEW); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_calendar_button_press), calendar); g_signal_connect (gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar); gtk_widget_add_controller (GTK_WIDGET (calendar), GTK_EVENT_CONTROLLER (gesture)); @@ -2602,11 +2602,11 @@ calendar_main_button_press (GtkCalendar *calendar, static void -gtk_calendar_button_press (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_calendar_button_press (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkCalendar *calendar = user_data; GtkWidget *widget = GTK_WIDGET (calendar); @@ -2639,11 +2639,11 @@ gtk_calendar_button_press (GtkGestureMultiPress *gesture, } static void -gtk_calendar_button_release (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_calendar_button_release (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkCalendar *calendar = user_data; GtkCalendarPrivate *priv = gtk_calendar_get_instance_private (calendar); diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c index dd3b780fa3..a5d3f52499 100644 --- a/gtk/gtkcolorswatch.c +++ b/gtk/gtkcolorswatch.c @@ -26,7 +26,7 @@ #include "gtkdragdest.h" #include "gtkdragsource.h" #include "gtkgesturelongpress.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturesingle.h" #include "gtkicontheme.h" #include "gtkimage.h" @@ -324,11 +324,11 @@ hold_action (GtkGestureLongPress *gesture, } static void -tap_action (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkColorSwatch *swatch) +tap_action (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkColorSwatch *swatch) { GtkColorSwatchPrivate *priv = gtk_color_swatch_get_instance_private (swatch); guint button; @@ -580,7 +580,7 @@ gtk_color_swatch_init (GtkColorSwatch *swatch) G_CALLBACK (hold_action), swatch); gtk_widget_add_controller (GTK_WIDGET (swatch), GTK_EVENT_CONTROLLER (gesture)); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); g_signal_connect (gesture, "pressed", G_CALLBACK (tap_action), swatch); diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 10eee9ad78..ab52915b84 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -28,7 +28,6 @@ #include "gtkstack.h" #include "gtklabel.h" #include "gtkgesturelongpress.h" -#include "gtkgesturemultipress.h" #include "gtkpopover.h" #include "gtkscrolledwindow.h" #include "gtkintl.h" diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 94b97e952c..aa447f5739 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -45,7 +45,6 @@ #include "gtkemojicompletion.h" #include "gtkentrybuffer.h" #include "gtkgesturedrag.h" -#include "gtkgesturemultipress.h" #include "gtkimageprivate.h" #include "gtkimcontextsimple.h" #include "gtkintl.h" @@ -73,6 +72,7 @@ #include "gtkwidgetprivate.h" #include "gtkwindow.h" #include "gtknative.h" +#include "gtkgestureclick.h" #include "a11y/gtkentryaccessible.h" @@ -1407,7 +1407,7 @@ get_icon_position_from_controller (GtkEntry *entry, } static void -icon_pressed_cb (GtkGestureMultiPress *gesture, +icon_pressed_cb (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, @@ -1427,11 +1427,11 @@ icon_pressed_cb (GtkGestureMultiPress *gesture, } static void -icon_released_cb (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkEntry *entry) +icon_released_cb (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkEntry *entry) { GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry); GtkEntryIconPosition pos; @@ -1497,11 +1497,9 @@ construct_icon_info (GtkWidget *widget, update_icon_style (widget, icon_pos); update_node_ordering (entry); - press = gtk_gesture_multi_press_new (); - g_signal_connect (press, "pressed", - G_CALLBACK (icon_pressed_cb), entry); - g_signal_connect (press, "released", - G_CALLBACK (icon_released_cb), entry); + press = gtk_gesture_click_new (); + g_signal_connect (press, "pressed", G_CALLBACK (icon_pressed_cb), entry); + g_signal_connect (press, "released", G_CALLBACK (icon_released_cb), entry); gtk_widget_add_controller (icon_info->widget, GTK_EVENT_CONTROLLER (press)); drag = gtk_gesture_drag_new (); diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index 74572071fe..de68a66e43 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -83,8 +83,8 @@ #include "gtkentry.h" #include "gtkmain.h" #include "gtkmarshalers.h" -#include "gtkgesturemultipress.h" #include "gtkeventcontrollerkey.h" +#include "gtkgestureclick.h" #include "gtkprivate.h" #include "gtkwindowprivate.h" @@ -594,7 +594,7 @@ gtk_entry_completion_constructed (GObject *object) G_CALLBACK (propagate_to_entry), completion); gtk_widget_add_controller (priv->popup_window, controller); - controller = GTK_EVENT_CONTROLLER (gtk_gesture_multi_press_new ()); + controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ()); g_signal_connect_swapped (controller, "released", G_CALLBACK (_gtk_entry_completion_popdown), completion); diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index 59c08c6330..28cd5fe9ee 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -118,7 +118,7 @@ #include "gtkdnd.h" #include "gtkdragdest.h" #include "gtkiconprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturesingle.h" #include "gtkintl.h" #include "gtklabel.h" @@ -226,11 +226,11 @@ static void gtk_expander_measure (GtkWidget *widget, int *natural_baseline); /* Gestures */ -static void gesture_multipress_released_cb (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkExpander *expander); +static void gesture_click_released_cb (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkExpander *expander); G_DEFINE_TYPE_WITH_CODE (GtkExpander, gtk_expander, GTK_TYPE_CONTAINER, G_ADD_PRIVATE (GtkExpander) @@ -378,13 +378,13 @@ gtk_expander_init (GtkExpander *expander) gtk_drag_dest_set (GTK_WIDGET (expander), 0, NULL, 0); gtk_drag_dest_set_track_motion (GTK_WIDGET (expander), TRUE); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_PRIMARY); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); g_signal_connect (gesture, "released", - G_CALLBACK (gesture_multipress_released_cb), expander); + G_CALLBACK (gesture_click_released_cb), expander); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); gtk_widget_add_controller (GTK_WIDGET (priv->title_widget), GTK_EVENT_CONTROLLER (gesture)); @@ -522,11 +522,11 @@ gtk_expander_size_allocate (GtkWidget *widget, } static void -gesture_multipress_released_cb (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkExpander *expander) +gesture_click_released_cb (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkExpander *expander) { gtk_widget_activate (GTK_WIDGET (expander)); } diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 1e357596fe..bb68a75fb5 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -77,7 +77,7 @@ #include "gtkseparator.h" #include "gtkmodelbutton.h" #include "gtkgesturelongpress.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkeventcontrollerkey.h" #include "gtkdebug.h" #include "gtkfilechoosererrorstackprivate.h" @@ -2303,11 +2303,11 @@ file_list_show_popover_in_idle (gpointer data) } static void -multi_press_cb (GtkGesture *gesture, - int n_press, - double x, - double y, - GtkFileChooserWidget *impl) +click_cb (GtkGesture *gesture, + int n_press, + double x, + double y, + GtkFileChooserWidget *impl) { PopoverData *pd; @@ -8336,7 +8336,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) gtk_widget_class_bind_template_callback (widget_class, rename_file_name_changed); gtk_widget_class_bind_template_callback (widget_class, rename_file_rename_clicked); gtk_widget_class_bind_template_callback (widget_class, rename_file_end); - gtk_widget_class_bind_template_callback (widget_class, multi_press_cb); + gtk_widget_class_bind_template_callback (widget_class, click_cb); gtk_widget_class_bind_template_callback (widget_class, long_press_cb); gtk_widget_class_bind_template_callback (widget_class, key_press_cb); gtk_widget_class_bind_template_callback (widget_class, widget_key_press_cb); diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index afbed23910..dedb6acefa 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -82,7 +82,7 @@ #include "gtkcontainerprivate.h" #include "gtkcssnodeprivate.h" #include "gtkgesturedrag.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkintl.h" #include "gtkmain.h" #include "gtkmarshalers.h" @@ -2638,11 +2638,11 @@ gtk_flow_box_drag_gesture_update (GtkGestureDrag *gesture, } static void -gtk_flow_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkFlowBox *box) +gtk_flow_box_click_gesture_pressed (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkFlowBox *box) { GtkFlowBoxPrivate *priv = BOX_PRIV (box); GtkFlowBoxChild *child; @@ -2668,12 +2668,12 @@ gtk_flow_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture, } static void -gtk_flow_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, - gdouble x, - gdouble y, - guint button, - GdkEventSequence *sequence, - GtkFlowBox *box) +gtk_flow_box_click_unpaired_release (GtkGestureClick *gesture, + gdouble x, + gdouble y, + guint button, + GdkEventSequence *sequence, + GtkFlowBox *box) { GtkFlowBoxPrivate *priv = BOX_PRIV (box); GtkFlowBoxChild *child; @@ -2688,11 +2688,11 @@ gtk_flow_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, } static void -gtk_flow_box_multipress_gesture_released (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkFlowBox *box) +gtk_flow_box_click_gesture_released (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkFlowBox *box) { GtkFlowBoxPrivate *priv = BOX_PRIV (box); @@ -2732,8 +2732,8 @@ gtk_flow_box_multipress_gesture_released (GtkGestureMultiPress *gesture, } static void -gtk_flow_box_multipress_gesture_stopped (GtkGestureMultiPress *gesture, - GtkFlowBox *box) +gtk_flow_box_click_gesture_stopped (GtkGestureClick *gesture, + GtkFlowBox *box) { GtkFlowBoxPrivate *priv = BOX_PRIV (box); @@ -3728,7 +3728,7 @@ gtk_flow_box_init (GtkFlowBox *box) priv->children = g_sequence_new (NULL); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), @@ -3736,13 +3736,13 @@ gtk_flow_box_init (GtkFlowBox *box) gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); g_signal_connect (gesture, "pressed", - G_CALLBACK (gtk_flow_box_multipress_gesture_pressed), box); + G_CALLBACK (gtk_flow_box_click_gesture_pressed), box); g_signal_connect (gesture, "released", - G_CALLBACK (gtk_flow_box_multipress_gesture_released), box); + G_CALLBACK (gtk_flow_box_click_gesture_released), box); g_signal_connect (gesture, "stopped", - G_CALLBACK (gtk_flow_box_multipress_gesture_stopped), box); + G_CALLBACK (gtk_flow_box_click_gesture_stopped), box); g_signal_connect (gesture, "unpaired-release", - G_CALLBACK (gtk_flow_box_multipress_unpaired_release), box); + G_CALLBACK (gtk_flow_box_click_unpaired_release), box); gtk_widget_add_controller (GTK_WIDGET (box), GTK_EVENT_CONTROLLER (gesture)); priv->drag_gesture = gtk_gesture_drag_new (); diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index cdf46c8034..8c93be4e0c 100644 --- a/gtk/gtkfontchooserwidget.c +++ b/gtk/gtkfontchooserwidget.c @@ -53,7 +53,7 @@ #include "gtkdialog.h" #include "gtkradiobutton.h" #include "gtkcombobox.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkeventcontrollerscroll.h" #include "gtkroot.h" @@ -2054,7 +2054,7 @@ add_check_group (GtkFontChooserWidget *fontchooser, g_signal_connect_swapped (feat, "notify::inconsistent", G_CALLBACK (update_font_features), fontchooser); g_signal_connect (feat, "clicked", G_CALLBACK (feat_clicked), NULL); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY); g_signal_connect (gesture, "pressed", G_CALLBACK (feat_pressed), feat); gtk_widget_add_controller (feat, GTK_EVENT_CONTROLLER (gesture)); diff --git a/gtk/gtkgesturemultipress.c b/gtk/gtkgestureclick.c index d2877d46d7..4fa713109a 100644 --- a/gtk/gtkgesturemultipress.c +++ b/gtk/gtkgestureclick.c @@ -18,32 +18,32 @@ */ /** - * SECTION:gtkgesturemultipress + * SECTION:gtkgestureclick * @Short_description: Multipress gesture - * @Title: GtkGestureMultiPress + * @Title: GtkGestureClick * - * #GtkGestureMultiPress is a #GtkGesture implementation able to recognize - * multiple clicks on a nearby zone, which can be listened for through the - * #GtkGestureMultiPress::pressed signal. Whenever time or distance between - * clicks exceed the GTK+ defaults, #GtkGestureMultiPress::stopped is emitted, - * and the click counter is reset. + * #GtkGestureClick is a #GtkGesture implementation able to recognize + * multiple clicks on a nearby zone, which can be listened for through + * the #GtkGestureClick::pressed signal. Whenever time or distance + * between clicks exceed the GTK+ defaults, #GtkGestureClick::stopped + * is emitted, and the click counter is reset. * * Callers may also restrict the area that is considered valid for a >1 - * touch/button press through gtk_gesture_multi_press_set_area(), so any - * click happening outside that area is considered to be a first click of - * its own. + * touch/button press through gtk_gesture_click_set_area(), so any + * click happening outside that area is considered to be a first click + * of its own. */ #include "config.h" #include "gtkgestureprivate.h" -#include "gtkgesturemultipress.h" -#include "gtkgesturemultipressprivate.h" +#include "gtkgestureclick.h" +#include "gtkgestureclickprivate.h" #include "gtkprivate.h" #include "gtkintl.h" -typedef struct _GtkGestureMultiPressPrivate GtkGestureMultiPressPrivate; +typedef struct _GtkGestureClickPrivate GtkGestureClickPrivate; -struct _GtkGestureMultiPressPrivate +struct _GtkGestureClickPrivate { GdkRectangle rect; GdkDevice *current_device; @@ -66,16 +66,16 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE_WITH_PRIVATE (GtkGestureMultiPress, gtk_gesture_multi_press, GTK_TYPE_GESTURE_SINGLE) +G_DEFINE_TYPE_WITH_PRIVATE (GtkGestureClick, gtk_gesture_click, GTK_TYPE_GESTURE_SINGLE) static void -gtk_gesture_multi_press_finalize (GObject *object) +gtk_gesture_click_finalize (GObject *object) { - GtkGestureMultiPressPrivate *priv; - GtkGestureMultiPress *gesture; + GtkGestureClickPrivate *priv; + GtkGestureClick *gesture; - gesture = GTK_GESTURE_MULTI_PRESS (object); - priv = gtk_gesture_multi_press_get_instance_private (gesture); + gesture = GTK_GESTURE_CLICK (object); + priv = gtk_gesture_click_get_instance_private (gesture); if (priv->double_click_timeout_id) { @@ -83,19 +83,19 @@ gtk_gesture_multi_press_finalize (GObject *object) priv->double_click_timeout_id = 0; } - G_OBJECT_CLASS (gtk_gesture_multi_press_parent_class)->finalize (object); + G_OBJECT_CLASS (gtk_gesture_click_parent_class)->finalize (object); } static gboolean -gtk_gesture_multi_press_check (GtkGesture *gesture) +gtk_gesture_click_check (GtkGesture *gesture) { - GtkGestureMultiPress *multi_press; - GtkGestureMultiPressPrivate *priv; + GtkGestureClick *click; + GtkGestureClickPrivate *priv; GList *sequences; gboolean active; - multi_press = GTK_GESTURE_MULTI_PRESS (gesture); - priv = gtk_gesture_multi_press_get_instance_private (multi_press); + click = GTK_GESTURE_CLICK (gesture); + priv = gtk_gesture_click_get_instance_private (click); sequences = gtk_gesture_get_sequences (gesture); active = g_list_length (sequences) == 1 || priv->double_click_timeout_id; @@ -105,11 +105,11 @@ gtk_gesture_multi_press_check (GtkGesture *gesture) } static void -_gtk_gesture_multi_press_stop (GtkGestureMultiPress *gesture) +_gtk_gesture_click_stop (GtkGestureClick *gesture) { - GtkGestureMultiPressPrivate *priv; + GtkGestureClickPrivate *priv; - priv = gtk_gesture_multi_press_get_instance_private (gesture); + priv = gtk_gesture_click_get_instance_private (gesture); if (priv->n_presses == 0) return; @@ -124,25 +124,25 @@ _gtk_gesture_multi_press_stop (GtkGestureMultiPress *gesture) static gboolean _double_click_timeout_cb (gpointer user_data) { - GtkGestureMultiPress *gesture = user_data; - GtkGestureMultiPressPrivate *priv; + GtkGestureClick *gesture = user_data; + GtkGestureClickPrivate *priv; - priv = gtk_gesture_multi_press_get_instance_private (gesture); + priv = gtk_gesture_click_get_instance_private (gesture); priv->double_click_timeout_id = 0; - _gtk_gesture_multi_press_stop (gesture); + _gtk_gesture_click_stop (gesture); return FALSE; } static void -_gtk_gesture_multi_press_update_timeout (GtkGestureMultiPress *gesture) +_gtk_gesture_click_update_timeout (GtkGestureClick *gesture) { - GtkGestureMultiPressPrivate *priv; + GtkGestureClickPrivate *priv; guint double_click_time; GtkSettings *settings; GtkWidget *widget; - priv = gtk_gesture_multi_press_get_instance_private (gesture); + priv = gtk_gesture_click_get_instance_private (gesture); if (priv->double_click_timeout_id) g_source_remove (priv->double_click_timeout_id); @@ -156,16 +156,16 @@ _gtk_gesture_multi_press_update_timeout (GtkGestureMultiPress *gesture) } static gboolean -_gtk_gesture_multi_press_check_within_threshold (GtkGestureMultiPress *gesture, - gdouble x, - gdouble y) +_gtk_gesture_click_check_within_threshold (GtkGestureClick *gesture, + double x, + double y) { - GtkGestureMultiPressPrivate *priv; + GtkGestureClickPrivate *priv; guint double_click_distance; GtkSettings *settings; GtkWidget *widget; - priv = gtk_gesture_multi_press_get_instance_private (gesture); + priv = gtk_gesture_click_get_instance_private (gesture); if (priv->n_presses == 0) return TRUE; @@ -189,11 +189,11 @@ _gtk_gesture_multi_press_check_within_threshold (GtkGestureMultiPress *gesture, } static void -gtk_gesture_multi_press_begin (GtkGesture *gesture, - GdkEventSequence *sequence) +gtk_gesture_click_begin (GtkGesture *gesture, + GdkEventSequence *sequence) { - GtkGestureMultiPress *multi_press; - GtkGestureMultiPressPrivate *priv; + GtkGestureClick *click; + GtkGestureClickPrivate *priv; guint n_presses, button = 1; GdkEventSequence *current; const GdkEvent *event; @@ -204,8 +204,8 @@ gtk_gesture_multi_press_begin (GtkGesture *gesture, if (!gtk_gesture_handles_sequence (gesture, sequence)) return; - multi_press = GTK_GESTURE_MULTI_PRESS (gesture); - priv = gtk_gesture_multi_press_get_instance_private (multi_press); + click = GTK_GESTURE_CLICK (gesture); + priv = gtk_gesture_click_get_instance_private (click); event = gtk_gesture_get_last_event (gesture, sequence); current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); device = gdk_event_get_source_device (event); @@ -221,19 +221,19 @@ gtk_gesture_multi_press_begin (GtkGesture *gesture, /* Reset the gesture if the button number changes mid-recognition */ if (priv->n_presses > 0 && priv->current_button != button) - _gtk_gesture_multi_press_stop (multi_press); + _gtk_gesture_click_stop (click); /* Reset also if the device changed */ if (priv->current_device && priv->current_device != device) - _gtk_gesture_multi_press_stop (multi_press); + _gtk_gesture_click_stop (click); priv->current_device = device; priv->current_button = button; - _gtk_gesture_multi_press_update_timeout (multi_press); + _gtk_gesture_click_update_timeout (click); gtk_gesture_get_point (gesture, current, &x, &y); - if (!_gtk_gesture_multi_press_check_within_threshold (multi_press, x, y)) - _gtk_gesture_multi_press_stop (multi_press); + if (!_gtk_gesture_click_check_within_threshold (click, x, y)) + _gtk_gesture_click_stop (click); /* Increment later the real counter, just if the gesture is * reset on the pressed handler */ @@ -251,34 +251,34 @@ gtk_gesture_multi_press_begin (GtkGesture *gesture, } static void -gtk_gesture_multi_press_update (GtkGesture *gesture, - GdkEventSequence *sequence) +gtk_gesture_click_update (GtkGesture *gesture, + GdkEventSequence *sequence) { - GtkGestureMultiPress *multi_press; + GtkGestureClick *click; GdkEventSequence *current; gdouble x, y; - multi_press = GTK_GESTURE_MULTI_PRESS (gesture); + click = GTK_GESTURE_CLICK (gesture); current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); gtk_gesture_get_point (gesture, current, &x, &y); - if (!_gtk_gesture_multi_press_check_within_threshold (multi_press, x, y)) - _gtk_gesture_multi_press_stop (multi_press); + if (!_gtk_gesture_click_check_within_threshold (click, x, y)) + _gtk_gesture_click_stop (click); } static void -gtk_gesture_multi_press_end (GtkGesture *gesture, - GdkEventSequence *sequence) +gtk_gesture_click_end (GtkGesture *gesture, + GdkEventSequence *sequence) { - GtkGestureMultiPress *multi_press; - GtkGestureMultiPressPrivate *priv; + GtkGestureClick *click; + GtkGestureClickPrivate *priv; GdkEventSequence *current; gdouble x, y; gboolean interpreted; GtkEventSequenceState state; - multi_press = GTK_GESTURE_MULTI_PRESS (gesture); - priv = gtk_gesture_multi_press_get_instance_private (multi_press); + click = GTK_GESTURE_CLICK (gesture); + priv = gtk_gesture_click_get_instance_private (click); current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); interpreted = gtk_gesture_get_point (gesture, current, &x, &y); state = gtk_gesture_get_sequence_state (gesture, current); @@ -290,32 +290,32 @@ gtk_gesture_multi_press_end (GtkGesture *gesture, } static void -gtk_gesture_multi_press_cancel (GtkGesture *gesture, - GdkEventSequence *sequence) +gtk_gesture_click_cancel (GtkGesture *gesture, + GdkEventSequence *sequence) { - _gtk_gesture_multi_press_stop (GTK_GESTURE_MULTI_PRESS (gesture)); - GTK_GESTURE_CLASS (gtk_gesture_multi_press_parent_class)->cancel (gesture, sequence); + _gtk_gesture_click_stop (GTK_GESTURE_CLICK (gesture)); + GTK_GESTURE_CLASS (gtk_gesture_click_parent_class)->cancel (gesture, sequence); } static void -gtk_gesture_multi_press_reset (GtkEventController *controller) +gtk_gesture_click_reset (GtkEventController *controller) { - _gtk_gesture_multi_press_stop (GTK_GESTURE_MULTI_PRESS (controller)); - GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_multi_press_parent_class)->reset (controller); + _gtk_gesture_click_stop (GTK_GESTURE_CLICK (controller)); + GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_click_parent_class)->reset (controller); } static gboolean -gtk_gesture_multi_press_handle_event (GtkEventController *controller, - const GdkEvent *event) +gtk_gesture_click_handle_event (GtkEventController *controller, + const GdkEvent *event) { GtkEventControllerClass *parent_controller; - GtkGestureMultiPressPrivate *priv; + GtkGestureClickPrivate *priv; GdkEventSequence *sequence; guint button; gdouble x, y; - priv = gtk_gesture_multi_press_get_instance_private (GTK_GESTURE_MULTI_PRESS (controller)); - parent_controller = GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_multi_press_parent_class); + priv = gtk_gesture_click_get_instance_private (GTK_GESTURE_CLICK (controller)); + parent_controller = GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_click_parent_class); sequence = gdk_event_get_event_sequence (event); if (priv->n_presses == 0 && @@ -334,25 +334,25 @@ gtk_gesture_multi_press_handle_event (GtkEventController *controller, } static void -gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass) +gtk_gesture_click_class_init (GtkGestureClickClass *klass) { GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkGestureClass *gesture_class = GTK_GESTURE_CLASS (klass); - object_class->finalize = gtk_gesture_multi_press_finalize; + object_class->finalize = gtk_gesture_click_finalize; - gesture_class->check = gtk_gesture_multi_press_check; - gesture_class->begin = gtk_gesture_multi_press_begin; - gesture_class->update = gtk_gesture_multi_press_update; - gesture_class->end = gtk_gesture_multi_press_end; - gesture_class->cancel = gtk_gesture_multi_press_cancel; + gesture_class->check = gtk_gesture_click_check; + gesture_class->begin = gtk_gesture_click_begin; + gesture_class->update = gtk_gesture_click_update; + gesture_class->end = gtk_gesture_click_end; + gesture_class->cancel = gtk_gesture_click_cancel; - controller_class->reset = gtk_gesture_multi_press_reset; - controller_class->handle_event = gtk_gesture_multi_press_handle_event; + controller_class->reset = gtk_gesture_click_reset; + controller_class->handle_event = gtk_gesture_click_handle_event; /** - * GtkGestureMultiPress::pressed: + * GtkGestureClick::pressed: * @gesture: the object which received the signal * @n_press: how many touch/button presses happened with this one * @x: The X coordinate, in widget allocation coordinates @@ -364,13 +364,13 @@ gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass) g_signal_new (I_("pressed"), G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkGestureMultiPressClass, pressed), + G_STRUCT_OFFSET (GtkGestureClickClass, pressed), NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_DOUBLE, G_TYPE_DOUBLE); /** - * GtkGestureMultiPress::released: + * GtkGestureClick::released: * @gesture: the object which received the signal * @n_press: number of press that is paired with this release * @x: The X coordinate, in widget allocation coordinates @@ -378,19 +378,19 @@ gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass) * * This signal is emitted when a button or touch is released. @n_press * will report the number of press that is paired to this event, note - * that #GtkGestureMultiPress::stopped may have been emitted between the + * that #GtkGestureClick::stopped may have been emitted between the * press and its release, @n_press will only start over at the next press. */ signals[RELEASED] = g_signal_new (I_("released"), G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkGestureMultiPressClass, released), + G_STRUCT_OFFSET (GtkGestureClickClass, released), NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_DOUBLE, G_TYPE_DOUBLE); /** - * GtkGestureMultiPress::stopped: + * GtkGestureClick::stopped: * @gesture: the object which received the signal * * This signal is emitted whenever any time/distance threshold has @@ -400,12 +400,12 @@ gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass) g_signal_new (I_("stopped"), G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkGestureMultiPressClass, stopped), + G_STRUCT_OFFSET (GtkGestureClickClass, stopped), NULL, NULL, NULL, G_TYPE_NONE, 0); /** - * GtkGestureMultiPress::unpaired-release + * GtkGestureClick::unpaired-release * @gesture: the object which received the signal * @x: X coordinate of the event * @y: Y coordinate of the event @@ -429,28 +429,28 @@ gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass) } static void -gtk_gesture_multi_press_init (GtkGestureMultiPress *gesture) +gtk_gesture_click_init (GtkGestureClick *gesture) { } /** - * gtk_gesture_multi_press_new: + * gtk_gesture_click_new: * * Returns a newly created #GtkGesture that recognizes single and multiple * presses. * - * Returns: a newly created #GtkGestureMultiPress + * Returns: a newly created #GtkGestureClick **/ GtkGesture * -gtk_gesture_multi_press_new (void) +gtk_gesture_click_new (void) { - return g_object_new (GTK_TYPE_GESTURE_MULTI_PRESS, + return g_object_new (GTK_TYPE_GESTURE_CLICK, NULL); } /** - * gtk_gesture_multi_press_set_area: - * @gesture: a #GtkGestureMultiPress + * gtk_gesture_click_set_area: + * @gesture: a #GtkGestureClick * @rect: (allow-none): rectangle to receive coordinates on * * If @rect is non-%NULL, the press area will be checked to be @@ -464,14 +464,14 @@ gtk_gesture_multi_press_new (void) * akin to an input shape. **/ void -gtk_gesture_multi_press_set_area (GtkGestureMultiPress *gesture, - const GdkRectangle *rect) +gtk_gesture_click_set_area (GtkGestureClick *gesture, + const GdkRectangle *rect) { - GtkGestureMultiPressPrivate *priv; + GtkGestureClickPrivate *priv; - g_return_if_fail (GTK_IS_GESTURE_MULTI_PRESS (gesture)); + g_return_if_fail (GTK_IS_GESTURE_CLICK (gesture)); - priv = gtk_gesture_multi_press_get_instance_private (gesture); + priv = gtk_gesture_click_get_instance_private (gesture); if (!rect) priv->rect_is_set = FALSE; @@ -483,26 +483,26 @@ gtk_gesture_multi_press_set_area (GtkGestureMultiPress *gesture, } /** - * gtk_gesture_multi_press_get_area: - * @gesture: a #GtkGestureMultiPress + * gtk_gesture_click_get_area: + * @gesture: a #GtkGestureClick * @rect: (out): return location for the press area * - * If an area was set through gtk_gesture_multi_press_set_area(), + * If an area was set through gtk_gesture_click_set_area(), * this function will return %TRUE and fill in @rect with the - * press area. See gtk_gesture_multi_press_set_area() for more + * press area. See gtk_gesture_click_set_area() for more * details on what the press area represents. * * Returns: %TRUE if @rect was filled with the press area **/ gboolean -gtk_gesture_multi_press_get_area (GtkGestureMultiPress *gesture, - GdkRectangle *rect) +gtk_gesture_click_get_area (GtkGestureClick *gesture, + GdkRectangle *rect) { - GtkGestureMultiPressPrivate *priv; + GtkGestureClickPrivate *priv; - g_return_val_if_fail (GTK_IS_GESTURE_MULTI_PRESS (gesture), FALSE); + g_return_val_if_fail (GTK_IS_GESTURE_CLICK (gesture), FALSE); - priv = gtk_gesture_multi_press_get_instance_private (gesture); + priv = gtk_gesture_click_get_instance_private (gesture); if (rect) { diff --git a/gtk/gtkgestureclick.h b/gtk/gtkgestureclick.h new file mode 100644 index 0000000000..ea86fdb6d5 --- /dev/null +++ b/gtk/gtkgestureclick.h @@ -0,0 +1,56 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 2014 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + * Author(s): Carlos Garnacho <carlosg@gnome.org> + */ +#ifndef __GTK_GESTURE_CLICK_H__ +#define __GTK_GESTURE_CLICK_H__ + +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#error "Only <gtk/gtk.h> can be included directly." +#endif + +#include <gtk/gtkwidget.h> +#include <gtk/gtkgesturesingle.h> + +G_BEGIN_DECLS + +#define GTK_TYPE_GESTURE_CLICK (gtk_gesture_click_get_type ()) +#define GTK_GESTURE_CLICK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_CLICK, GtkGestureClick)) +#define GTK_GESTURE_CLICK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_CLICK, GtkGestureClickClass)) +#define GTK_IS_GESTURE_CLICK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_CLICK)) +#define GTK_IS_GESTURE_CLICK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_CLICK)) +#define GTK_GESTURE_CLICK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_CLICK, GtkGestureClickClass)) + +typedef struct _GtkGestureClick GtkGestureClick; +typedef struct _GtkGestureClickClass GtkGestureClickClass; + +GDK_AVAILABLE_IN_ALL +GType gtk_gesture_click_get_type (void) G_GNUC_CONST; + +GDK_AVAILABLE_IN_ALL +GtkGesture * gtk_gesture_click_new (void); + +GDK_AVAILABLE_IN_ALL +void gtk_gesture_click_set_area (GtkGestureClick *gesture, + const GdkRectangle *rect); +GDK_AVAILABLE_IN_ALL +gboolean gtk_gesture_click_get_area (GtkGestureClick *gesture, + GdkRectangle *rect); + +G_END_DECLS + +#endif /* __GTK_GESTURE_CLICK_H__ */ diff --git a/gtk/gtkgesturemultipressprivate.h b/gtk/gtkgestureclickprivate.h index ae74979633..6e3f825932 100644 --- a/gtk/gtkgesturemultipressprivate.h +++ b/gtk/gtkgestureclickprivate.h @@ -16,33 +16,33 @@ * * Author(s): Carlos Garnacho <carlosg@gnome.org> */ -#ifndef __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__ -#define __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__ +#ifndef __GTK_GESTURE_CLICK_PRIVATE_H__ +#define __GTK_GESTURE_CLICK_PRIVATE_H__ #include "gtkgesturesingleprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" -struct _GtkGestureMultiPress +struct _GtkGestureClick { GtkGestureSingle parent_instance; }; -struct _GtkGestureMultiPressClass +struct _GtkGestureClickClass { GtkGestureSingleClass parent_class; - void (* pressed) (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y); - void (* released) (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y); - void (* stopped) (GtkGestureMultiPress *gesture); + void (* pressed) (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y); + void (* released) (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y); + void (* stopped) (GtkGestureClick *gesture); /*<private>*/ gpointer padding[10]; }; -#endif /* __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__ */ +#endif /* __GTK_GESTURE_CLICK_PRIVATE_H__ */ diff --git a/gtk/gtkgesturemultipress.h b/gtk/gtkgesturemultipress.h deleted file mode 100644 index 16c50ff102..0000000000 --- a/gtk/gtkgesturemultipress.h +++ /dev/null @@ -1,56 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 2014 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - * Author(s): Carlos Garnacho <carlosg@gnome.org> - */ -#ifndef __GTK_GESTURE_MULTI_PRESS_H__ -#define __GTK_GESTURE_MULTI_PRESS_H__ - -#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) -#error "Only <gtk/gtk.h> can be included directly." -#endif - -#include <gtk/gtkwidget.h> -#include <gtk/gtkgesturesingle.h> - -G_BEGIN_DECLS - -#define GTK_TYPE_GESTURE_MULTI_PRESS (gtk_gesture_multi_press_get_type ()) -#define GTK_GESTURE_MULTI_PRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_MULTI_PRESS, GtkGestureMultiPress)) -#define GTK_GESTURE_MULTI_PRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_MULTI_PRESS, GtkGestureMultiPressClass)) -#define GTK_IS_GESTURE_MULTI_PRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_MULTI_PRESS)) -#define GTK_IS_GESTURE_MULTI_PRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_MULTI_PRESS)) -#define GTK_GESTURE_MULTI_PRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_MULTI_PRESS, GtkGestureMultiPressClass)) - -typedef struct _GtkGestureMultiPress GtkGestureMultiPress; -typedef struct _GtkGestureMultiPressClass GtkGestureMultiPressClass; - -GDK_AVAILABLE_IN_ALL -GType gtk_gesture_multi_press_get_type (void) G_GNUC_CONST; - -GDK_AVAILABLE_IN_ALL -GtkGesture * gtk_gesture_multi_press_new (void); - -GDK_AVAILABLE_IN_ALL -void gtk_gesture_multi_press_set_area (GtkGestureMultiPress *gesture, - const GdkRectangle *rect); -GDK_AVAILABLE_IN_ALL -gboolean gtk_gesture_multi_press_get_area (GtkGestureMultiPress *gesture, - GdkRectangle *rect); - -G_END_DECLS - -#endif /* __GTK_GESTURE_MULTI_PRESS_H__ */ diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index 5bebc6a999..56d15c5fc4 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -167,12 +167,12 @@ static void gtk_icon_view_leave (GtkEventControl GdkCrossingMode mode, GdkNotifyType detail, gpointer user_data); -static void gtk_icon_view_button_press (GtkGestureMultiPress *gesture, +static void gtk_icon_view_button_press (GtkGestureClick *gesture, int n_press, double x, double y, gpointer user_data); -static void gtk_icon_view_button_release (GtkGestureMultiPress *gesture, +static void gtk_icon_view_button_release (GtkGestureClick *gesture, int n_press, double x, double y, @@ -958,7 +958,7 @@ gtk_icon_view_init (GtkIconView *icon_view) gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (icon_view)), GTK_STYLE_CLASS_VIEW); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_icon_view_button_press), icon_view); g_signal_connect (gesture, "released", G_CALLBACK (gtk_icon_view_button_release), @@ -2101,11 +2101,11 @@ gtk_icon_view_get_cursor (GtkIconView *icon_view, } static void -gtk_icon_view_button_press (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_icon_view_button_press (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkIconView *icon_view = user_data; GtkWidget *widget = GTK_WIDGET (icon_view); @@ -2271,11 +2271,11 @@ button_event_modifies_selection (const GdkEventButton *event) } static void -gtk_icon_view_button_release (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_icon_view_button_release (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkIconView *icon_view = user_data; int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)); diff --git a/gtk/gtkiconviewprivate.h b/gtk/gtkiconviewprivate.h index 351ccfac66..e507cb55bc 100644 --- a/gtk/gtkiconviewprivate.h +++ b/gtk/gtkiconviewprivate.h @@ -17,7 +17,7 @@ #include "gtk/gtkiconview.h" #include "gtk/gtkcssnodeprivate.h" -#include "gtk/gtkgesturemultipress.h" +#include "gtk/gtkgestureclick.h" #include "gtk/gtkeventcontrollermotion.h" #ifndef __GTK_ICON_VIEW_PRIVATE_H__ diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c index 1955cc17e3..647f238d1c 100644 --- a/gtk/gtkimcontextwayland.c +++ b/gtk/gtkimcontextwayland.c @@ -482,11 +482,11 @@ gtk_im_context_wayland_finalize (GObject *object) } static void -pressed_cb (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkIMContextWayland *context) +pressed_cb (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkIMContextWayland *context) { if (n_press == 1) { @@ -496,11 +496,11 @@ pressed_cb (GtkGestureMultiPress *gesture, } static void -released_cb (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkIMContextWayland *context) +released_cb (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkIMContextWayland *context) { GtkIMContextWaylandGlobal *global; GtkInputHints hints; @@ -547,7 +547,7 @@ gtk_im_context_wayland_set_client_widget (GtkIMContext *context, { GtkGesture *gesture; - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_CAPTURE); g_signal_connect (gesture, "pressed", diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index fe440701e3..ff62dd3302 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -35,7 +35,7 @@ #include "gtkdnd.h" #include "gtkeventcontrollermotion.h" #include "gtkgesturedrag.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturesingle.h" #include "gtkimage.h" #include "gtkintl.h" @@ -363,7 +363,7 @@ struct _GtkLabelSelectionInfo GtkLabelLink *active_link; GtkGesture *drag_gesture; - GtkGesture *multipress_gesture; + GtkGesture *click_gesture; GtkEventController *motion_controller; gint drag_start_x; @@ -553,12 +553,12 @@ static void emit_activate_link (GtkLabel *label, GtkLabelLink *link); /* Event controller callbacks */ -static void gtk_label_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +static void gtk_label_click_gesture_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, GtkLabel *label); -static void gtk_label_multipress_gesture_released (GtkGestureMultiPress *gesture, +static void gtk_label_click_gesture_released (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, @@ -4458,11 +4458,11 @@ out: } static void -gtk_label_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - gint n_press, - gdouble widget_x, - gdouble widget_y, - GtkLabel *label) +gtk_label_click_gesture_pressed (GtkGestureClick *gesture, + gint n_press, + gdouble widget_x, + gdouble widget_y, + GtkLabel *label) { GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelSelectionInfo *info = priv->select_info; @@ -4536,11 +4536,11 @@ gtk_label_multipress_gesture_pressed (GtkGestureMultiPress *gesture, } static void -gtk_label_multipress_gesture_released (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkLabel *label) +gtk_label_click_gesture_released (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkLabel *label) { GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelSelectionInfo *info = priv->select_info; @@ -4605,9 +4605,9 @@ connect_mnemonics_visible_notify (GtkLabel *label) } static void -drag_begin_cb (GtkWidget *widget, - GdkDrag *drag, - gpointer data) +drag_begin_cb (GtkWidget *widget, + GdkDrag *drag, + gpointer data) { GtkLabel *label = GTK_LABEL (widget); GtkLabelPrivate *priv = gtk_label_get_instance_private (label); @@ -5047,14 +5047,14 @@ gtk_label_ensure_select_info (GtkLabel *label) gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->select_info->drag_gesture), TRUE); gtk_widget_add_controller (GTK_WIDGET (label), GTK_EVENT_CONTROLLER (priv->select_info->drag_gesture)); - priv->select_info->multipress_gesture = gtk_gesture_multi_press_new (); - g_signal_connect (priv->select_info->multipress_gesture, "pressed", - G_CALLBACK (gtk_label_multipress_gesture_pressed), label); - g_signal_connect (priv->select_info->multipress_gesture, "released", - G_CALLBACK (gtk_label_multipress_gesture_released), label); - gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->select_info->multipress_gesture), 0); - gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->select_info->multipress_gesture), TRUE); - gtk_widget_add_controller (GTK_WIDGET (label), GTK_EVENT_CONTROLLER (priv->select_info->multipress_gesture)); + priv->select_info->click_gesture = gtk_gesture_click_new (); + g_signal_connect (priv->select_info->click_gesture, "pressed", + G_CALLBACK (gtk_label_click_gesture_pressed), label); + g_signal_connect (priv->select_info->click_gesture, "released", + G_CALLBACK (gtk_label_click_gesture_released), label); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->select_info->click_gesture), 0); + gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->select_info->click_gesture), TRUE); + gtk_widget_add_controller (GTK_WIDGET (label), GTK_EVENT_CONTROLLER (priv->select_info->click_gesture)); priv->select_info->motion_controller = gtk_event_controller_motion_new (); g_signal_connect (priv->select_info->motion_controller, "motion", @@ -5079,7 +5079,7 @@ gtk_label_clear_select_info (GtkLabel *label) if (!priv->select_info->selectable && !priv->select_info->links) { gtk_widget_remove_controller (GTK_WIDGET (label), GTK_EVENT_CONTROLLER (priv->select_info->drag_gesture)); - gtk_widget_remove_controller (GTK_WIDGET (label), GTK_EVENT_CONTROLLER (priv->select_info->multipress_gesture)); + gtk_widget_remove_controller (GTK_WIDGET (label), GTK_EVENT_CONTROLLER (priv->select_info->click_gesture)); gtk_widget_remove_controller (GTK_WIDGET (label), priv->select_info->motion_controller); GTK_LABEL_CONTENT (priv->select_info->provider)->label = NULL; g_object_unref (priv->select_info->provider); diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c index b116cdc586..f867b63c91 100644 --- a/gtk/gtklinkbutton.c +++ b/gtk/gtklinkbutton.c @@ -54,7 +54,7 @@ #include "gtklinkbutton.h" #include "gtkdragsource.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturesingle.h" #include "gtkintl.h" #include "gtklabel.h" @@ -135,7 +135,7 @@ static gboolean gtk_link_button_query_tooltip_cb (GtkWidget *widget, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer data); -static void gtk_link_button_pressed_cb (GtkGestureMultiPress *gesture, +static void gtk_link_button_pressed_cb (GtkGestureClick *gesture, int n_press, double x, double y, @@ -249,7 +249,7 @@ gtk_link_button_init (GtkLinkButton *link_button) gdk_content_formats_unref (targets); gtk_drag_source_set_icon_name (GTK_WIDGET (link_button), "text-x-generic"); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); @@ -382,11 +382,11 @@ gtk_link_button_do_popup (GtkLinkButton *link_button, } static void -gtk_link_button_pressed_cb (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_link_button_pressed_cb (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkLinkButton *link_button = user_data; GtkLinkButtonPrivate *priv = gtk_link_button_get_instance_private (link_button); diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 1927defb9b..f10b6c947f 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -26,7 +26,7 @@ #include "gtkcontainerprivate.h" #include "gtkcssnodeprivate.h" #include "gtkdnd.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkintl.h" #include "gtkmain.h" #include "gtkmarshalers.h" @@ -282,24 +282,24 @@ static void gtk_list_box_selected_rows_changed (GtkList static void gtk_list_box_set_accept_unpaired_release (GtkListBox *box, gboolean accept); -static void gtk_list_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkListBox *box); -static void gtk_list_box_multipress_gesture_released (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkListBox *box); -static void gtk_list_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, - gdouble x, - gdouble y, - guint button, - GdkEventSequence *sequence, - GtkListBox *box); -static void gtk_list_box_multipress_gesture_stopped (GtkGestureMultiPress *gesture, - GtkListBox *box); +static void gtk_list_box_click_gesture_pressed (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkListBox *box); +static void gtk_list_box_click_gesture_released (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkListBox *box); +static void gtk_list_box_click_unpaired_release (GtkGestureClick *gesture, + gdouble x, + gdouble y, + guint button, + GdkEventSequence *sequence, + GtkListBox *box); +static void gtk_list_box_click_gesture_stopped (GtkGestureClick *gesture, + GtkListBox *box); static void gtk_list_box_update_row_styles (GtkListBox *box); static void gtk_list_box_update_row_style (GtkListBox *box, @@ -658,7 +658,7 @@ gtk_list_box_init (GtkListBox *box) priv->children = g_sequence_new (NULL); priv->header_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), @@ -666,13 +666,13 @@ gtk_list_box_init (GtkListBox *box) gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_PRIMARY); g_signal_connect (gesture, "pressed", - G_CALLBACK (gtk_list_box_multipress_gesture_pressed), box); + G_CALLBACK (gtk_list_box_click_gesture_pressed), box); g_signal_connect (gesture, "released", - G_CALLBACK (gtk_list_box_multipress_gesture_released), box); + G_CALLBACK (gtk_list_box_click_gesture_released), box); g_signal_connect (gesture, "stopped", - G_CALLBACK (gtk_list_box_multipress_gesture_stopped), box); + G_CALLBACK (gtk_list_box_click_gesture_stopped), box); g_signal_connect (gesture, "unpaired-release", - G_CALLBACK (gtk_list_box_multipress_unpaired_release), box); + G_CALLBACK (gtk_list_box_click_unpaired_release), box); gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture)); g_signal_connect (box, "notify::parent", G_CALLBACK (gtk_list_box_parent_cb), NULL); @@ -1773,11 +1773,11 @@ gtk_list_box_select_and_activate_full (GtkListBox *box, } static void -gtk_list_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkListBox *box) +gtk_list_box_click_gesture_pressed (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkListBox *box) { GtkListBoxPrivate *priv = BOX_PRIV (box); GtkListBoxRow *row; @@ -1817,12 +1817,12 @@ get_current_selection_modifiers (GtkWidget *widget, } static void -gtk_list_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, - gdouble x, - gdouble y, - guint button, - GdkEventSequence *sequence, - GtkListBox *box) +gtk_list_box_click_unpaired_release (GtkGestureClick *gesture, + gdouble x, + gdouble y, + guint button, + GdkEventSequence *sequence, + GtkListBox *box) { GtkListBoxPrivate *priv = BOX_PRIV (box); GtkListBoxRow *row; @@ -1837,11 +1837,11 @@ gtk_list_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, } static void -gtk_list_box_multipress_gesture_released (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkListBox *box) +gtk_list_box_click_gesture_released (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkListBox *box) { GtkListBoxPrivate *priv = BOX_PRIV (box); @@ -1890,7 +1890,7 @@ gtk_list_box_multipress_gesture_released (GtkGestureMultiPress *gesture, } static void -gtk_list_box_multipress_gesture_stopped (GtkGestureMultiPress *gesture, +gtk_list_box_click_gesture_stopped (GtkGestureClick *gesture, GtkListBox *box) { GtkListBoxPrivate *priv = BOX_PRIV (box); diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index e36803ff0f..a4bc6be307 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -47,7 +47,7 @@ * * |[<!-- language="C" --> * // connect our handler which will popup the menu - * gesture = gtk_gesture_multi_press_new (window); + * gesture = gtk_gesture_click_new (window); * gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), * GDK_BUTTON_SECONDARY); * g_signal_connect (gesture, "begin", G_CALLBACK (my_popup_handler), menu); @@ -281,12 +281,12 @@ static void gtk_menu_measure (GtkWidget *widget, int *natural, int *minimum_baseline, int *natural_baseline); -static void gtk_menu_pressed_cb (GtkGestureMultiPress *gesture, +static void gtk_menu_pressed_cb (GtkGestureClick *gesture, int n_press, double x, double y, gpointer user_data); -static void gtk_menu_released_cb (GtkGestureMultiPress *gesture, +static void gtk_menu_released_cb (GtkGestureClick *gesture, int n_press, double x, double y, @@ -942,7 +942,7 @@ gtk_menu_init (GtkMenu *menu) gtk_widget_set_parent (priv->bottom_arrow_widget, GTK_WIDGET (menu)); gtk_widget_set_child_visible (priv->bottom_arrow_widget, FALSE); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); @@ -2621,7 +2621,7 @@ pointer_in_menu_surface (GtkWidget *widget, static void -gtk_menu_pressed_cb (GtkGestureMultiPress *gesture, +gtk_menu_pressed_cb (GtkGestureClick *gesture, int n_press, double x, double y, @@ -2660,11 +2660,11 @@ gtk_menu_pressed_cb (GtkGestureMultiPress *gesture, } static void -gtk_menu_released_cb (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_menu_released_cb (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkMenu *menu = user_data; GtkMenuPrivate *priv = menu->priv; diff --git a/gtk/gtkmenuprivate.h b/gtk/gtkmenuprivate.h index c8a029a28c..224ffe53b1 100644 --- a/gtk/gtkmenuprivate.h +++ b/gtk/gtkmenuprivate.h @@ -27,7 +27,7 @@ #include <gtk/gtkmenu.h> #include <gtk/gtkcssnodeprivate.h> -#include <gtk/gtkgesturemultipress.h> +#include <gtk/gtkgestureclick.h> G_BEGIN_DECLS diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index a543c37ac8..d141c13f42 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -76,7 +76,7 @@ #include "gtkwindow.h" #include "gtkwindowprivate.h" #include "gtkeventcontrollerkey.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "a11y/gtkmenushellaccessible.h" @@ -119,17 +119,17 @@ static gboolean gtk_menu_shell_key_press (GtkEventControllerKey *key, GdkModifierType modifiers, GtkWidget *widget); static void gtk_menu_shell_root (GtkWidget *widget); -static void multi_press_pressed (GtkGestureMultiPress *gesture, +static void click_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, GtkMenuShell *menu_shell); -static void multi_press_released (GtkGestureMultiPress *gesture, +static void click_released (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, GtkMenuShell *menu_shell); -static void multi_press_stopped (GtkGestureMultiPress *gesture, +static void click_stopped (GtkGestureClick *gesture, GtkMenuShell *menu_shell); @@ -428,15 +428,15 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell) G_CALLBACK (gtk_menu_shell_key_press), widget); gtk_widget_add_controller (widget, controller); - controller = GTK_EVENT_CONTROLLER (gtk_gesture_multi_press_new ()); + controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ()); gtk_event_controller_set_propagation_limit (controller, GTK_LIMIT_NONE); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (controller), 0); g_signal_connect (controller, "pressed", - G_CALLBACK (multi_press_pressed), menu_shell); + G_CALLBACK (click_pressed), menu_shell); g_signal_connect (controller, "released", - G_CALLBACK (multi_press_released), menu_shell); + G_CALLBACK (click_released), menu_shell); g_signal_connect (controller, "stopped", - G_CALLBACK (multi_press_stopped), menu_shell); + G_CALLBACK (click_stopped), menu_shell); gtk_widget_add_controller (widget, controller); } @@ -622,7 +622,7 @@ gtk_menu_shell_get_toplevel_shell (GtkMenuShell *menu_shell) } static void -multi_press_stopped (GtkGestureMultiPress *gesture, +click_stopped (GtkGestureClick *gesture, GtkMenuShell *menu_shell) { GtkMenuShellPrivate *priv = menu_shell->priv; @@ -647,11 +647,11 @@ multi_press_stopped (GtkGestureMultiPress *gesture, } static void -multi_press_pressed (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkMenuShell *menu_shell) +click_pressed (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkMenuShell *menu_shell) { GtkMenuShellPrivate *priv = menu_shell->priv; GtkWidget *menu_item; @@ -723,11 +723,11 @@ multi_press_pressed (GtkGestureMultiPress *gesture, } static void -multi_press_released (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkMenuShell *menu_shell) +click_released (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkMenuShell *menu_shell) { GtkMenuShellPrivate *priv = menu_shell->priv; GtkMenuShell *parent_shell = GTK_MENU_SHELL (priv->parent_menu_shell); diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c index f1bf119437..3561bd2762 100644 --- a/gtk/gtkmountoperation.c +++ b/gtk/gtkmountoperation.c @@ -52,7 +52,7 @@ #include "gtksettings.h" #include "gtkstylecontextprivate.h" #include "gtkdialogprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include <glib/gprintf.h> @@ -1342,7 +1342,7 @@ on_popup_menu_for_process_tree_view (GtkWidget *widget, } static void -multi_press_cb (GtkGesture *gesture, +click_cb (GtkGesture *gesture, int n_press, double x, double y, @@ -1470,10 +1470,10 @@ create_show_processes_dialog (GtkMountOperation *op, G_CALLBACK (on_popup_menu_for_process_tree_view), op); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY); g_signal_connect (gesture, "pressed", - G_CALLBACK (multi_press_cb), op); + G_CALLBACK (click_cb), op); gtk_widget_add_controller (tree_view, GTK_EVENT_CONTROLLER (gesture)); list_store = gtk_list_store_new (3, diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index e29448aaf0..a426dc931f 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -35,7 +35,7 @@ #include "gtkdnd.h" #include "gtkdragdest.h" #include "gtkeventcontrollermotion.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgizmoprivate.h" #include "gtkiconprivate.h" #include "gtkintl.h" @@ -844,12 +844,12 @@ static void gtk_notebook_buildable_add_child (GtkBuildable *buildable, GObject *child, const gchar *type); -static void gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture, +static void gtk_notebook_gesture_pressed (GtkGestureClick *gesture, int n_press, double x, double y, gpointer user_data); -static void gtk_notebook_gesture_released (GtkGestureMultiPress *gesture, +static void gtk_notebook_gesture_released (GtkGestureClick *gesture, int n_press, double x, double y, @@ -1356,7 +1356,7 @@ gtk_notebook_init (GtkNotebook *notebook) gtk_widget_set_vexpand (priv->stack_widget, TRUE); gtk_container_add (GTK_CONTAINER (priv->box), priv->stack_widget); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_CAPTURE); g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_notebook_gesture_pressed), notebook); @@ -2488,7 +2488,7 @@ get_tab_at_pos (GtkNotebook *notebook, } static void -gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture, +gtk_notebook_gesture_pressed (GtkGestureClick *gesture, int n_press, double x, double y, @@ -2779,11 +2779,11 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook) } static void -gtk_notebook_gesture_released (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_notebook_gesture_released (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkNotebook *notebook = user_data; GtkNotebookPrivate *priv = notebook->priv; diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c index cc74bc167e..ddf31467ba 100644 --- a/gtk/gtkpasswordentry.c +++ b/gtk/gtkpasswordentry.c @@ -26,7 +26,7 @@ #include "gtkbindings.h" #include "gtktextprivate.h" #include "gtkeditable.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkbox.h" #include "gtkimage.h" #include "gtkcheckmenuitem.h" @@ -475,7 +475,7 @@ gtk_password_entry_set_show_peek_icon (GtkPasswordEntry *entry, gtk_widget_set_tooltip_text (priv->peek_icon, _("Show text")); gtk_widget_set_parent (priv->peek_icon, GTK_WIDGET (entry)); - press = gtk_gesture_multi_press_new (); + press = gtk_gesture_click_new (); g_signal_connect_swapped (press, "released", G_CALLBACK (gtk_password_entry_toggle_peek), entry); gtk_widget_add_controller (priv->peek_icon, GTK_EVENT_CONTROLLER (press)); diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 3ba8bbcd02..ddddbe0f49 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -62,7 +62,7 @@ #include "gtkmodelbutton.h" #include "gtkprivate.h" #include "gtkeventcontrollerkey.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturedrag.h" #include "gtknative.h" @@ -286,12 +286,12 @@ static void check_unmount_and_eject (GMount *mount, GDrive *drive, gboolean *show_unmount, gboolean *show_eject); -static void on_row_pressed (GtkGestureMultiPress *gesture, +static void on_row_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, GtkSidebarRow *row); -static void on_row_released (GtkGestureMultiPress *gesture, +static void on_row_released (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, @@ -511,7 +511,7 @@ add_place (GtkPlacesSidebar *sidebar, g_signal_connect_swapped (eject_button, "clicked", G_CALLBACK (eject_or_unmount_bookmark), row); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); g_signal_connect (gesture, "pressed", G_CALLBACK (on_row_pressed), row); @@ -3731,11 +3731,11 @@ on_row_activated (GtkListBox *list_box, } static void -on_row_pressed (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkSidebarRow *row) +on_row_pressed (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkSidebarRow *row) { GtkPlacesSidebar *sidebar; GtkPlacesSidebarSectionType section_type; @@ -3758,11 +3758,11 @@ on_row_pressed (GtkGestureMultiPress *gesture, } static void -on_row_released (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkSidebarRow *row) +on_row_released (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkSidebarRow *row) { GtkPlacesSidebar *sidebar; GtkPlacesSidebarSectionType section_type; diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 13c384ac5b..0748a43a46 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -32,7 +32,7 @@ #include "gtkeventcontrollerscroll.h" #include "gtkgesturedrag.h" #include "gtkgesturelongpressprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgizmoprivate.h" #include "gtkintl.h" #include "gtkmarshalers.h" @@ -162,12 +162,12 @@ static void gtk_range_size_allocate (GtkWidget *widget, int baseline); static void gtk_range_unmap (GtkWidget *widget); -static void gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +static void gtk_range_click_gesture_pressed (GtkGestureClick *gesture, guint n_press, gdouble x, gdouble y, GtkRange *range); -static void gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture, +static void gtk_range_click_gesture_released (GtkGestureClick *gesture, guint n_press, gdouble x, gdouble y, @@ -558,7 +558,7 @@ gtk_range_init (GtkRange *range) /* Note: Order is important here. * The ::drag-begin handler relies on the state set up by the - * multipress ::pressed handler. Gestures are handling events + * click ::pressed handler. Gestures are handling events * in the oppposite order in which they are added to their * widget. */ @@ -570,12 +570,12 @@ gtk_range_init (GtkRange *range) G_CALLBACK (gtk_range_drag_gesture_update), range); gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (priv->drag_gesture)); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); g_signal_connect (gesture, "pressed", - G_CALLBACK (gtk_range_multipress_gesture_pressed), range); + G_CALLBACK (gtk_range_click_gesture_pressed), range); g_signal_connect (gesture, "released", - G_CALLBACK (gtk_range_multipress_gesture_released), range); + G_CALLBACK (gtk_range_click_gesture_released), range); gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (gesture)); gtk_gesture_group (priv->drag_gesture, gesture); @@ -1874,11 +1874,11 @@ gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture, } static void -gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkRange *range) +gtk_range_click_gesture_pressed (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkRange *range) { GtkWidget *widget = GTK_WIDGET (range); GtkRangePrivate *priv = gtk_range_get_instance_private (range); @@ -2006,11 +2006,11 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture, } static void -gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture, - guint n_press, - gdouble x, - gdouble y, - GtkRange *range) +gtk_range_click_gesture_released (GtkGestureClick *gesture, + guint n_press, + gdouble x, + gdouble y, + GtkRange *range) { GtkRangePrivate *priv = gtk_range_get_instance_private (range); diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c index c3d86ad8f5..31319cf06e 100644 --- a/gtk/gtksearchentry.c +++ b/gtk/gtksearchentry.c @@ -33,7 +33,7 @@ #include "gtkbindings.h" #include "gtkeditable.h" #include "gtkbox.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtktextprivate.h" #include "gtkimage.h" #include "gtkintl.h" @@ -491,11 +491,11 @@ gtk_search_entry_editable_init (GtkEditableInterface *iface) } static void -gtk_search_entry_icon_release (GtkGestureMultiPress *press, - int n_press, - double x, - double y, - GtkSearchEntry *entry) +gtk_search_entry_icon_release (GtkGestureClick *press, + int n_press, + double x, + double y, + GtkSearchEntry *entry) { GtkSearchEntryPrivate *priv = gtk_search_entry_get_instance_private (entry); @@ -595,7 +595,7 @@ gtk_search_entry_init (GtkSearchEntry *entry) gtk_widget_set_parent (priv->icon, GTK_WIDGET (entry)); gtk_widget_set_child_visible (priv->icon, FALSE); - press = gtk_gesture_multi_press_new (); + press = gtk_gesture_click_new (); g_signal_connect (press, "released", G_CALLBACK (gtk_search_entry_icon_release), entry); gtk_widget_add_controller (priv->icon, GTK_EVENT_CONTROLLER (press)); diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 427552c6e9..e4ddfaecb6 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -40,7 +40,7 @@ #include "gtkeventcontrollerkey.h" #include "gtkeventcontrollermotion.h" #include "gtkeventcontrollerscroll.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgestureswipe.h" #include "gtkicontheme.h" #include "gtkintl.h" @@ -773,11 +773,11 @@ start_spinning (GtkSpinButton *spin, } static void -button_pressed_cb (GtkGestureMultiPress *gesture, - int n_pressses, - double x, - double y, - gpointer user_data) +button_pressed_cb (GtkGestureClick *gesture, + int n_pressses, + double x, + double y, + gpointer user_data) { GtkSpinButton *spin_button = user_data; GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button); @@ -802,11 +802,11 @@ button_pressed_cb (GtkGestureMultiPress *gesture, } static void -button_released_cb (GtkGestureMultiPress *gesture, - int n_pressses, - double x, - double y, - gpointer user_data) +button_released_cb (GtkGestureClick *gesture, + int n_pressses, + double x, + double y, + gpointer user_data) { GtkSpinButton *spin_button = user_data; GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button); @@ -909,7 +909,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) gtk_style_context_add_class (gtk_widget_get_style_context (priv->down_button), "down"); gtk_container_add (GTK_CONTAINER (priv->box), priv->down_button); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), @@ -926,7 +926,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) gtk_style_context_add_class (gtk_widget_get_style_context (priv->up_button), "up"); gtk_container_add (GTK_CONTAINER (priv->box), priv->up_button); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index 09f6d235d2..1d3dce8106 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -55,7 +55,7 @@ #include "gtkactionable.h" #include "gtkactionhelperprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturepan.h" #include "gtkgesturesingle.h" #include "gtkgizmoprivate.h" @@ -81,7 +81,7 @@ struct _GtkSwitchPrivate GtkActionHelper *action_helper; GtkGesture *pan_gesture; - GtkGesture *multipress_gesture; + GtkGesture *click_gesture; double handle_pos; guint tick_id; @@ -206,11 +206,11 @@ gtk_switch_begin_toggle_animation (GtkSwitch *sw) } static void -gtk_switch_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkSwitch *sw) +gtk_switch_click_gesture_pressed (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkSwitch *sw) { GtkSwitchPrivate *priv = gtk_switch_get_instance_private (sw); graphene_rect_t switch_bounds; @@ -229,11 +229,11 @@ gtk_switch_multipress_gesture_pressed (GtkGestureMultiPress *gesture, } static void -gtk_switch_multipress_gesture_released (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkSwitch *sw) +gtk_switch_click_gesture_released (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkSwitch *sw) { GdkEventSequence *sequence; @@ -291,7 +291,7 @@ gtk_switch_pan_gesture_drag_end (GtkGestureDrag *gesture, */ active = priv->handle_pos >= 0.5; } - else if (!gtk_gesture_handles_sequence (priv->multipress_gesture, sequence)) + else if (!gtk_gesture_handles_sequence (priv->click_gesture, sequence)) active = priv->is_active; else return; @@ -639,17 +639,17 @@ gtk_switch_init (GtkSwitch *self) gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (gesture), TRUE); g_signal_connect (gesture, "pressed", - G_CALLBACK (gtk_switch_multipress_gesture_pressed), self); + G_CALLBACK (gtk_switch_click_gesture_pressed), self); g_signal_connect (gesture, "released", - G_CALLBACK (gtk_switch_multipress_gesture_released), self); + G_CALLBACK (gtk_switch_click_gesture_released), self); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture)); - priv->multipress_gesture = gesture; + priv->click_gesture = gesture; gesture = gtk_gesture_pan_new (GTK_ORIENTATION_HORIZONTAL); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); diff --git a/gtk/gtktext.c b/gtk/gtktext.c index ec2c38fe98..ecff9f69da 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -38,7 +38,7 @@ #include "gtkeventcontrollerkey.h" #include "gtkeventcontrollermotion.h" #include "gtkgesturedrag.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturesingle.h" #include "gtkimageprivate.h" #include "gtkimcontextsimple.h" @@ -443,7 +443,7 @@ static void gtk_text_motion_controller_motion (GtkEventControllerMotion *c double x, double y, GtkText *self); -static void gtk_text_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +static void gtk_text_click_gesture_pressed (GtkGestureClick *gesture, int n_press, double x, double y, @@ -1709,9 +1709,9 @@ gtk_text_init (GtkText *self) gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->drag_gesture), TRUE); gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (priv->drag_gesture)); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); g_signal_connect (gesture, "pressed", - G_CALLBACK (gtk_text_multipress_gesture_pressed), self); + G_CALLBACK (gtk_text_click_gesture_pressed), self); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (gesture), TRUE); gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture)); @@ -2449,11 +2449,11 @@ gesture_get_current_point_in_layout (GtkGestureSingle *gesture, } static void -gtk_text_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - int n_press, - double widget_x, - double widget_y, - GtkText *self) +gtk_text_click_gesture_pressed (GtkGestureClick *gesture, + int n_press, + double widget_x, + double widget_y, + GtkText *self) { GtkWidget *widget = GTK_WIDGET (self); GtkTextPrivate *priv = gtk_text_get_instance_private (self); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 6ce040676f..a824dc80d6 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -378,7 +378,7 @@ static void gtk_text_view_direction_changed (GtkWidget *widget, static void gtk_text_view_state_flags_changed (GtkWidget *widget, GtkStateFlags previous_state); -static void gtk_text_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +static void gtk_text_view_click_gesture_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, @@ -1669,10 +1669,10 @@ gtk_text_view_init (GtkTextView *text_view) priv->text_window = text_window_new (GTK_TEXT_WINDOW_TEXT, widget); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); g_signal_connect (gesture, "pressed", - G_CALLBACK (gtk_text_view_multipress_gesture_pressed), + G_CALLBACK (gtk_text_view_click_gesture_pressed), widget); gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture)); @@ -5075,11 +5075,11 @@ get_iter_from_gesture (GtkTextView *text_view, } static void -gtk_text_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkTextView *text_view) +gtk_text_view_click_gesture_pressed (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkTextView *text_view) { GdkEventSequence *sequence; GtkTextViewPrivate *priv; diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 5d031475ea..5c2574fde8 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -58,7 +58,7 @@ #include "gtkwidgetpath.h" #include "gtkwidgetprivate.h" #include "gtkwindowprivate.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkbuttonprivate.h" @@ -245,7 +245,7 @@ static void gtk_toolbar_measure (GtkWidget *widget, int *natural, int *minimum_baseline, int *natural_baseline); -static void gtk_toolbar_pressed_cb (GtkGestureMultiPress *gesture, +static void gtk_toolbar_pressed_cb (GtkGestureClick *gesture, int n_press, double x, double y, @@ -575,7 +575,7 @@ gtk_toolbar_init (GtkToolbar *toolbar) priv->timer = g_timer_new (); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); @@ -2206,11 +2206,11 @@ gtk_toolbar_arrow_button_press (GtkGesture *gesture, static void -gtk_toolbar_pressed_cb (GtkGestureMultiPress *gesture, - int n_press, - double x, - double y, - gpointer user_data) +gtk_toolbar_pressed_cb (GtkGestureClick *gesture, + int n_press, + double x, + double y, + gpointer user_data) { GtkToolbar *toolbar = user_data; GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 96fbaa811b..a942cef29b 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -40,7 +40,7 @@ #include "gtkeventcontrollerscroll.h" #include "gtkframe.h" #include "gtkgesturedrag.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgesturesingle.h" #include "gtkintl.h" #include "gtklabel.h" @@ -503,7 +503,7 @@ struct _GtkTreeViewPrivate GDestroyNotify row_separator_destroy; /* Gestures */ - GtkGesture *multipress_gesture; + GtkGesture *click_gesture; GtkGesture *drag_gesture; /* Rubberbanding, row DnD */ GtkGesture *column_drag_gesture; /* Column reordering, resizing */ @@ -927,18 +927,18 @@ static void remove_scroll_timeout (GtkTreeView *tree_view); static void grab_focus_and_unset_draw_keyfocus (GtkTreeView *tree_view); /* Gestures */ -static void gtk_tree_view_column_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +static void gtk_tree_view_column_click_gesture_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, GtkTreeView *tree_view); -static void gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +static void gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, GtkTreeView *tree_view); -static void gtk_tree_view_multipress_gesture_released (GtkGestureMultiPress *gesture, +static void gtk_tree_view_click_gesture_released (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, @@ -1763,17 +1763,17 @@ gtk_tree_view_init (GtkTreeView *tree_view) gtk_css_node_set_state (priv->header_node, gtk_css_node_get_state (widget_node)); g_object_unref (priv->header_node); - priv->multipress_gesture = gtk_gesture_multi_press_new (); - gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0); - g_signal_connect (priv->multipress_gesture, "pressed", - G_CALLBACK (gtk_tree_view_multipress_gesture_pressed), tree_view); - g_signal_connect (priv->multipress_gesture, "released", - G_CALLBACK (gtk_tree_view_multipress_gesture_released), tree_view); - gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (priv->multipress_gesture)); + priv->click_gesture = gtk_gesture_click_new (); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->click_gesture), 0); + g_signal_connect (priv->click_gesture, "pressed", + G_CALLBACK (gtk_tree_view_click_gesture_pressed), tree_view); + g_signal_connect (priv->click_gesture, "released", + G_CALLBACK (gtk_tree_view_click_gesture_released), tree_view); + gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (priv->click_gesture)); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); g_signal_connect (gesture, "pressed", - G_CALLBACK (gtk_tree_view_column_multipress_gesture_pressed), tree_view); + G_CALLBACK (gtk_tree_view_column_click_gesture_pressed), tree_view); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_CAPTURE); gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (gesture)); @@ -2796,7 +2796,7 @@ get_current_selection_modifiers (GtkWidget *widget, } static void -gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, @@ -3098,7 +3098,7 @@ gtk_tree_view_drag_gesture_begin (GtkGestureDrag *gesture, } static void -gtk_tree_view_column_multipress_gesture_pressed (GtkGestureMultiPress *gesture, +gtk_tree_view_column_click_gesture_pressed (GtkGestureClick *gesture, gint n_press, gdouble x, gdouble y, @@ -3298,11 +3298,11 @@ gtk_tree_view_drag_gesture_end (GtkGestureDrag *gesture, } static void -gtk_tree_view_multipress_gesture_released (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkTreeView *tree_view) +gtk_tree_view_click_gesture_released (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkTreeView *tree_view) { gboolean modify, extend; guint button; @@ -4157,7 +4157,7 @@ gtk_tree_view_motion_controller_motion (GtkEventControllerMotion *controller, /* If we are currently pressing down a button, we don't want to prelight anything else. */ if (gtk_gesture_is_active (tree_view->priv->drag_gesture) || - gtk_gesture_is_active (tree_view->priv->multipress_gesture)) + gtk_gesture_is_active (tree_view->priv->click_gesture)) node = NULL; gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, @@ -7043,8 +7043,8 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view) button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (tree_view->priv->drag_gesture)); - /* Deny the multipress gesture */ - gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->multipress_gesture), + /* Deny the click gesture */ + gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->click_gesture), GTK_EVENT_SEQUENCE_DENIED); gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, @@ -10174,7 +10174,7 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view) tree_view); gtk_widget_add_controller (tree_view->priv->search_window, controller); - gesture = gtk_gesture_multi_press_new (); + gesture = gtk_gesture_click_new (); g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_tree_view_search_pressed_cb), tree_view); gtk_widget_add_controller (tree_view->priv->search_window, GTK_EVENT_CONTROLLER (gesture)); @@ -11783,7 +11783,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, selection_changed = gtk_tree_view_unref_and_check_selection_tree (tree_view, node->children); /* Stop a pending double click */ - gtk_event_controller_reset (GTK_EVENT_CONTROLLER (tree_view->priv->multipress_gesture)); + gtk_event_controller_reset (GTK_EVENT_CONTROLLER (tree_view->priv->click_gesture)); _gtk_tree_view_accessible_remove (tree_view, node->children, NULL); _gtk_tree_view_accessible_remove_state (tree_view, diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index eae7baaec0..fffa1bcdc3 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -45,7 +45,7 @@ #include "gtkeventcontrollerkey.h" #include "gtkeventcontrollermotion.h" #include "gtkgesturedrag.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkgestureprivate.h" #include "gtkheaderbarprivate.h" #include "gtkicontheme.h" @@ -271,7 +271,7 @@ typedef struct GdkSurfaceTypeHint type_hint; - GtkGesture *multipress_gesture; + GtkGesture *click_gesture; GtkGesture *drag_gesture; GtkGesture *bubble_drag_gesture; GtkEventController *key_controller; @@ -1361,11 +1361,11 @@ gtk_window_titlebar_action (GtkWindow *window, } static void -multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, - gint n_press, - gdouble x, - gdouble y, - GtkWindow *window) +click_gesture_pressed_cb (GtkGestureClick *gesture, + gint n_press, + gdouble x, + gdouble y, + GtkWindow *window) { GtkWindowPrivate *priv = gtk_window_get_instance_private (window); GtkWidget *event_widget, *widget; @@ -1576,7 +1576,7 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, gtk_get_current_event_time ()); gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture)); - gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->multipress_gesture)); + gtk_event_controller_reset (GTK_EVENT_CONTROLLER (priv->click_gesture)); } } @@ -1938,13 +1938,13 @@ gtk_window_constructed (GObject *object) if (priv->type == GTK_WINDOW_TOPLEVEL) { - priv->multipress_gesture = gtk_gesture_multi_press_new (); - gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0); - gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->multipress_gesture), + priv->click_gesture = gtk_gesture_click_new (); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->click_gesture), 0); + gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->click_gesture), GTK_PHASE_BUBBLE); - g_signal_connect (priv->multipress_gesture, "pressed", - G_CALLBACK (multipress_gesture_pressed_cb), object); - gtk_widget_add_controller (GTK_WIDGET (object), GTK_EVENT_CONTROLLER (priv->multipress_gesture)); + g_signal_connect (priv->click_gesture, "pressed", + G_CALLBACK (click_gesture_pressed_cb), object); + gtk_widget_add_controller (GTK_WIDGET (object), GTK_EVENT_CONTROLLER (priv->click_gesture)); priv->drag_gesture = create_drag_gesture (window); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->drag_gesture), diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c index 6fe5c74fc0..abb88f07bb 100644 --- a/gtk/inspector/inspect-button.c +++ b/gtk/inspector/inspect-button.c @@ -32,7 +32,6 @@ #include "gtkstack.h" #include "gtkmain.h" #include "gtkwidgetprivate.h" -#include "gtkgesturemultipress.h" #include "gtkeventcontrollermotion.h" #include "gtkeventcontrollerkey.h" #include "gtknative.h" diff --git a/gtk/inspector/prop-list.c b/gtk/inspector/prop-list.c index 0e0236c0eb..69282bd7ce 100644 --- a/gtk/inspector/prop-list.c +++ b/gtk/inspector/prop-list.c @@ -42,7 +42,7 @@ #include "gtklistbox.h" #include "gtksizegroup.h" #include "gtkroot.h" -#include "gtkgesturemultipress.h" +#include "gtkgestureclick.h" #include "gtkstylecontext.h" enum @@ -124,7 +124,7 @@ apply_sort (GtkInspectorPropList *pl, } static void -sort_changed (GtkGestureMultiPress *gesture, +sort_changed (GtkGestureClick *gesture, int n_press, double x, double y, diff --git a/gtk/inspector/prop-list.ui b/gtk/inspector/prop-list.ui index 290bf15bd4..f1898cf5b5 100644 --- a/gtk/inspector/prop-list.ui +++ b/gtk/inspector/prop-list.ui @@ -17,7 +17,7 @@ <object class="GtkBox" id="name_heading"> <property name="hexpand">0</property> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <signal name="pressed" handler="sort_changed" swapped="no"/> </object> @@ -48,7 +48,7 @@ <object class="GtkBox" id="origin_heading"> <property name="hexpand">0</property> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <signal name="pressed" handler="sort_changed" swapped="no"/> </object> diff --git a/gtk/meson.build b/gtk/meson.build index bfb72d0db4..5001ca8a12 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -238,7 +238,7 @@ gtk_public_sources = files([ 'gtkgesture.c', 'gtkgesturedrag.c', 'gtkgesturelongpress.c', - 'gtkgesturemultipress.c', + 'gtkgestureclick.c', 'gtkgesturepan.c', 'gtkgesturerotate.c', 'gtkgesturesingle.c', @@ -496,7 +496,7 @@ gtk_public_headers = files([ 'gtkgesture.h', 'gtkgesturedrag.h', 'gtkgesturelongpress.h', - 'gtkgesturemultipress.h', + 'gtkgestureclick.h', 'gtkgesturepan.h', 'gtkgesturerotate.h', 'gtkgesturesingle.h', diff --git a/gtk/ui/gtkaboutdialog.ui b/gtk/ui/gtkaboutdialog.ui index c457a4ebd5..f4eda2ed10 100644 --- a/gtk/ui/gtkaboutdialog.ui +++ b/gtk/ui/gtkaboutdialog.ui @@ -166,7 +166,7 @@ <property name="right-margin">8</property> <property name="cursor-visible">0</property> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <signal name="released" handler="text_view_released" swapped="no"/> </object> </child> @@ -209,7 +209,7 @@ <property name="right-margin">8</property> <property name="cursor-visible">0</property> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <signal name="released" handler="text_view_released" swapped="no"/> </object> </child> diff --git a/gtk/ui/gtkemojichooser.ui b/gtk/ui/gtkemojichooser.ui index e32d977526..aab6676082 100644 --- a/gtk/ui/gtkemojichooser.ui +++ b/gtk/ui/gtkemojichooser.ui @@ -45,7 +45,7 @@ </object> </child> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <property name="button">3</property> <signal name="pressed" handler="pressed_cb"/> </object> @@ -69,7 +69,7 @@ </object> </child> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <property name="button">3</property> <signal name="pressed" handler="pressed_cb"/> </object> @@ -93,7 +93,7 @@ </object> </child> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <property name="button">3</property> <signal name="pressed" handler="pressed_cb"/> </object> diff --git a/gtk/ui/gtkfilechooserwidget.ui b/gtk/ui/gtkfilechooserwidget.ui index 2282ee9365..07c64ffd4f 100644 --- a/gtk/ui/gtkfilechooserwidget.ui +++ b/gtk/ui/gtkfilechooserwidget.ui @@ -146,9 +146,9 @@ </object> </child> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <property name="button">3</property> - <signal name="pressed" handler="multi_press_cb" swapped="no"/> + <signal name="pressed" handler="click_cb" swapped="no"/> </object> </child> <child> diff --git a/gtk/ui/gtkplacesviewrow.ui b/gtk/ui/gtkplacesviewrow.ui index e9f9e8908a..31b1473c8d 100644 --- a/gtk/ui/gtkplacesviewrow.ui +++ b/gtk/ui/gtkplacesviewrow.ui @@ -82,7 +82,7 @@ </object> </child> <child> - <object class="GtkGestureMultiPress"> + <object class="GtkGestureClick"> <property name="button">3</property> <signal name="pressed" handler="pressed_cb" swapped="no"/> </object> |