Merge branch 'gesture-click' into 'master'

Rename GtkGestureMultiPress to GtkGestureClick

See merge request GNOME/gtk!878
This commit is contained in:
Matthias Clasen 2019-05-29 18:39:09 +00:00
commit 90f330e27a
69 changed files with 684 additions and 673 deletions

View File

@ -80,11 +80,11 @@ find_toplevel_at_pointer (GdkDisplay *display)
} }
static void static void
released_cb (GtkGestureMultiPress *gesture, released_cb (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
gboolean *clicked) gboolean *clicked)
{ {
*clicked = TRUE; *clicked = TRUE;
} }
@ -123,7 +123,7 @@ query_for_toplevel (GdkDisplay *display,
GDK_SEAT_CAPABILITY_ALL_POINTING, GDK_SEAT_CAPABILITY_ALL_POINTING,
FALSE, cursor, NULL, NULL, NULL) == GDK_GRAB_SUCCESS) FALSE, cursor, NULL, NULL, NULL) == GDK_GRAB_SUCCESS)
{ {
GtkGesture *gesture = gtk_gesture_multi_press_new (); GtkGesture *gesture = gtk_gesture_click_new ();
gboolean clicked = FALSE; gboolean clicked = FALSE;
g_signal_connect (gesture, "released", g_signal_connect (gesture, "released",

View File

@ -319,7 +319,7 @@ do_clipboard (GtkWidget *do_widget)
G_CALLBACK (drag_data_received), image); G_CALLBACK (drag_data_received), image);
/* context menu on image */ /* context menu on image */
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image); g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
@ -344,7 +344,7 @@ do_clipboard (GtkWidget *do_widget)
G_CALLBACK (drag_data_received), image); G_CALLBACK (drag_data_received), image);
/* context menu on image */ /* context menu on image */
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image); g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));

View File

@ -250,11 +250,11 @@ static guint signals[LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DemoTaggedEntryTag, demo_tagged_entry_tag, GTK_TYPE_WIDGET) G_DEFINE_TYPE (DemoTaggedEntryTag, demo_tagged_entry_tag, GTK_TYPE_WIDGET)
static void static void
on_released (GtkGestureMultiPress *gesture, on_released (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
DemoTaggedEntryTag *tag) DemoTaggedEntryTag *tag)
{ {
g_signal_emit (tag, signals[SIGNAL_CLICKED], 0); g_signal_emit (tag, signals[SIGNAL_CLICKED], 0);
} }
@ -270,7 +270,7 @@ demo_tagged_entry_tag_init (DemoTaggedEntryTag *tag)
tag->label = gtk_label_new (""); tag->label = gtk_label_new ("");
gtk_container_add (GTK_CONTAINER (tag->box), tag->label); gtk_container_add (GTK_CONTAINER (tag->box), tag->label);
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
g_signal_connect (gesture, "released", G_CALLBACK (on_released), tag); g_signal_connect (gesture, "released", G_CALLBACK (on_released), tag);
gtk_widget_add_controller (GTK_WIDGET (tag), GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (GTK_WIDGET (tag), GTK_EVENT_CONTROLLER (gesture));

View File

@ -356,7 +356,7 @@ do_dnd (GtkWidget *do_widget)
gtk_widget_set_hexpand (fixed, TRUE); gtk_widget_set_hexpand (fixed, TRUE);
gtk_widget_set_vexpand (fixed, TRUE); gtk_widget_set_vexpand (fixed, TRUE);
multipress = gtk_gesture_multi_press_new (); multipress = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (multipress), 0); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (multipress), 0);
g_signal_connect (multipress, "pressed", G_CALLBACK (pressed_cb), NULL); g_signal_connect (multipress, "pressed", G_CALLBACK (pressed_cb), NULL);
g_signal_connect (multipress, "released", G_CALLBACK (released_cb), NULL); g_signal_connect (multipress, "released", G_CALLBACK (released_cb), NULL);

View File

@ -136,11 +136,11 @@ static void set_cursor_if_appropriate (GtkTextView *text_view,
gint y); gint y);
static void static void
released_cb (GtkGestureMultiPress *gesture, released_cb (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkWidget *text_view) GtkWidget *text_view)
{ {
GtkTextIter start, end, iter; GtkTextIter start, end, iter;
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
@ -247,7 +247,7 @@ do_hypertext (GtkWidget *do_widget)
g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), view); g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), view);
gtk_widget_add_controller (view, controller); gtk_widget_add_controller (view, controller);
controller = GTK_EVENT_CONTROLLER (gtk_gesture_multi_press_new ()); controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ());
g_signal_connect (controller, "released", g_signal_connect (controller, "released",
G_CALLBACK (released_cb), view); G_CALLBACK (released_cb), view);
gtk_widget_add_controller (view, controller); gtk_widget_add_controller (view, controller);

View File

@ -218,11 +218,11 @@ puzzle_key_pressed (GtkEventControllerKey *controller,
} }
static void static void
puzzle_button_pressed (GtkGestureMultiPress *gesture, puzzle_button_pressed (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
GtkWidget *grid) GtkWidget *grid)
{ {
GtkWidget *child; GtkWidget *child;
int l, t, i; int l, t, i;
@ -302,7 +302,7 @@ start_puzzle (GdkPaintable *puzzle)
grid); grid);
gtk_widget_add_controller (GTK_WIDGET (grid), controller); gtk_widget_add_controller (GTK_WIDGET (grid), controller);
controller = GTK_EVENT_CONTROLLER (gtk_gesture_multi_press_new ()); controller = GTK_EVENT_CONTROLLER (gtk_gesture_click_new ());
g_signal_connect (controller, "pressed", g_signal_connect (controller, "pressed",
G_CALLBACK (puzzle_button_pressed), G_CALLBACK (puzzle_button_pressed),
grid); grid);

View File

@ -1284,11 +1284,11 @@ textbuffer_notify_selection (GObject *object, GParamSpec *pspec, GtkWidget *butt
} }
static gboolean static gboolean
osd_frame_pressed (GtkGestureMultiPress *gesture, osd_frame_pressed (GtkGestureClick *gesture,
int press, int press,
double x, double x,
double y, double y,
gpointer data) gpointer data)
{ {
GtkWidget *frame = data; GtkWidget *frame = data;
GtkWidget *osd; GtkWidget *osd;

View File

@ -2962,7 +2962,7 @@ microphone-sensitivity-medium-symbolic</property>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<signal name="pressed" handler="osd_frame_pressed" object="osd_frame" swapped="no"/> <signal name="pressed" handler="osd_frame_pressed" object="osd_frame" swapped="no"/>
</object> </object>
</child> </child>

View File

@ -332,7 +332,7 @@
<xi:include href="xml/gtkgesturesingle.xml" /> <xi:include href="xml/gtkgesturesingle.xml" />
<xi:include href="xml/gtkgesturedrag.xml" /> <xi:include href="xml/gtkgesturedrag.xml" />
<xi:include href="xml/gtkgesturelongpress.xml" /> <xi:include href="xml/gtkgesturelongpress.xml" />
<xi:include href="xml/gtkgesturemultipress.xml" /> <xi:include href="xml/gtkgestureclick.xml" />
<xi:include href="xml/gtkgesturepan.xml" /> <xi:include href="xml/gtkgesturepan.xml" />
<xi:include href="xml/gtkgestureswipe.xml" /> <xi:include href="xml/gtkgestureswipe.xml" />
<xi:include href="xml/gtkgesturerotate.xml" /> <xi:include href="xml/gtkgesturerotate.xml" />

View File

@ -6720,23 +6720,23 @@ gtk_gesture_long_press_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>
<FILE>gtkgesturemultipress</FILE> <FILE>gtkgestureclick</FILE>
<TITLE>GtkGestureMultiPress</TITLE> <TITLE>GtkGestureClick</TITLE>
GtkGestureMultiPress GtkGestureClick
gtk_gesture_multi_press_new gtk_gesture_click_new
gtk_gesture_multi_press_set_area gtk_gesture_click_set_area
gtk_gesture_multi_press_get_area gtk_gesture_click_get_area
<SUBSECTION Standard> <SUBSECTION Standard>
GTK_TYPE_GESTURE_MULTI_PRESS GTK_TYPE_GESTURE_CLICK
GTK_GESTURE_MULTI_PRESS GTK_GESTURE_CLICK
GTK_GESTURE_MULTI_PRESS_CLASS GTK_GESTURE_CLICK_CLASS
GTK_IS_GESTURE_MULTI_PRESS GTK_IS_GESTURE_CLICK
GTK_IS_GESTURE_MULTI_PRESS_CLASS GTK_IS_GESTURE_CLICK_CLASS
GTK_GESTURE_MULTI_PRESS_GET_CLASS GTK_GESTURE_CLICK_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
gtk_gesture_multi_press_get_type gtk_gesture_click_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>

View File

@ -75,9 +75,9 @@ gtk_font_chooser_dialog_get_type
gtk_font_chooser_widget_get_type gtk_font_chooser_widget_get_type
gtk_frame_get_type gtk_frame_get_type
gtk_gesture_get_type gtk_gesture_get_type
gtk_gesture_click_get_type
gtk_gesture_drag_get_type gtk_gesture_drag_get_type
gtk_gesture_long_press_get_type gtk_gesture_long_press_get_type
gtk_gesture_multi_press_get_type
gtk_gesture_pan_get_type gtk_gesture_pan_get_type
gtk_gesture_rotate_get_type gtk_gesture_rotate_get_type
gtk_gesture_single_get_type gtk_gesture_single_get_type

View File

@ -331,6 +331,21 @@
</para> </para>
</section> </section>
<section>
<title>Adapt to event controller API changes</title>
<para>
A few changes to the event controller and #GtkGesture APIs
did not make it back to GTK3, and have to be taken into account
when moving to GTK4. One is that the
#GtkEventControllerMotion::enter,
#GtkEventControllerMotion::leave,
#GtkEventControllerKey::focus-in and
#GtkEventControllerKey::focus-out signals
have gained new arguments. Another is that #GtkGestureMultiPress
has been renamed to #GtkGestureClick.
</para>
</section>
<section> <section>
<title>Stop using GtkEventBox</title> <title>Stop using GtkEventBox</title>
<para> <para>

View File

@ -110,11 +110,11 @@ drag_end (GtkGestureDrag *gesture,
} }
static void static void
pressed (GtkGestureMultiPress *gesture, pressed (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
GtkWidget *area) GtkWidget *area)
{ {
clear_surface (); clear_surface ();
gtk_widget_queue_draw (area); gtk_widget_queue_draw (area);
@ -164,7 +164,7 @@ activate (GtkApplication *app,
g_signal_connect (drag, "drag-update", G_CALLBACK (drag_update), drawing_area); g_signal_connect (drag, "drag-update", G_CALLBACK (drag_update), drawing_area);
g_signal_connect (drag, "drag-end", G_CALLBACK (drag_end), drawing_area); g_signal_connect (drag, "drag-end", G_CALLBACK (drag_end), drawing_area);
press = gtk_gesture_multi_press_new (); press = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (press), GDK_BUTTON_SECONDARY); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (press), GDK_BUTTON_SECONDARY);
gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (press)); gtk_widget_add_controller (drawing_area, GTK_EVENT_CONTROLLER (press));

View File

@ -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(GtkGesture, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureDrag, 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(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(GtkGesturePan, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureRotate, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureRotate, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureSingle, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkGestureSingle, g_object_unref)

View File

@ -119,9 +119,9 @@
#include <gtk/gtkfontchooserwidget.h> #include <gtk/gtkfontchooserwidget.h>
#include <gtk/gtkframe.h> #include <gtk/gtkframe.h>
#include <gtk/gtkgesture.h> #include <gtk/gtkgesture.h>
#include <gtk/gtkgestureclick.h>
#include <gtk/gtkgesturedrag.h> #include <gtk/gtkgesturedrag.h>
#include <gtk/gtkgesturelongpress.h> #include <gtk/gtkgesturelongpress.h>
#include <gtk/gtkgesturemultipress.h>
#include <gtk/gtkgesturepan.h> #include <gtk/gtkgesturepan.h>
#include <gtk/gtkgesturerotate.h> #include <gtk/gtkgesturerotate.h>
#include <gtk/gtkgesturesingle.h> #include <gtk/gtkgesturesingle.h>

View File

@ -60,7 +60,7 @@
#include "gtkdialogprivate.h" #include "gtkdialogprivate.h"
#include "gtkeventcontrollermotion.h" #include "gtkeventcontrollermotion.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
/** /**
@ -260,7 +260,7 @@ static gboolean text_view_key_pressed (GtkEventController
guint keycode, guint keycode,
GdkModifierType state, GdkModifierType state,
GtkAboutDialog *about); GtkAboutDialog *about);
static void text_view_released (GtkGestureMultiPress *press, static void text_view_released (GtkGestureClick *press,
int n, int n,
double x, double x,
double y, double y,
@ -1938,7 +1938,7 @@ text_view_key_pressed (GtkEventController *controller,
} }
static void static void
text_view_released (GtkGestureMultiPress *gesture, text_view_released (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,

View File

@ -37,7 +37,7 @@
#include "gtkorientable.h" #include "gtkorientable.h"
#include "gtkscrolledwindow.h" #include "gtkscrolledwindow.h"
#include "gtklabel.h" #include "gtklabel.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include <string.h> #include <string.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
@ -1213,7 +1213,7 @@ gtk_app_chooser_widget_init (GtkAppChooserWidget *self)
g_signal_connect (priv->monitor, "changed", g_signal_connect (priv->monitor, "changed",
G_CALLBACK (app_info_changed), self); 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); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", g_signal_connect (gesture, "pressed",
G_CALLBACK (gtk_app_chooser_row_pressed_cb), self); G_CALLBACK (gtk_app_chooser_row_pressed_cb), self);

View File

@ -58,7 +58,7 @@
#include "gtkactionhelperprivate.h" #include "gtkactionhelperprivate.h"
#include "gtkcheckbutton.h" #include "gtkcheckbutton.h"
#include "gtkcontainerprivate.h" #include "gtkcontainerprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkimage.h" #include "gtkimage.h"
#include "gtkintl.h" #include "gtkintl.h"
@ -287,11 +287,11 @@ gtk_button_class_init (GtkButtonClass *klass)
} }
static void static void
multipress_pressed_cb (GtkGestureMultiPress *gesture, click_pressed_cb (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkWidget *widget) GtkWidget *widget)
{ {
GtkButton *button = GTK_BUTTON (widget); GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = gtk_button_get_instance_private (button); GtkButtonPrivate *priv = gtk_button_get_instance_private (button);
@ -335,11 +335,11 @@ touch_release_in_button (GtkButton *button)
} }
static void static void
multipress_released_cb (GtkGestureMultiPress *gesture, click_released_cb (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkWidget *widget) GtkWidget *widget)
{ {
GtkButton *button = GTK_BUTTON (widget); GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = gtk_button_get_instance_private (button); GtkButtonPrivate *priv = gtk_button_get_instance_private (button);
@ -357,9 +357,9 @@ multipress_released_cb (GtkGestureMultiPress *gesture,
} }
static void static void
multipress_gesture_cancel_cb (GtkGesture *gesture, click_gesture_cancel_cb (GtkGesture *gesture,
GdkEventSequence *sequence, GdkEventSequence *sequence,
GtkButton *button) GtkButton *button)
{ {
gtk_button_do_release (button, FALSE); gtk_button_do_release (button, FALSE);
} }
@ -419,13 +419,13 @@ gtk_button_init (GtkButton *button)
priv->use_underline = FALSE; priv->use_underline = FALSE;
priv->child_type = WIDGET_CHILD; 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_touch_only (GTK_GESTURE_SINGLE (priv->gesture), FALSE);
gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->gesture), TRUE); gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->gesture), TRUE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->gesture), GDK_BUTTON_PRIMARY); 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, "pressed", G_CALLBACK (click_pressed_cb), button);
g_signal_connect (priv->gesture, "released", G_CALLBACK (multipress_released_cb), button); g_signal_connect (priv->gesture, "released", G_CALLBACK (click_released_cb), button);
g_signal_connect (priv->gesture, "cancel", G_CALLBACK (multipress_gesture_cancel_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_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)); gtk_widget_add_controller (GTK_WIDGET (button), GTK_EVENT_CONTROLLER (priv->gesture));

View File

@ -83,7 +83,7 @@
#include "gtksnapshot.h" #include "gtksnapshot.h"
#include "gtkstylecontextprivate.h" #include "gtkstylecontextprivate.h"
#include "gtkwidgetprivate.h" #include "gtkwidgetprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkeventcontrollerscroll.h" #include "gtkeventcontrollerscroll.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
@ -290,18 +290,18 @@ static void gtk_calendar_size_allocate (GtkWidget *widget,
int width, int width,
int height, int height,
int baseline); int baseline);
static void gtk_calendar_snapshot (GtkWidget *widget, static void gtk_calendar_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot); GtkSnapshot *snapshot);
static void gtk_calendar_button_press (GtkGestureMultiPress *gesture, static void gtk_calendar_button_press (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data); gpointer user_data);
static void gtk_calendar_button_release (GtkGestureMultiPress *gesture, static void gtk_calendar_button_release (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data); gpointer user_data);
static void gtk_calendar_drag_begin (GtkGestureDrag *gesture, static void gtk_calendar_drag_begin (GtkGestureDrag *gesture,
double x, double x,
double y, 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_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (calendar)),
GTK_STYLE_CLASS_VIEW); 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, "pressed", G_CALLBACK (gtk_calendar_button_press), calendar);
g_signal_connect (gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar); g_signal_connect (gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar);
gtk_widget_add_controller (GTK_WIDGET (calendar), GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (GTK_WIDGET (calendar), GTK_EVENT_CONTROLLER (gesture));
@ -2602,11 +2602,11 @@ calendar_main_button_press (GtkCalendar *calendar,
static void static void
gtk_calendar_button_press (GtkGestureMultiPress *gesture, gtk_calendar_button_press (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkCalendar *calendar = user_data; GtkCalendar *calendar = user_data;
GtkWidget *widget = GTK_WIDGET (calendar); GtkWidget *widget = GTK_WIDGET (calendar);
@ -2639,11 +2639,11 @@ gtk_calendar_button_press (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_calendar_button_release (GtkGestureMultiPress *gesture, gtk_calendar_button_release (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkCalendar *calendar = user_data; GtkCalendar *calendar = user_data;
GtkCalendarPrivate *priv = gtk_calendar_get_instance_private (calendar); GtkCalendarPrivate *priv = gtk_calendar_get_instance_private (calendar);

View File

@ -26,7 +26,7 @@
#include "gtkdragdest.h" #include "gtkdragdest.h"
#include "gtkdragsource.h" #include "gtkdragsource.h"
#include "gtkgesturelongpress.h" #include "gtkgesturelongpress.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturesingle.h" #include "gtkgesturesingle.h"
#include "gtkicontheme.h" #include "gtkicontheme.h"
#include "gtkimage.h" #include "gtkimage.h"
@ -324,11 +324,11 @@ hold_action (GtkGestureLongPress *gesture,
} }
static void static void
tap_action (GtkGestureMultiPress *gesture, tap_action (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkColorSwatch *swatch) GtkColorSwatch *swatch)
{ {
GtkColorSwatchPrivate *priv = gtk_color_swatch_get_instance_private (swatch); GtkColorSwatchPrivate *priv = gtk_color_swatch_get_instance_private (swatch);
guint button; guint button;
@ -580,7 +580,7 @@ gtk_color_swatch_init (GtkColorSwatch *swatch)
G_CALLBACK (hold_action), swatch); G_CALLBACK (hold_action), swatch);
gtk_widget_add_controller (GTK_WIDGET (swatch), GTK_EVENT_CONTROLLER (gesture)); 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); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "pressed", g_signal_connect (gesture, "pressed",
G_CALLBACK (tap_action), swatch); G_CALLBACK (tap_action), swatch);

View File

@ -28,7 +28,6 @@
#include "gtkstack.h" #include "gtkstack.h"
#include "gtklabel.h" #include "gtklabel.h"
#include "gtkgesturelongpress.h" #include "gtkgesturelongpress.h"
#include "gtkgesturemultipress.h"
#include "gtkpopover.h" #include "gtkpopover.h"
#include "gtkscrolledwindow.h" #include "gtkscrolledwindow.h"
#include "gtkintl.h" #include "gtkintl.h"

View File

@ -45,7 +45,6 @@
#include "gtkemojicompletion.h" #include "gtkemojicompletion.h"
#include "gtkentrybuffer.h" #include "gtkentrybuffer.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkgesturemultipress.h"
#include "gtkimageprivate.h" #include "gtkimageprivate.h"
#include "gtkimcontextsimple.h" #include "gtkimcontextsimple.h"
#include "gtkintl.h" #include "gtkintl.h"
@ -73,6 +72,7 @@
#include "gtkwidgetprivate.h" #include "gtkwidgetprivate.h"
#include "gtkwindow.h" #include "gtkwindow.h"
#include "gtknative.h" #include "gtknative.h"
#include "gtkgestureclick.h"
#include "a11y/gtkentryaccessible.h" #include "a11y/gtkentryaccessible.h"
@ -1407,7 +1407,7 @@ get_icon_position_from_controller (GtkEntry *entry,
} }
static void static void
icon_pressed_cb (GtkGestureMultiPress *gesture, icon_pressed_cb (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
@ -1427,11 +1427,11 @@ icon_pressed_cb (GtkGestureMultiPress *gesture,
} }
static void static void
icon_released_cb (GtkGestureMultiPress *gesture, icon_released_cb (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkEntry *entry) GtkEntry *entry)
{ {
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry); GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
GtkEntryIconPosition pos; GtkEntryIconPosition pos;
@ -1497,11 +1497,9 @@ construct_icon_info (GtkWidget *widget,
update_icon_style (widget, icon_pos); update_icon_style (widget, icon_pos);
update_node_ordering (entry); update_node_ordering (entry);
press = gtk_gesture_multi_press_new (); press = gtk_gesture_click_new ();
g_signal_connect (press, "pressed", g_signal_connect (press, "pressed", G_CALLBACK (icon_pressed_cb), entry);
G_CALLBACK (icon_pressed_cb), entry); g_signal_connect (press, "released", G_CALLBACK (icon_released_cb), entry);
g_signal_connect (press, "released",
G_CALLBACK (icon_released_cb), entry);
gtk_widget_add_controller (icon_info->widget, GTK_EVENT_CONTROLLER (press)); gtk_widget_add_controller (icon_info->widget, GTK_EVENT_CONTROLLER (press));
drag = gtk_gesture_drag_new (); drag = gtk_gesture_drag_new ();

View File

@ -83,8 +83,8 @@
#include "gtkentry.h" #include "gtkentry.h"
#include "gtkmain.h" #include "gtkmain.h"
#include "gtkmarshalers.h" #include "gtkmarshalers.h"
#include "gtkgesturemultipress.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkgestureclick.h"
#include "gtkprivate.h" #include "gtkprivate.h"
#include "gtkwindowprivate.h" #include "gtkwindowprivate.h"
@ -594,7 +594,7 @@ gtk_entry_completion_constructed (GObject *object)
G_CALLBACK (propagate_to_entry), completion); G_CALLBACK (propagate_to_entry), completion);
gtk_widget_add_controller (priv->popup_window, controller); 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_signal_connect_swapped (controller, "released",
G_CALLBACK (_gtk_entry_completion_popdown), G_CALLBACK (_gtk_entry_completion_popdown),
completion); completion);

View File

@ -118,7 +118,7 @@
#include "gtkdnd.h" #include "gtkdnd.h"
#include "gtkdragdest.h" #include "gtkdragdest.h"
#include "gtkiconprivate.h" #include "gtkiconprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturesingle.h" #include "gtkgesturesingle.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtklabel.h" #include "gtklabel.h"
@ -226,11 +226,11 @@ static void gtk_expander_measure (GtkWidget *widget,
int *natural_baseline); int *natural_baseline);
/* Gestures */ /* Gestures */
static void gesture_multipress_released_cb (GtkGestureMultiPress *gesture, static void gesture_click_released_cb (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkExpander *expander); GtkExpander *expander);
G_DEFINE_TYPE_WITH_CODE (GtkExpander, gtk_expander, GTK_TYPE_CONTAINER, G_DEFINE_TYPE_WITH_CODE (GtkExpander, gtk_expander, GTK_TYPE_CONTAINER,
G_ADD_PRIVATE (GtkExpander) 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 (GTK_WIDGET (expander), 0, NULL, 0);
gtk_drag_dest_set_track_motion (GTK_WIDGET (expander), TRUE); 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), gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture),
GDK_BUTTON_PRIMARY); GDK_BUTTON_PRIMARY);
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture),
FALSE); FALSE);
g_signal_connect (gesture, "released", 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_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE); GTK_PHASE_BUBBLE);
gtk_widget_add_controller (GTK_WIDGET (priv->title_widget), GTK_EVENT_CONTROLLER (gesture)); 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 static void
gesture_multipress_released_cb (GtkGestureMultiPress *gesture, gesture_click_released_cb (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkExpander *expander) GtkExpander *expander)
{ {
gtk_widget_activate (GTK_WIDGET (expander)); gtk_widget_activate (GTK_WIDGET (expander));
} }

View File

@ -77,7 +77,7 @@
#include "gtkseparator.h" #include "gtkseparator.h"
#include "gtkmodelbutton.h" #include "gtkmodelbutton.h"
#include "gtkgesturelongpress.h" #include "gtkgesturelongpress.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkdebug.h" #include "gtkdebug.h"
#include "gtkfilechoosererrorstackprivate.h" #include "gtkfilechoosererrorstackprivate.h"
@ -2303,11 +2303,11 @@ file_list_show_popover_in_idle (gpointer data)
} }
static void static void
multi_press_cb (GtkGesture *gesture, click_cb (GtkGesture *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
GtkFileChooserWidget *impl) GtkFileChooserWidget *impl)
{ {
PopoverData *pd; 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_name_changed);
gtk_widget_class_bind_template_callback (widget_class, rename_file_rename_clicked); 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, 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, long_press_cb);
gtk_widget_class_bind_template_callback (widget_class, key_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); gtk_widget_class_bind_template_callback (widget_class, widget_key_press_cb);

View File

@ -82,7 +82,7 @@
#include "gtkcontainerprivate.h" #include "gtkcontainerprivate.h"
#include "gtkcssnodeprivate.h" #include "gtkcssnodeprivate.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtkmain.h" #include "gtkmain.h"
#include "gtkmarshalers.h" #include "gtkmarshalers.h"
@ -2638,11 +2638,11 @@ gtk_flow_box_drag_gesture_update (GtkGestureDrag *gesture,
} }
static void static void
gtk_flow_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_flow_box_click_gesture_pressed (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkFlowBox *box) GtkFlowBox *box)
{ {
GtkFlowBoxPrivate *priv = BOX_PRIV (box); GtkFlowBoxPrivate *priv = BOX_PRIV (box);
GtkFlowBoxChild *child; GtkFlowBoxChild *child;
@ -2668,12 +2668,12 @@ gtk_flow_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_flow_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, gtk_flow_box_click_unpaired_release (GtkGestureClick *gesture,
gdouble x, gdouble x,
gdouble y, gdouble y,
guint button, guint button,
GdkEventSequence *sequence, GdkEventSequence *sequence,
GtkFlowBox *box) GtkFlowBox *box)
{ {
GtkFlowBoxPrivate *priv = BOX_PRIV (box); GtkFlowBoxPrivate *priv = BOX_PRIV (box);
GtkFlowBoxChild *child; GtkFlowBoxChild *child;
@ -2688,11 +2688,11 @@ gtk_flow_box_multipress_unpaired_release (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_flow_box_multipress_gesture_released (GtkGestureMultiPress *gesture, gtk_flow_box_click_gesture_released (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkFlowBox *box) GtkFlowBox *box)
{ {
GtkFlowBoxPrivate *priv = BOX_PRIV (box); GtkFlowBoxPrivate *priv = BOX_PRIV (box);
@ -2732,8 +2732,8 @@ gtk_flow_box_multipress_gesture_released (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_flow_box_multipress_gesture_stopped (GtkGestureMultiPress *gesture, gtk_flow_box_click_gesture_stopped (GtkGestureClick *gesture,
GtkFlowBox *box) GtkFlowBox *box)
{ {
GtkFlowBoxPrivate *priv = BOX_PRIV (box); GtkFlowBoxPrivate *priv = BOX_PRIV (box);
@ -3728,7 +3728,7 @@ gtk_flow_box_init (GtkFlowBox *box)
priv->children = g_sequence_new (NULL); 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), gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture),
FALSE); FALSE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 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_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE); GTK_PHASE_BUBBLE);
g_signal_connect (gesture, "pressed", 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_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_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_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)); gtk_widget_add_controller (GTK_WIDGET (box), GTK_EVENT_CONTROLLER (gesture));
priv->drag_gesture = gtk_gesture_drag_new (); priv->drag_gesture = gtk_gesture_drag_new ();

View File

@ -53,7 +53,7 @@
#include "gtkdialog.h" #include "gtkdialog.h"
#include "gtkradiobutton.h" #include "gtkradiobutton.h"
#include "gtkcombobox.h" #include "gtkcombobox.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkeventcontrollerscroll.h" #include "gtkeventcontrollerscroll.h"
#include "gtkroot.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_swapped (feat, "notify::inconsistent", G_CALLBACK (update_font_features), fontchooser);
g_signal_connect (feat, "clicked", G_CALLBACK (feat_clicked), NULL); 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); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", G_CALLBACK (feat_pressed), feat); g_signal_connect (gesture, "pressed", G_CALLBACK (feat_pressed), feat);
gtk_widget_add_controller (feat, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (feat, GTK_EVENT_CONTROLLER (gesture));

View File

@ -18,32 +18,32 @@
*/ */
/** /**
* SECTION:gtkgesturemultipress * SECTION:gtkgestureclick
* @Short_description: Multipress gesture * @Short_description: Multipress gesture
* @Title: GtkGestureMultiPress * @Title: GtkGestureClick
* *
* #GtkGestureMultiPress is a #GtkGesture implementation able to recognize * #GtkGestureClick is a #GtkGesture implementation able to recognize
* multiple clicks on a nearby zone, which can be listened for through the * multiple clicks on a nearby zone, which can be listened for through
* #GtkGestureMultiPress::pressed signal. Whenever time or distance between * the #GtkGestureClick::pressed signal. Whenever time or distance
* clicks exceed the GTK+ defaults, #GtkGestureMultiPress::stopped is emitted, * between clicks exceed the GTK+ defaults, #GtkGestureClick::stopped
* and the click counter is reset. * is emitted, and the click counter is reset.
* *
* Callers may also restrict the area that is considered valid for a >1 * 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 * touch/button press through gtk_gesture_click_set_area(), so any
* click happening outside that area is considered to be a first click of * click happening outside that area is considered to be a first click
* its own. * of its own.
*/ */
#include "config.h" #include "config.h"
#include "gtkgestureprivate.h" #include "gtkgestureprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturemultipressprivate.h" #include "gtkgestureclickprivate.h"
#include "gtkprivate.h" #include "gtkprivate.h"
#include "gtkintl.h" #include "gtkintl.h"
typedef struct _GtkGestureMultiPressPrivate GtkGestureMultiPressPrivate; typedef struct _GtkGestureClickPrivate GtkGestureClickPrivate;
struct _GtkGestureMultiPressPrivate struct _GtkGestureClickPrivate
{ {
GdkRectangle rect; GdkRectangle rect;
GdkDevice *current_device; GdkDevice *current_device;
@ -66,16 +66,16 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 }; 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 static void
gtk_gesture_multi_press_finalize (GObject *object) gtk_gesture_click_finalize (GObject *object)
{ {
GtkGestureMultiPressPrivate *priv; GtkGestureClickPrivate *priv;
GtkGestureMultiPress *gesture; GtkGestureClick *gesture;
gesture = GTK_GESTURE_MULTI_PRESS (object); gesture = GTK_GESTURE_CLICK (object);
priv = gtk_gesture_multi_press_get_instance_private (gesture); priv = gtk_gesture_click_get_instance_private (gesture);
if (priv->double_click_timeout_id) if (priv->double_click_timeout_id)
{ {
@ -83,19 +83,19 @@ gtk_gesture_multi_press_finalize (GObject *object)
priv->double_click_timeout_id = 0; 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 static gboolean
gtk_gesture_multi_press_check (GtkGesture *gesture) gtk_gesture_click_check (GtkGesture *gesture)
{ {
GtkGestureMultiPress *multi_press; GtkGestureClick *click;
GtkGestureMultiPressPrivate *priv; GtkGestureClickPrivate *priv;
GList *sequences; GList *sequences;
gboolean active; gboolean active;
multi_press = GTK_GESTURE_MULTI_PRESS (gesture); click = GTK_GESTURE_CLICK (gesture);
priv = gtk_gesture_multi_press_get_instance_private (multi_press); priv = gtk_gesture_click_get_instance_private (click);
sequences = gtk_gesture_get_sequences (gesture); sequences = gtk_gesture_get_sequences (gesture);
active = g_list_length (sequences) == 1 || priv->double_click_timeout_id; active = g_list_length (sequences) == 1 || priv->double_click_timeout_id;
@ -105,11 +105,11 @@ gtk_gesture_multi_press_check (GtkGesture *gesture)
} }
static void 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) if (priv->n_presses == 0)
return; return;
@ -124,25 +124,25 @@ _gtk_gesture_multi_press_stop (GtkGestureMultiPress *gesture)
static gboolean static gboolean
_double_click_timeout_cb (gpointer user_data) _double_click_timeout_cb (gpointer user_data)
{ {
GtkGestureMultiPress *gesture = user_data; GtkGestureClick *gesture = user_data;
GtkGestureMultiPressPrivate *priv; 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; priv->double_click_timeout_id = 0;
_gtk_gesture_multi_press_stop (gesture); _gtk_gesture_click_stop (gesture);
return FALSE; return FALSE;
} }
static void 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; guint double_click_time;
GtkSettings *settings; GtkSettings *settings;
GtkWidget *widget; 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) if (priv->double_click_timeout_id)
g_source_remove (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 static gboolean
_gtk_gesture_multi_press_check_within_threshold (GtkGestureMultiPress *gesture, _gtk_gesture_click_check_within_threshold (GtkGestureClick *gesture,
gdouble x, double x,
gdouble y) double y)
{ {
GtkGestureMultiPressPrivate *priv; GtkGestureClickPrivate *priv;
guint double_click_distance; guint double_click_distance;
GtkSettings *settings; GtkSettings *settings;
GtkWidget *widget; GtkWidget *widget;
priv = gtk_gesture_multi_press_get_instance_private (gesture); priv = gtk_gesture_click_get_instance_private (gesture);
if (priv->n_presses == 0) if (priv->n_presses == 0)
return TRUE; return TRUE;
@ -189,11 +189,11 @@ _gtk_gesture_multi_press_check_within_threshold (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_gesture_multi_press_begin (GtkGesture *gesture, gtk_gesture_click_begin (GtkGesture *gesture,
GdkEventSequence *sequence) GdkEventSequence *sequence)
{ {
GtkGestureMultiPress *multi_press; GtkGestureClick *click;
GtkGestureMultiPressPrivate *priv; GtkGestureClickPrivate *priv;
guint n_presses, button = 1; guint n_presses, button = 1;
GdkEventSequence *current; GdkEventSequence *current;
const GdkEvent *event; const GdkEvent *event;
@ -204,8 +204,8 @@ gtk_gesture_multi_press_begin (GtkGesture *gesture,
if (!gtk_gesture_handles_sequence (gesture, sequence)) if (!gtk_gesture_handles_sequence (gesture, sequence))
return; return;
multi_press = GTK_GESTURE_MULTI_PRESS (gesture); click = GTK_GESTURE_CLICK (gesture);
priv = gtk_gesture_multi_press_get_instance_private (multi_press); priv = gtk_gesture_click_get_instance_private (click);
event = gtk_gesture_get_last_event (gesture, sequence); event = gtk_gesture_get_last_event (gesture, sequence);
current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
device = gdk_event_get_source_device (event); 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 */ /* Reset the gesture if the button number changes mid-recognition */
if (priv->n_presses > 0 && if (priv->n_presses > 0 &&
priv->current_button != button) priv->current_button != button)
_gtk_gesture_multi_press_stop (multi_press); _gtk_gesture_click_stop (click);
/* Reset also if the device changed */ /* Reset also if the device changed */
if (priv->current_device && priv->current_device != device) 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_device = device;
priv->current_button = button; 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); gtk_gesture_get_point (gesture, current, &x, &y);
if (!_gtk_gesture_multi_press_check_within_threshold (multi_press, x, y)) if (!_gtk_gesture_click_check_within_threshold (click, x, y))
_gtk_gesture_multi_press_stop (multi_press); _gtk_gesture_click_stop (click);
/* Increment later the real counter, just if the gesture is /* Increment later the real counter, just if the gesture is
* reset on the pressed handler */ * reset on the pressed handler */
@ -251,34 +251,34 @@ gtk_gesture_multi_press_begin (GtkGesture *gesture,
} }
static void static void
gtk_gesture_multi_press_update (GtkGesture *gesture, gtk_gesture_click_update (GtkGesture *gesture,
GdkEventSequence *sequence) GdkEventSequence *sequence)
{ {
GtkGestureMultiPress *multi_press; GtkGestureClick *click;
GdkEventSequence *current; GdkEventSequence *current;
gdouble x, y; 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)); current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
gtk_gesture_get_point (gesture, current, &x, &y); gtk_gesture_get_point (gesture, current, &x, &y);
if (!_gtk_gesture_multi_press_check_within_threshold (multi_press, x, y)) if (!_gtk_gesture_click_check_within_threshold (click, x, y))
_gtk_gesture_multi_press_stop (multi_press); _gtk_gesture_click_stop (click);
} }
static void static void
gtk_gesture_multi_press_end (GtkGesture *gesture, gtk_gesture_click_end (GtkGesture *gesture,
GdkEventSequence *sequence) GdkEventSequence *sequence)
{ {
GtkGestureMultiPress *multi_press; GtkGestureClick *click;
GtkGestureMultiPressPrivate *priv; GtkGestureClickPrivate *priv;
GdkEventSequence *current; GdkEventSequence *current;
gdouble x, y; gdouble x, y;
gboolean interpreted; gboolean interpreted;
GtkEventSequenceState state; GtkEventSequenceState state;
multi_press = GTK_GESTURE_MULTI_PRESS (gesture); click = GTK_GESTURE_CLICK (gesture);
priv = gtk_gesture_multi_press_get_instance_private (multi_press); priv = gtk_gesture_click_get_instance_private (click);
current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
interpreted = gtk_gesture_get_point (gesture, current, &x, &y); interpreted = gtk_gesture_get_point (gesture, current, &x, &y);
state = gtk_gesture_get_sequence_state (gesture, current); state = gtk_gesture_get_sequence_state (gesture, current);
@ -290,32 +290,32 @@ gtk_gesture_multi_press_end (GtkGesture *gesture,
} }
static void static void
gtk_gesture_multi_press_cancel (GtkGesture *gesture, gtk_gesture_click_cancel (GtkGesture *gesture,
GdkEventSequence *sequence) GdkEventSequence *sequence)
{ {
_gtk_gesture_multi_press_stop (GTK_GESTURE_MULTI_PRESS (gesture)); _gtk_gesture_click_stop (GTK_GESTURE_CLICK (gesture));
GTK_GESTURE_CLASS (gtk_gesture_multi_press_parent_class)->cancel (gesture, sequence); GTK_GESTURE_CLASS (gtk_gesture_click_parent_class)->cancel (gesture, sequence);
} }
static void 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_gesture_click_stop (GTK_GESTURE_CLICK (controller));
GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_multi_press_parent_class)->reset (controller); GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_click_parent_class)->reset (controller);
} }
static gboolean static gboolean
gtk_gesture_multi_press_handle_event (GtkEventController *controller, gtk_gesture_click_handle_event (GtkEventController *controller,
const GdkEvent *event) const GdkEvent *event)
{ {
GtkEventControllerClass *parent_controller; GtkEventControllerClass *parent_controller;
GtkGestureMultiPressPrivate *priv; GtkGestureClickPrivate *priv;
GdkEventSequence *sequence; GdkEventSequence *sequence;
guint button; guint button;
gdouble x, y; gdouble x, y;
priv = gtk_gesture_multi_press_get_instance_private (GTK_GESTURE_MULTI_PRESS (controller)); priv = gtk_gesture_click_get_instance_private (GTK_GESTURE_CLICK (controller));
parent_controller = GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_multi_press_parent_class); parent_controller = GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_click_parent_class);
sequence = gdk_event_get_event_sequence (event); sequence = gdk_event_get_event_sequence (event);
if (priv->n_presses == 0 && if (priv->n_presses == 0 &&
@ -334,25 +334,25 @@ gtk_gesture_multi_press_handle_event (GtkEventController *controller,
} }
static void 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); GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkGestureClass *gesture_class = GTK_GESTURE_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->check = gtk_gesture_click_check;
gesture_class->begin = gtk_gesture_multi_press_begin; gesture_class->begin = gtk_gesture_click_begin;
gesture_class->update = gtk_gesture_multi_press_update; gesture_class->update = gtk_gesture_click_update;
gesture_class->end = gtk_gesture_multi_press_end; gesture_class->end = gtk_gesture_click_end;
gesture_class->cancel = gtk_gesture_multi_press_cancel; gesture_class->cancel = gtk_gesture_click_cancel;
controller_class->reset = gtk_gesture_multi_press_reset; controller_class->reset = gtk_gesture_click_reset;
controller_class->handle_event = gtk_gesture_multi_press_handle_event; controller_class->handle_event = gtk_gesture_click_handle_event;
/** /**
* GtkGestureMultiPress::pressed: * GtkGestureClick::pressed:
* @gesture: the object which received the signal * @gesture: the object which received the signal
* @n_press: how many touch/button presses happened with this one * @n_press: how many touch/button presses happened with this one
* @x: The X coordinate, in widget allocation coordinates * @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_signal_new (I_("pressed"),
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureMultiPressClass, pressed), G_STRUCT_OFFSET (GtkGestureClickClass, pressed),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_NONE, 3, G_TYPE_INT,
G_TYPE_DOUBLE, G_TYPE_DOUBLE); G_TYPE_DOUBLE, G_TYPE_DOUBLE);
/** /**
* GtkGestureMultiPress::released: * GtkGestureClick::released:
* @gesture: the object which received the signal * @gesture: the object which received the signal
* @n_press: number of press that is paired with this release * @n_press: number of press that is paired with this release
* @x: The X coordinate, in widget allocation coordinates * @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 * 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 * 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. * press and its release, @n_press will only start over at the next press.
*/ */
signals[RELEASED] = signals[RELEASED] =
g_signal_new (I_("released"), g_signal_new (I_("released"),
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureMultiPressClass, released), G_STRUCT_OFFSET (GtkGestureClickClass, released),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_NONE, 3, G_TYPE_INT,
G_TYPE_DOUBLE, G_TYPE_DOUBLE); G_TYPE_DOUBLE, G_TYPE_DOUBLE);
/** /**
* GtkGestureMultiPress::stopped: * GtkGestureClick::stopped:
* @gesture: the object which received the signal * @gesture: the object which received the signal
* *
* This signal is emitted whenever any time/distance threshold has * 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_signal_new (I_("stopped"),
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureMultiPressClass, stopped), G_STRUCT_OFFSET (GtkGestureClickClass, stopped),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
/** /**
* GtkGestureMultiPress::unpaired-release * GtkGestureClick::unpaired-release
* @gesture: the object which received the signal * @gesture: the object which received the signal
* @x: X coordinate of the event * @x: X coordinate of the event
* @y: Y coordinate of the event * @y: Y coordinate of the event
@ -429,28 +429,28 @@ gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass)
} }
static void 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 * Returns a newly created #GtkGesture that recognizes single and multiple
* presses. * presses.
* *
* Returns: a newly created #GtkGestureMultiPress * Returns: a newly created #GtkGestureClick
**/ **/
GtkGesture * 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); NULL);
} }
/** /**
* gtk_gesture_multi_press_set_area: * gtk_gesture_click_set_area:
* @gesture: a #GtkGestureMultiPress * @gesture: a #GtkGestureClick
* @rect: (allow-none): rectangle to receive coordinates on * @rect: (allow-none): rectangle to receive coordinates on
* *
* If @rect is non-%NULL, the press area will be checked to be * 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. * akin to an input shape.
**/ **/
void void
gtk_gesture_multi_press_set_area (GtkGestureMultiPress *gesture, gtk_gesture_click_set_area (GtkGestureClick *gesture,
const GdkRectangle *rect) 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) if (!rect)
priv->rect_is_set = FALSE; priv->rect_is_set = FALSE;
@ -483,26 +483,26 @@ gtk_gesture_multi_press_set_area (GtkGestureMultiPress *gesture,
} }
/** /**
* gtk_gesture_multi_press_get_area: * gtk_gesture_click_get_area:
* @gesture: a #GtkGestureMultiPress * @gesture: a #GtkGestureClick
* @rect: (out): return location for the press area * @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 * 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. * details on what the press area represents.
* *
* Returns: %TRUE if @rect was filled with the press area * Returns: %TRUE if @rect was filled with the press area
**/ **/
gboolean gboolean
gtk_gesture_multi_press_get_area (GtkGestureMultiPress *gesture, gtk_gesture_click_get_area (GtkGestureClick *gesture,
GdkRectangle *rect) 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) if (rect)
{ {

56
gtk/gtkgestureclick.h Normal file
View File

@ -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__ */

View File

@ -16,33 +16,33 @@
* *
* Author(s): Carlos Garnacho <carlosg@gnome.org> * Author(s): Carlos Garnacho <carlosg@gnome.org>
*/ */
#ifndef __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__ #ifndef __GTK_GESTURE_CLICK_PRIVATE_H__
#define __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__ #define __GTK_GESTURE_CLICK_PRIVATE_H__
#include "gtkgesturesingleprivate.h" #include "gtkgesturesingleprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
struct _GtkGestureMultiPress struct _GtkGestureClick
{ {
GtkGestureSingle parent_instance; GtkGestureSingle parent_instance;
}; };
struct _GtkGestureMultiPressClass struct _GtkGestureClickClass
{ {
GtkGestureSingleClass parent_class; GtkGestureSingleClass parent_class;
void (* pressed) (GtkGestureMultiPress *gesture, void (* pressed) (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y); gdouble y);
void (* released) (GtkGestureMultiPress *gesture, void (* released) (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y); gdouble y);
void (* stopped) (GtkGestureMultiPress *gesture); void (* stopped) (GtkGestureClick *gesture);
/*<private>*/ /*<private>*/
gpointer padding[10]; gpointer padding[10];
}; };
#endif /* __GTK_GESTURE_MULTI_PRESS_PRIVATE_H__ */ #endif /* __GTK_GESTURE_CLICK_PRIVATE_H__ */

View File

@ -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__ */

View File

@ -167,12 +167,12 @@ static void gtk_icon_view_leave (GtkEventControl
GdkCrossingMode mode, GdkCrossingMode mode,
GdkNotifyType detail, GdkNotifyType detail,
gpointer user_data); gpointer user_data);
static void gtk_icon_view_button_press (GtkGestureMultiPress *gesture, static void gtk_icon_view_button_press (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data); gpointer user_data);
static void gtk_icon_view_button_release (GtkGestureMultiPress *gesture, static void gtk_icon_view_button_release (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, 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_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (icon_view)),
GTK_STYLE_CLASS_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), g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_icon_view_button_press),
icon_view); icon_view);
g_signal_connect (gesture, "released", G_CALLBACK (gtk_icon_view_button_release), 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 static void
gtk_icon_view_button_press (GtkGestureMultiPress *gesture, gtk_icon_view_button_press (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkIconView *icon_view = user_data; GtkIconView *icon_view = user_data;
GtkWidget *widget = GTK_WIDGET (icon_view); GtkWidget *widget = GTK_WIDGET (icon_view);
@ -2271,11 +2271,11 @@ button_event_modifies_selection (const GdkEventButton *event)
} }
static void static void
gtk_icon_view_button_release (GtkGestureMultiPress *gesture, gtk_icon_view_button_release (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkIconView *icon_view = user_data; GtkIconView *icon_view = user_data;
int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)); int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));

View File

@ -17,7 +17,7 @@
#include "gtk/gtkiconview.h" #include "gtk/gtkiconview.h"
#include "gtk/gtkcssnodeprivate.h" #include "gtk/gtkcssnodeprivate.h"
#include "gtk/gtkgesturemultipress.h" #include "gtk/gtkgestureclick.h"
#include "gtk/gtkeventcontrollermotion.h" #include "gtk/gtkeventcontrollermotion.h"
#ifndef __GTK_ICON_VIEW_PRIVATE_H__ #ifndef __GTK_ICON_VIEW_PRIVATE_H__

View File

@ -482,11 +482,11 @@ gtk_im_context_wayland_finalize (GObject *object)
} }
static void static void
pressed_cb (GtkGestureMultiPress *gesture, pressed_cb (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkIMContextWayland *context) GtkIMContextWayland *context)
{ {
if (n_press == 1) if (n_press == 1)
{ {
@ -496,11 +496,11 @@ pressed_cb (GtkGestureMultiPress *gesture,
} }
static void static void
released_cb (GtkGestureMultiPress *gesture, released_cb (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkIMContextWayland *context) GtkIMContextWayland *context)
{ {
GtkIMContextWaylandGlobal *global; GtkIMContextWaylandGlobal *global;
GtkInputHints hints; GtkInputHints hints;
@ -547,7 +547,7 @@ gtk_im_context_wayland_set_client_widget (GtkIMContext *context,
{ {
GtkGesture *gesture; GtkGesture *gesture;
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_CAPTURE); GTK_PHASE_CAPTURE);
g_signal_connect (gesture, "pressed", g_signal_connect (gesture, "pressed",

View File

@ -35,7 +35,7 @@
#include "gtkdnd.h" #include "gtkdnd.h"
#include "gtkeventcontrollermotion.h" #include "gtkeventcontrollermotion.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturesingle.h" #include "gtkgesturesingle.h"
#include "gtkimage.h" #include "gtkimage.h"
#include "gtkintl.h" #include "gtkintl.h"
@ -363,7 +363,7 @@ struct _GtkLabelSelectionInfo
GtkLabelLink *active_link; GtkLabelLink *active_link;
GtkGesture *drag_gesture; GtkGesture *drag_gesture;
GtkGesture *multipress_gesture; GtkGesture *click_gesture;
GtkEventController *motion_controller; GtkEventController *motion_controller;
gint drag_start_x; gint drag_start_x;
@ -553,12 +553,12 @@ static void emit_activate_link (GtkLabel *label,
GtkLabelLink *link); GtkLabelLink *link);
/* Event controller callbacks */ /* Event controller callbacks */
static void gtk_label_multipress_gesture_pressed (GtkGestureMultiPress *gesture, static void gtk_label_click_gesture_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkLabel *label); GtkLabel *label);
static void gtk_label_multipress_gesture_released (GtkGestureMultiPress *gesture, static void gtk_label_click_gesture_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
@ -4458,11 +4458,11 @@ out:
} }
static void static void
gtk_label_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_label_click_gesture_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble widget_x, gdouble widget_x,
gdouble widget_y, gdouble widget_y,
GtkLabel *label) GtkLabel *label)
{ {
GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
GtkLabelSelectionInfo *info = priv->select_info; GtkLabelSelectionInfo *info = priv->select_info;
@ -4536,11 +4536,11 @@ gtk_label_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_label_multipress_gesture_released (GtkGestureMultiPress *gesture, gtk_label_click_gesture_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkLabel *label) GtkLabel *label)
{ {
GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
GtkLabelSelectionInfo *info = priv->select_info; GtkLabelSelectionInfo *info = priv->select_info;
@ -4605,9 +4605,9 @@ connect_mnemonics_visible_notify (GtkLabel *label)
} }
static void static void
drag_begin_cb (GtkWidget *widget, drag_begin_cb (GtkWidget *widget,
GdkDrag *drag, GdkDrag *drag,
gpointer data) gpointer data)
{ {
GtkLabel *label = GTK_LABEL (widget); GtkLabel *label = GTK_LABEL (widget);
GtkLabelPrivate *priv = gtk_label_get_instance_private (label); 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_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)); 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 (); priv->select_info->click_gesture = gtk_gesture_click_new ();
g_signal_connect (priv->select_info->multipress_gesture, "pressed", g_signal_connect (priv->select_info->click_gesture, "pressed",
G_CALLBACK (gtk_label_multipress_gesture_pressed), label); G_CALLBACK (gtk_label_click_gesture_pressed), label);
g_signal_connect (priv->select_info->multipress_gesture, "released", g_signal_connect (priv->select_info->click_gesture, "released",
G_CALLBACK (gtk_label_multipress_gesture_released), label); G_CALLBACK (gtk_label_click_gesture_released), label);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->select_info->multipress_gesture), 0); 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->multipress_gesture), TRUE); 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->multipress_gesture)); 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 (); priv->select_info->motion_controller = gtk_event_controller_motion_new ();
g_signal_connect (priv->select_info->motion_controller, "motion", 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) 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->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_widget_remove_controller (GTK_WIDGET (label), priv->select_info->motion_controller);
GTK_LABEL_CONTENT (priv->select_info->provider)->label = NULL; GTK_LABEL_CONTENT (priv->select_info->provider)->label = NULL;
g_object_unref (priv->select_info->provider); g_object_unref (priv->select_info->provider);

View File

@ -54,7 +54,7 @@
#include "gtklinkbutton.h" #include "gtklinkbutton.h"
#include "gtkdragsource.h" #include "gtkdragsource.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturesingle.h" #include "gtkgesturesingle.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtklabel.h" #include "gtklabel.h"
@ -135,7 +135,7 @@ static gboolean gtk_link_button_query_tooltip_cb (GtkWidget *widget,
gboolean keyboard_tip, gboolean keyboard_tip,
GtkTooltip *tooltip, GtkTooltip *tooltip,
gpointer data); gpointer data);
static void gtk_link_button_pressed_cb (GtkGestureMultiPress *gesture, static void gtk_link_button_pressed_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -249,7 +249,7 @@ gtk_link_button_init (GtkLinkButton *link_button)
gdk_content_formats_unref (targets); gdk_content_formats_unref (targets);
gtk_drag_source_set_icon_name (GTK_WIDGET (link_button), "text-x-generic"); 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_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); 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 static void
gtk_link_button_pressed_cb (GtkGestureMultiPress *gesture, gtk_link_button_pressed_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkLinkButton *link_button = user_data; GtkLinkButton *link_button = user_data;
GtkLinkButtonPrivate *priv = gtk_link_button_get_instance_private (link_button); GtkLinkButtonPrivate *priv = gtk_link_button_get_instance_private (link_button);

View File

@ -26,7 +26,7 @@
#include "gtkcontainerprivate.h" #include "gtkcontainerprivate.h"
#include "gtkcssnodeprivate.h" #include "gtkcssnodeprivate.h"
#include "gtkdnd.h" #include "gtkdnd.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtkmain.h" #include "gtkmain.h"
#include "gtkmarshalers.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, static void gtk_list_box_set_accept_unpaired_release (GtkListBox *box,
gboolean accept); gboolean accept);
static void gtk_list_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture, static void gtk_list_box_click_gesture_pressed (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkListBox *box); GtkListBox *box);
static void gtk_list_box_multipress_gesture_released (GtkGestureMultiPress *gesture, static void gtk_list_box_click_gesture_released (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkListBox *box); GtkListBox *box);
static void gtk_list_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, static void gtk_list_box_click_unpaired_release (GtkGestureClick *gesture,
gdouble x, gdouble x,
gdouble y, gdouble y,
guint button, guint button,
GdkEventSequence *sequence, GdkEventSequence *sequence,
GtkListBox *box); GtkListBox *box);
static void gtk_list_box_multipress_gesture_stopped (GtkGestureMultiPress *gesture, static void gtk_list_box_click_gesture_stopped (GtkGestureClick *gesture,
GtkListBox *box); GtkListBox *box);
static void gtk_list_box_update_row_styles (GtkListBox *box); static void gtk_list_box_update_row_styles (GtkListBox *box);
static void gtk_list_box_update_row_style (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->children = g_sequence_new (NULL);
priv->header_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, 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_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE); GTK_PHASE_BUBBLE);
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), 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), gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture),
GDK_BUTTON_PRIMARY); GDK_BUTTON_PRIMARY);
g_signal_connect (gesture, "pressed", 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_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_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_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)); gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture));
g_signal_connect (box, "notify::parent", G_CALLBACK (gtk_list_box_parent_cb), NULL); 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 static void
gtk_list_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_list_box_click_gesture_pressed (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkListBox *box) GtkListBox *box)
{ {
GtkListBoxPrivate *priv = BOX_PRIV (box); GtkListBoxPrivate *priv = BOX_PRIV (box);
GtkListBoxRow *row; GtkListBoxRow *row;
@ -1817,12 +1817,12 @@ get_current_selection_modifiers (GtkWidget *widget,
} }
static void static void
gtk_list_box_multipress_unpaired_release (GtkGestureMultiPress *gesture, gtk_list_box_click_unpaired_release (GtkGestureClick *gesture,
gdouble x, gdouble x,
gdouble y, gdouble y,
guint button, guint button,
GdkEventSequence *sequence, GdkEventSequence *sequence,
GtkListBox *box) GtkListBox *box)
{ {
GtkListBoxPrivate *priv = BOX_PRIV (box); GtkListBoxPrivate *priv = BOX_PRIV (box);
GtkListBoxRow *row; GtkListBoxRow *row;
@ -1837,11 +1837,11 @@ gtk_list_box_multipress_unpaired_release (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_list_box_multipress_gesture_released (GtkGestureMultiPress *gesture, gtk_list_box_click_gesture_released (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkListBox *box) GtkListBox *box)
{ {
GtkListBoxPrivate *priv = BOX_PRIV (box); GtkListBoxPrivate *priv = BOX_PRIV (box);
@ -1890,7 +1890,7 @@ gtk_list_box_multipress_gesture_released (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_list_box_multipress_gesture_stopped (GtkGestureMultiPress *gesture, gtk_list_box_click_gesture_stopped (GtkGestureClick *gesture,
GtkListBox *box) GtkListBox *box)
{ {
GtkListBoxPrivate *priv = BOX_PRIV (box); GtkListBoxPrivate *priv = BOX_PRIV (box);

View File

@ -47,7 +47,7 @@
* *
* |[<!-- language="C" --> * |[<!-- language="C" -->
* // connect our handler which will popup the menu * // 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), * gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture),
* GDK_BUTTON_SECONDARY); * GDK_BUTTON_SECONDARY);
* g_signal_connect (gesture, "begin", G_CALLBACK (my_popup_handler), menu); * 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 *natural,
int *minimum_baseline, int *minimum_baseline,
int *natural_baseline); int *natural_baseline);
static void gtk_menu_pressed_cb (GtkGestureMultiPress *gesture, static void gtk_menu_pressed_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data); gpointer user_data);
static void gtk_menu_released_cb (GtkGestureMultiPress *gesture, static void gtk_menu_released_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, 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_parent (priv->bottom_arrow_widget, GTK_WIDGET (menu));
gtk_widget_set_child_visible (priv->bottom_arrow_widget, FALSE); 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_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); 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 static void
gtk_menu_pressed_cb (GtkGestureMultiPress *gesture, gtk_menu_pressed_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -2660,11 +2660,11 @@ gtk_menu_pressed_cb (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_menu_released_cb (GtkGestureMultiPress *gesture, gtk_menu_released_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkMenu *menu = user_data; GtkMenu *menu = user_data;
GtkMenuPrivate *priv = menu->priv; GtkMenuPrivate *priv = menu->priv;

View File

@ -27,7 +27,7 @@
#include <gtk/gtkmenu.h> #include <gtk/gtkmenu.h>
#include <gtk/gtkcssnodeprivate.h> #include <gtk/gtkcssnodeprivate.h>
#include <gtk/gtkgesturemultipress.h> #include <gtk/gtkgestureclick.h>
G_BEGIN_DECLS G_BEGIN_DECLS

View File

@ -76,7 +76,7 @@
#include "gtkwindow.h" #include "gtkwindow.h"
#include "gtkwindowprivate.h" #include "gtkwindowprivate.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "a11y/gtkmenushellaccessible.h" #include "a11y/gtkmenushellaccessible.h"
@ -119,17 +119,17 @@ static gboolean gtk_menu_shell_key_press (GtkEventControllerKey *key,
GdkModifierType modifiers, GdkModifierType modifiers,
GtkWidget *widget); GtkWidget *widget);
static void gtk_menu_shell_root (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, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkMenuShell *menu_shell); GtkMenuShell *menu_shell);
static void multi_press_released (GtkGestureMultiPress *gesture, static void click_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkMenuShell *menu_shell); GtkMenuShell *menu_shell);
static void multi_press_stopped (GtkGestureMultiPress *gesture, static void click_stopped (GtkGestureClick *gesture,
GtkMenuShell *menu_shell); GtkMenuShell *menu_shell);
@ -428,15 +428,15 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell)
G_CALLBACK (gtk_menu_shell_key_press), widget); G_CALLBACK (gtk_menu_shell_key_press), widget);
gtk_widget_add_controller (widget, controller); 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_event_controller_set_propagation_limit (controller, GTK_LIMIT_NONE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (controller), 0); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (controller), 0);
g_signal_connect (controller, "pressed", g_signal_connect (controller, "pressed",
G_CALLBACK (multi_press_pressed), menu_shell); G_CALLBACK (click_pressed), menu_shell);
g_signal_connect (controller, "released", g_signal_connect (controller, "released",
G_CALLBACK (multi_press_released), menu_shell); G_CALLBACK (click_released), menu_shell);
g_signal_connect (controller, "stopped", g_signal_connect (controller, "stopped",
G_CALLBACK (multi_press_stopped), menu_shell); G_CALLBACK (click_stopped), menu_shell);
gtk_widget_add_controller (widget, controller); gtk_widget_add_controller (widget, controller);
} }
@ -622,7 +622,7 @@ gtk_menu_shell_get_toplevel_shell (GtkMenuShell *menu_shell)
} }
static void static void
multi_press_stopped (GtkGestureMultiPress *gesture, click_stopped (GtkGestureClick *gesture,
GtkMenuShell *menu_shell) GtkMenuShell *menu_shell)
{ {
GtkMenuShellPrivate *priv = menu_shell->priv; GtkMenuShellPrivate *priv = menu_shell->priv;
@ -647,11 +647,11 @@ multi_press_stopped (GtkGestureMultiPress *gesture,
} }
static void static void
multi_press_pressed (GtkGestureMultiPress *gesture, click_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkMenuShell *menu_shell) GtkMenuShell *menu_shell)
{ {
GtkMenuShellPrivate *priv = menu_shell->priv; GtkMenuShellPrivate *priv = menu_shell->priv;
GtkWidget *menu_item; GtkWidget *menu_item;
@ -723,11 +723,11 @@ multi_press_pressed (GtkGestureMultiPress *gesture,
} }
static void static void
multi_press_released (GtkGestureMultiPress *gesture, click_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkMenuShell *menu_shell) GtkMenuShell *menu_shell)
{ {
GtkMenuShellPrivate *priv = menu_shell->priv; GtkMenuShellPrivate *priv = menu_shell->priv;
GtkMenuShell *parent_shell = GTK_MENU_SHELL (priv->parent_menu_shell); GtkMenuShell *parent_shell = GTK_MENU_SHELL (priv->parent_menu_shell);

View File

@ -52,7 +52,7 @@
#include "gtksettings.h" #include "gtksettings.h"
#include "gtkstylecontextprivate.h" #include "gtkstylecontextprivate.h"
#include "gtkdialogprivate.h" #include "gtkdialogprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include <glib/gprintf.h> #include <glib/gprintf.h>
@ -1342,7 +1342,7 @@ on_popup_menu_for_process_tree_view (GtkWidget *widget,
} }
static void static void
multi_press_cb (GtkGesture *gesture, click_cb (GtkGesture *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -1470,10 +1470,10 @@ create_show_processes_dialog (GtkMountOperation *op,
G_CALLBACK (on_popup_menu_for_process_tree_view), G_CALLBACK (on_popup_menu_for_process_tree_view),
op); op);
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", 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)); gtk_widget_add_controller (tree_view, GTK_EVENT_CONTROLLER (gesture));
list_store = gtk_list_store_new (3, list_store = gtk_list_store_new (3,

View File

@ -35,7 +35,7 @@
#include "gtkdnd.h" #include "gtkdnd.h"
#include "gtkdragdest.h" #include "gtkdragdest.h"
#include "gtkeventcontrollermotion.h" #include "gtkeventcontrollermotion.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgizmoprivate.h" #include "gtkgizmoprivate.h"
#include "gtkiconprivate.h" #include "gtkiconprivate.h"
#include "gtkintl.h" #include "gtkintl.h"
@ -844,12 +844,12 @@ static void gtk_notebook_buildable_add_child (GtkBuildable *buildable,
GObject *child, GObject *child,
const gchar *type); const gchar *type);
static void gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture, static void gtk_notebook_gesture_pressed (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data); gpointer user_data);
static void gtk_notebook_gesture_released (GtkGestureMultiPress *gesture, static void gtk_notebook_gesture_released (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -1356,7 +1356,7 @@ gtk_notebook_init (GtkNotebook *notebook)
gtk_widget_set_vexpand (priv->stack_widget, TRUE); gtk_widget_set_vexpand (priv->stack_widget, TRUE);
gtk_container_add (GTK_CONTAINER (priv->box), priv->stack_widget); 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_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_CAPTURE); 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); g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_notebook_gesture_pressed), notebook);
@ -2488,7 +2488,7 @@ get_tab_at_pos (GtkNotebook *notebook,
} }
static void static void
gtk_notebook_gesture_pressed (GtkGestureMultiPress *gesture, gtk_notebook_gesture_pressed (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -2779,11 +2779,11 @@ gtk_notebook_stop_reorder (GtkNotebook *notebook)
} }
static void static void
gtk_notebook_gesture_released (GtkGestureMultiPress *gesture, gtk_notebook_gesture_released (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkNotebook *notebook = user_data; GtkNotebook *notebook = user_data;
GtkNotebookPrivate *priv = notebook->priv; GtkNotebookPrivate *priv = notebook->priv;

View File

@ -26,7 +26,7 @@
#include "gtkbindings.h" #include "gtkbindings.h"
#include "gtktextprivate.h" #include "gtktextprivate.h"
#include "gtkeditable.h" #include "gtkeditable.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkbox.h" #include "gtkbox.h"
#include "gtkimage.h" #include "gtkimage.h"
#include "gtkcheckmenuitem.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_tooltip_text (priv->peek_icon, _("Show text"));
gtk_widget_set_parent (priv->peek_icon, GTK_WIDGET (entry)); 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_signal_connect_swapped (press, "released",
G_CALLBACK (gtk_password_entry_toggle_peek), entry); G_CALLBACK (gtk_password_entry_toggle_peek), entry);
gtk_widget_add_controller (priv->peek_icon, GTK_EVENT_CONTROLLER (press)); gtk_widget_add_controller (priv->peek_icon, GTK_EVENT_CONTROLLER (press));

View File

@ -62,7 +62,7 @@
#include "gtkmodelbutton.h" #include "gtkmodelbutton.h"
#include "gtkprivate.h" #include "gtkprivate.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtknative.h" #include "gtknative.h"
@ -286,12 +286,12 @@ static void check_unmount_and_eject (GMount *mount,
GDrive *drive, GDrive *drive,
gboolean *show_unmount, gboolean *show_unmount,
gboolean *show_eject); gboolean *show_eject);
static void on_row_pressed (GtkGestureMultiPress *gesture, static void on_row_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkSidebarRow *row); GtkSidebarRow *row);
static void on_row_released (GtkGestureMultiPress *gesture, static void on_row_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
@ -511,7 +511,7 @@ add_place (GtkPlacesSidebar *sidebar,
g_signal_connect_swapped (eject_button, "clicked", g_signal_connect_swapped (eject_button, "clicked",
G_CALLBACK (eject_or_unmount_bookmark), row); 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); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "pressed", g_signal_connect (gesture, "pressed",
G_CALLBACK (on_row_pressed), row); G_CALLBACK (on_row_pressed), row);
@ -3731,11 +3731,11 @@ on_row_activated (GtkListBox *list_box,
} }
static void static void
on_row_pressed (GtkGestureMultiPress *gesture, on_row_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkSidebarRow *row) GtkSidebarRow *row)
{ {
GtkPlacesSidebar *sidebar; GtkPlacesSidebar *sidebar;
GtkPlacesSidebarSectionType section_type; GtkPlacesSidebarSectionType section_type;
@ -3758,11 +3758,11 @@ on_row_pressed (GtkGestureMultiPress *gesture,
} }
static void static void
on_row_released (GtkGestureMultiPress *gesture, on_row_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkSidebarRow *row) GtkSidebarRow *row)
{ {
GtkPlacesSidebar *sidebar; GtkPlacesSidebar *sidebar;
GtkPlacesSidebarSectionType section_type; GtkPlacesSidebarSectionType section_type;

View File

@ -32,7 +32,7 @@
#include "gtkeventcontrollerscroll.h" #include "gtkeventcontrollerscroll.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkgesturelongpressprivate.h" #include "gtkgesturelongpressprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgizmoprivate.h" #include "gtkgizmoprivate.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtkmarshalers.h" #include "gtkmarshalers.h"
@ -162,12 +162,12 @@ static void gtk_range_size_allocate (GtkWidget *widget,
int baseline); int baseline);
static void gtk_range_unmap (GtkWidget *widget); 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, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkRange *range); GtkRange *range);
static void gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture, static void gtk_range_click_gesture_released (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
@ -558,7 +558,7 @@ gtk_range_init (GtkRange *range)
/* Note: Order is important here. /* Note: Order is important here.
* The ::drag-begin handler relies on the state set up by the * 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 * in the oppposite order in which they are added to their
* widget. * widget.
*/ */
@ -570,12 +570,12 @@ gtk_range_init (GtkRange *range)
G_CALLBACK (gtk_range_drag_gesture_update), range); G_CALLBACK (gtk_range_drag_gesture_update), range);
gtk_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (priv->drag_gesture)); 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); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "pressed", 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_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_widget_add_controller (GTK_WIDGET (range), GTK_EVENT_CONTROLLER (gesture));
gtk_gesture_group (priv->drag_gesture, gesture); gtk_gesture_group (priv->drag_gesture, gesture);
@ -1874,11 +1874,11 @@ gtk_range_long_press_gesture_pressed (GtkGestureLongPress *gesture,
} }
static void static void
gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_range_click_gesture_pressed (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkRange *range) GtkRange *range)
{ {
GtkWidget *widget = GTK_WIDGET (range); GtkWidget *widget = GTK_WIDGET (range);
GtkRangePrivate *priv = gtk_range_get_instance_private (range); GtkRangePrivate *priv = gtk_range_get_instance_private (range);
@ -2006,11 +2006,11 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_range_multipress_gesture_released (GtkGestureMultiPress *gesture, gtk_range_click_gesture_released (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkRange *range) GtkRange *range)
{ {
GtkRangePrivate *priv = gtk_range_get_instance_private (range); GtkRangePrivate *priv = gtk_range_get_instance_private (range);

View File

@ -33,7 +33,7 @@
#include "gtkbindings.h" #include "gtkbindings.h"
#include "gtkeditable.h" #include "gtkeditable.h"
#include "gtkbox.h" #include "gtkbox.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtktextprivate.h" #include "gtktextprivate.h"
#include "gtkimage.h" #include "gtkimage.h"
#include "gtkintl.h" #include "gtkintl.h"
@ -491,11 +491,11 @@ gtk_search_entry_editable_init (GtkEditableInterface *iface)
} }
static void static void
gtk_search_entry_icon_release (GtkGestureMultiPress *press, gtk_search_entry_icon_release (GtkGestureClick *press,
int n_press, int n_press,
double x, double x,
double y, double y,
GtkSearchEntry *entry) GtkSearchEntry *entry)
{ {
GtkSearchEntryPrivate *priv = gtk_search_entry_get_instance_private (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_parent (priv->icon, GTK_WIDGET (entry));
gtk_widget_set_child_visible (priv->icon, FALSE); 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); g_signal_connect (press, "released", G_CALLBACK (gtk_search_entry_icon_release), entry);
gtk_widget_add_controller (priv->icon, GTK_EVENT_CONTROLLER (press)); gtk_widget_add_controller (priv->icon, GTK_EVENT_CONTROLLER (press));

View File

@ -40,7 +40,7 @@
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkeventcontrollermotion.h" #include "gtkeventcontrollermotion.h"
#include "gtkeventcontrollerscroll.h" #include "gtkeventcontrollerscroll.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgestureswipe.h" #include "gtkgestureswipe.h"
#include "gtkicontheme.h" #include "gtkicontheme.h"
#include "gtkintl.h" #include "gtkintl.h"
@ -773,11 +773,11 @@ start_spinning (GtkSpinButton *spin,
} }
static void static void
button_pressed_cb (GtkGestureMultiPress *gesture, button_pressed_cb (GtkGestureClick *gesture,
int n_pressses, int n_pressses,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkSpinButton *spin_button = user_data; GtkSpinButton *spin_button = user_data;
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button); GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button);
@ -802,11 +802,11 @@ button_pressed_cb (GtkGestureMultiPress *gesture,
} }
static void static void
button_released_cb (GtkGestureMultiPress *gesture, button_released_cb (GtkGestureClick *gesture,
int n_pressses, int n_pressses,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkSpinButton *spin_button = user_data; GtkSpinButton *spin_button = user_data;
GtkSpinButtonPrivate *priv = gtk_spin_button_get_instance_private (spin_button); 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_style_context_add_class (gtk_widget_get_style_context (priv->down_button), "down");
gtk_container_add (GTK_CONTAINER (priv->box), priv->down_button); 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_button (GTK_GESTURE_SINGLE (gesture), 0);
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), 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_style_context_add_class (gtk_widget_get_style_context (priv->up_button), "up");
gtk_container_add (GTK_CONTAINER (priv->box), priv->up_button); 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_button (GTK_GESTURE_SINGLE (gesture), 0);
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),

View File

@ -55,7 +55,7 @@
#include "gtkactionable.h" #include "gtkactionable.h"
#include "gtkactionhelperprivate.h" #include "gtkactionhelperprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturepan.h" #include "gtkgesturepan.h"
#include "gtkgesturesingle.h" #include "gtkgesturesingle.h"
#include "gtkgizmoprivate.h" #include "gtkgizmoprivate.h"
@ -81,7 +81,7 @@ struct _GtkSwitchPrivate
GtkActionHelper *action_helper; GtkActionHelper *action_helper;
GtkGesture *pan_gesture; GtkGesture *pan_gesture;
GtkGesture *multipress_gesture; GtkGesture *click_gesture;
double handle_pos; double handle_pos;
guint tick_id; guint tick_id;
@ -206,11 +206,11 @@ gtk_switch_begin_toggle_animation (GtkSwitch *sw)
} }
static void static void
gtk_switch_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_switch_click_gesture_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkSwitch *sw) GtkSwitch *sw)
{ {
GtkSwitchPrivate *priv = gtk_switch_get_instance_private (sw); GtkSwitchPrivate *priv = gtk_switch_get_instance_private (sw);
graphene_rect_t switch_bounds; graphene_rect_t switch_bounds;
@ -229,11 +229,11 @@ gtk_switch_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
} }
static void static void
gtk_switch_multipress_gesture_released (GtkGestureMultiPress *gesture, gtk_switch_click_gesture_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkSwitch *sw) GtkSwitch *sw)
{ {
GdkEventSequence *sequence; GdkEventSequence *sequence;
@ -291,7 +291,7 @@ gtk_switch_pan_gesture_drag_end (GtkGestureDrag *gesture,
*/ */
active = priv->handle_pos >= 0.5; 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; active = priv->is_active;
else else
return; return;
@ -639,17 +639,17 @@ gtk_switch_init (GtkSwitch *self)
gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE); 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_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);
gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (gesture), TRUE); gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (gesture), TRUE);
g_signal_connect (gesture, "pressed", 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_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_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_BUBBLE); GTK_PHASE_BUBBLE);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture)); 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); gesture = gtk_gesture_pan_new (GTK_ORIENTATION_HORIZONTAL);
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);

View File

@ -38,7 +38,7 @@
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkeventcontrollermotion.h" #include "gtkeventcontrollermotion.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturesingle.h" #include "gtkgesturesingle.h"
#include "gtkimageprivate.h" #include "gtkimageprivate.h"
#include "gtkimcontextsimple.h" #include "gtkimcontextsimple.h"
@ -443,7 +443,7 @@ static void gtk_text_motion_controller_motion (GtkEventControllerMotion *c
double x, double x,
double y, double y,
GtkText *self); GtkText *self);
static void gtk_text_multipress_gesture_pressed (GtkGestureMultiPress *gesture, static void gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -1709,9 +1709,9 @@ gtk_text_init (GtkText *self)
gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->drag_gesture), TRUE); 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)); 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_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_button (GTK_GESTURE_SINGLE (gesture), 0);
gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (gesture), TRUE); gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (gesture), TRUE);
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture)); 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 static void
gtk_text_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
int n_press, int n_press,
double widget_x, double widget_x,
double widget_y, double widget_y,
GtkText *self) GtkText *self)
{ {
GtkWidget *widget = GTK_WIDGET (self); GtkWidget *widget = GTK_WIDGET (self);
GtkTextPrivate *priv = gtk_text_get_instance_private (self); GtkTextPrivate *priv = gtk_text_get_instance_private (self);

View File

@ -378,7 +378,7 @@ static void gtk_text_view_direction_changed (GtkWidget *widget,
static void gtk_text_view_state_flags_changed (GtkWidget *widget, static void gtk_text_view_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state); 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, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
@ -1669,10 +1669,10 @@ gtk_text_view_init (GtkTextView *text_view)
priv->text_window = text_window_new (GTK_TEXT_WINDOW_TEXT, widget); 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); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "pressed", g_signal_connect (gesture, "pressed",
G_CALLBACK (gtk_text_view_multipress_gesture_pressed), G_CALLBACK (gtk_text_view_click_gesture_pressed),
widget); widget);
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture));
@ -5075,11 +5075,11 @@ get_iter_from_gesture (GtkTextView *text_view,
} }
static void static void
gtk_text_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_text_view_click_gesture_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkTextView *text_view) GtkTextView *text_view)
{ {
GdkEventSequence *sequence; GdkEventSequence *sequence;
GtkTextViewPrivate *priv; GtkTextViewPrivate *priv;

View File

@ -58,7 +58,7 @@
#include "gtkwidgetpath.h" #include "gtkwidgetpath.h"
#include "gtkwidgetprivate.h" #include "gtkwidgetprivate.h"
#include "gtkwindowprivate.h" #include "gtkwindowprivate.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkbuttonprivate.h" #include "gtkbuttonprivate.h"
@ -245,7 +245,7 @@ static void gtk_toolbar_measure (GtkWidget *widget,
int *natural, int *natural,
int *minimum_baseline, int *minimum_baseline,
int *natural_baseline); int *natural_baseline);
static void gtk_toolbar_pressed_cb (GtkGestureMultiPress *gesture, static void gtk_toolbar_pressed_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -575,7 +575,7 @@ gtk_toolbar_init (GtkToolbar *toolbar)
priv->timer = g_timer_new (); 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_touch_only (GTK_GESTURE_SINGLE (gesture), FALSE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); 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 static void
gtk_toolbar_pressed_cb (GtkGestureMultiPress *gesture, gtk_toolbar_pressed_cb (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) gpointer user_data)
{ {
GtkToolbar *toolbar = user_data; GtkToolbar *toolbar = user_data;
GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture)); GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));

View File

@ -40,7 +40,7 @@
#include "gtkeventcontrollerscroll.h" #include "gtkeventcontrollerscroll.h"
#include "gtkframe.h" #include "gtkframe.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgesturesingle.h" #include "gtkgesturesingle.h"
#include "gtkintl.h" #include "gtkintl.h"
#include "gtklabel.h" #include "gtklabel.h"
@ -503,7 +503,7 @@ struct _GtkTreeViewPrivate
GDestroyNotify row_separator_destroy; GDestroyNotify row_separator_destroy;
/* Gestures */ /* Gestures */
GtkGesture *multipress_gesture; GtkGesture *click_gesture;
GtkGesture *drag_gesture; /* Rubberbanding, row DnD */ GtkGesture *drag_gesture; /* Rubberbanding, row DnD */
GtkGesture *column_drag_gesture; /* Column reordering, resizing */ 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); static void grab_focus_and_unset_draw_keyfocus (GtkTreeView *tree_view);
/* Gestures */ /* 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, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkTreeView *tree_view); 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, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkTreeView *tree_view); 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, gint n_press,
gdouble x, gdouble x,
gdouble y, 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)); gtk_css_node_set_state (priv->header_node, gtk_css_node_get_state (widget_node));
g_object_unref (priv->header_node); g_object_unref (priv->header_node);
priv->multipress_gesture = gtk_gesture_multi_press_new (); priv->click_gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->click_gesture), 0);
g_signal_connect (priv->multipress_gesture, "pressed", g_signal_connect (priv->click_gesture, "pressed",
G_CALLBACK (gtk_tree_view_multipress_gesture_pressed), tree_view); G_CALLBACK (gtk_tree_view_click_gesture_pressed), tree_view);
g_signal_connect (priv->multipress_gesture, "released", g_signal_connect (priv->click_gesture, "released",
G_CALLBACK (gtk_tree_view_multipress_gesture_released), tree_view); G_CALLBACK (gtk_tree_view_click_gesture_released), tree_view);
gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (priv->multipress_gesture)); 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_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_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_CAPTURE); GTK_PHASE_CAPTURE);
gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (GTK_WIDGET (tree_view), GTK_EVENT_CONTROLLER (gesture));
@ -2796,7 +2796,7 @@ get_current_selection_modifiers (GtkWidget *widget,
} }
static void static void
gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
@ -3098,7 +3098,7 @@ gtk_tree_view_drag_gesture_begin (GtkGestureDrag *gesture,
} }
static void static void
gtk_tree_view_column_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_tree_view_column_click_gesture_pressed (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
@ -3298,11 +3298,11 @@ gtk_tree_view_drag_gesture_end (GtkGestureDrag *gesture,
} }
static void static void
gtk_tree_view_multipress_gesture_released (GtkGestureMultiPress *gesture, gtk_tree_view_click_gesture_released (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkTreeView *tree_view) GtkTreeView *tree_view)
{ {
gboolean modify, extend; gboolean modify, extend;
guint button; 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 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) || 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; node = NULL;
gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, 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)); button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (tree_view->priv->drag_gesture));
/* Deny the multipress gesture */ /* Deny the click gesture */
gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->multipress_gesture), gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->click_gesture),
GTK_EVENT_SEQUENCE_DENIED); GTK_EVENT_SEQUENCE_DENIED);
gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, start_x, start_y, 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); tree_view);
gtk_widget_add_controller (tree_view->priv->search_window, controller); 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_signal_connect (gesture, "pressed",
G_CALLBACK (gtk_tree_view_search_pressed_cb), tree_view); G_CALLBACK (gtk_tree_view_search_pressed_cb), tree_view);
gtk_widget_add_controller (tree_view->priv->search_window, GTK_EVENT_CONTROLLER (gesture)); 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); selection_changed = gtk_tree_view_unref_and_check_selection_tree (tree_view, node->children);
/* Stop a pending double click */ /* 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 (tree_view, node->children, NULL);
_gtk_tree_view_accessible_remove_state (tree_view, _gtk_tree_view_accessible_remove_state (tree_view,

View File

@ -45,7 +45,7 @@
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtkeventcontrollermotion.h" #include "gtkeventcontrollermotion.h"
#include "gtkgesturedrag.h" #include "gtkgesturedrag.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkgestureprivate.h" #include "gtkgestureprivate.h"
#include "gtkheaderbarprivate.h" #include "gtkheaderbarprivate.h"
#include "gtkicontheme.h" #include "gtkicontheme.h"
@ -269,7 +269,7 @@ typedef struct
GdkSurfaceTypeHint type_hint; GdkSurfaceTypeHint type_hint;
GtkGesture *multipress_gesture; GtkGesture *click_gesture;
GtkGesture *drag_gesture; GtkGesture *drag_gesture;
GtkGesture *bubble_drag_gesture; GtkGesture *bubble_drag_gesture;
GtkEventController *key_controller; GtkEventController *key_controller;
@ -1333,11 +1333,11 @@ gtk_window_titlebar_action (GtkWindow *window,
} }
static void static void
multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, click_gesture_pressed_cb (GtkGestureClick *gesture,
gint n_press, gint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkWindow *window) GtkWindow *window)
{ {
GtkWindowPrivate *priv = gtk_window_get_instance_private (window); GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *event_widget, *widget; GtkWidget *event_widget, *widget;
@ -1548,7 +1548,7 @@ drag_gesture_update_cb (GtkGestureDrag *gesture,
gtk_get_current_event_time ()); gtk_get_current_event_time ());
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture)); 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));
} }
} }
@ -1908,13 +1908,13 @@ gtk_window_constructed (GObject *object)
if (priv->type == GTK_WINDOW_TOPLEVEL) if (priv->type == GTK_WINDOW_TOPLEVEL)
{ {
priv->multipress_gesture = gtk_gesture_multi_press_new (); priv->click_gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->click_gesture), 0);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->multipress_gesture), gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->click_gesture),
GTK_PHASE_BUBBLE); GTK_PHASE_BUBBLE);
g_signal_connect (priv->multipress_gesture, "pressed", g_signal_connect (priv->click_gesture, "pressed",
G_CALLBACK (multipress_gesture_pressed_cb), object); G_CALLBACK (click_gesture_pressed_cb), object);
gtk_widget_add_controller (GTK_WIDGET (object), GTK_EVENT_CONTROLLER (priv->multipress_gesture)); gtk_widget_add_controller (GTK_WIDGET (object), GTK_EVENT_CONTROLLER (priv->click_gesture));
priv->drag_gesture = create_drag_gesture (window); priv->drag_gesture = create_drag_gesture (window);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->drag_gesture), gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->drag_gesture),

View File

@ -32,7 +32,6 @@
#include "gtkstack.h" #include "gtkstack.h"
#include "gtkmain.h" #include "gtkmain.h"
#include "gtkwidgetprivate.h" #include "gtkwidgetprivate.h"
#include "gtkgesturemultipress.h"
#include "gtkeventcontrollermotion.h" #include "gtkeventcontrollermotion.h"
#include "gtkeventcontrollerkey.h" #include "gtkeventcontrollerkey.h"
#include "gtknative.h" #include "gtknative.h"

View File

@ -42,7 +42,7 @@
#include "gtklistbox.h" #include "gtklistbox.h"
#include "gtksizegroup.h" #include "gtksizegroup.h"
#include "gtkroot.h" #include "gtkroot.h"
#include "gtkgesturemultipress.h" #include "gtkgestureclick.h"
#include "gtkstylecontext.h" #include "gtkstylecontext.h"
enum enum
@ -124,7 +124,7 @@ apply_sort (GtkInspectorPropList *pl,
} }
static void static void
sort_changed (GtkGestureMultiPress *gesture, sort_changed (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,

View File

@ -17,7 +17,7 @@
<object class="GtkBox" id="name_heading"> <object class="GtkBox" id="name_heading">
<property name="hexpand">0</property> <property name="hexpand">0</property>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<signal name="pressed" handler="sort_changed" swapped="no"/> <signal name="pressed" handler="sort_changed" swapped="no"/>
</object> </object>
@ -48,7 +48,7 @@
<object class="GtkBox" id="origin_heading"> <object class="GtkBox" id="origin_heading">
<property name="hexpand">0</property> <property name="hexpand">0</property>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<signal name="pressed" handler="sort_changed" swapped="no"/> <signal name="pressed" handler="sort_changed" swapped="no"/>
</object> </object>

View File

@ -238,7 +238,7 @@ gtk_public_sources = files([
'gtkgesture.c', 'gtkgesture.c',
'gtkgesturedrag.c', 'gtkgesturedrag.c',
'gtkgesturelongpress.c', 'gtkgesturelongpress.c',
'gtkgesturemultipress.c', 'gtkgestureclick.c',
'gtkgesturepan.c', 'gtkgesturepan.c',
'gtkgesturerotate.c', 'gtkgesturerotate.c',
'gtkgesturesingle.c', 'gtkgesturesingle.c',
@ -496,7 +496,7 @@ gtk_public_headers = files([
'gtkgesture.h', 'gtkgesture.h',
'gtkgesturedrag.h', 'gtkgesturedrag.h',
'gtkgesturelongpress.h', 'gtkgesturelongpress.h',
'gtkgesturemultipress.h', 'gtkgestureclick.h',
'gtkgesturepan.h', 'gtkgesturepan.h',
'gtkgesturerotate.h', 'gtkgesturerotate.h',
'gtkgesturesingle.h', 'gtkgesturesingle.h',

View File

@ -166,7 +166,7 @@
<property name="right-margin">8</property> <property name="right-margin">8</property>
<property name="cursor-visible">0</property> <property name="cursor-visible">0</property>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<signal name="released" handler="text_view_released" swapped="no"/> <signal name="released" handler="text_view_released" swapped="no"/>
</object> </object>
</child> </child>
@ -209,7 +209,7 @@
<property name="right-margin">8</property> <property name="right-margin">8</property>
<property name="cursor-visible">0</property> <property name="cursor-visible">0</property>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<signal name="released" handler="text_view_released" swapped="no"/> <signal name="released" handler="text_view_released" swapped="no"/>
</object> </object>
</child> </child>

View File

@ -45,7 +45,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<property name="button">3</property> <property name="button">3</property>
<signal name="pressed" handler="pressed_cb"/> <signal name="pressed" handler="pressed_cb"/>
</object> </object>
@ -69,7 +69,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<property name="button">3</property> <property name="button">3</property>
<signal name="pressed" handler="pressed_cb"/> <signal name="pressed" handler="pressed_cb"/>
</object> </object>
@ -93,7 +93,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<property name="button">3</property> <property name="button">3</property>
<signal name="pressed" handler="pressed_cb"/> <signal name="pressed" handler="pressed_cb"/>
</object> </object>

View File

@ -146,9 +146,9 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<property name="button">3</property> <property name="button">3</property>
<signal name="pressed" handler="multi_press_cb" swapped="no"/> <signal name="pressed" handler="click_cb" swapped="no"/>
</object> </object>
</child> </child>
<child> <child>

View File

@ -82,7 +82,7 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkGestureMultiPress"> <object class="GtkGestureClick">
<property name="button">3</property> <property name="button">3</property>
<signal name="pressed" handler="pressed_cb" swapped="no"/> <signal name="pressed" handler="pressed_cb" swapped="no"/>
</object> </object>

View File

@ -308,7 +308,7 @@ main (int argc, char **argv)
gtk_widget_set_tooltip_text (image, "Click me"); gtk_widget_set_tooltip_text (image, "Click me");
GtkGesture *gesture; GtkGesture *gesture;
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
g_signal_connect (gesture, "pressed", G_CALLBACK (icon_pressed_cb), NULL); g_signal_connect (gesture, "pressed", G_CALLBACK (icon_pressed_cb), NULL);
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
gtk_container_add (GTK_CONTAINER (box), image); gtk_container_add (GTK_CONTAINER (box), image);

View File

@ -32,11 +32,11 @@ test_widget (const gchar *label, const gchar *color)
static GtkOrientation o; static GtkOrientation o;
static void static void
toggle_orientation (GtkGestureMultiPress *gesture, toggle_orientation (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkGrid *grid) GtkGrid *grid)
{ {
o = 1 - o; o = 1 - o;
gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), o); gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), o);
@ -55,7 +55,7 @@ simple_grid (void)
grid = gtk_grid_new (); grid = gtk_grid_new ();
gtk_container_add (GTK_CONTAINER (window), grid); gtk_container_add (GTK_CONTAINER (window), grid);
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
g_signal_connect (gesture, "pressed", G_CALLBACK (toggle_orientation), grid); g_signal_connect (gesture, "pressed", G_CALLBACK (toggle_orientation), grid);
gtk_widget_add_controller (window, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (window, GTK_EVENT_CONTROLLER (gesture));

View File

@ -3320,7 +3320,7 @@ create_cursors (GtkWidget *widget)
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (darea), 80); gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (darea), 80);
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (darea), cursor_draw, NULL, NULL); gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (darea), cursor_draw, NULL, NULL);
gtk_container_add (GTK_CONTAINER (frame), darea); gtk_container_add (GTK_CONTAINER (frame), darea);
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_button (GTK_GESTURE_SINGLE (gesture), 0);
g_signal_connect (gesture, "pressed", G_CALLBACK (cursor_pressed_cb), entry); g_signal_connect (gesture, "pressed", G_CALLBACK (cursor_pressed_cb), entry);
gtk_widget_add_controller (darea, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (darea, GTK_EVENT_CONTROLLER (gesture));

View File

@ -356,11 +356,11 @@ do_popup_menu (GtkWidget *icon_list,
} }
static void static void
press_handler (GtkGestureMultiPress *gesture, press_handler (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkWidget *widget) GtkWidget *widget)
{ {
GtkTreePath *path = NULL; GtkTreePath *path = NULL;
@ -434,7 +434,7 @@ main (gint argc, gchar **argv)
tvc = gtk_tree_view_column_new (); tvc = gtk_tree_view_column_new ();
gtk_tree_view_append_column (GTK_TREE_VIEW (tv), tvc); gtk_tree_view_append_column (GTK_TREE_VIEW (tv), tvc);
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture),
GDK_BUTTON_SECONDARY); GDK_BUTTON_SECONDARY);
g_signal_connect (gesture, "pressed", g_signal_connect (gesture, "pressed",

View File

@ -249,7 +249,7 @@ main (gint argc, gchar **argv)
tree_model = create_model (); tree_model = create_model ();
tree_view = gtk_tree_view_new_with_model (tree_model); tree_view = gtk_tree_view_new_with_model (tree_model);
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), tree_view); g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), tree_view);
gtk_widget_add_controller (tree_view, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (tree_view, GTK_EVENT_CONTROLLER (gesture));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), TRUE); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), TRUE);

View File

@ -53,11 +53,11 @@ clicked_icon (GtkTreeView *tv,
} }
static void static void
release_event (GtkGestureMultiPress *gesture, release_event (GtkGestureClick *gesture,
guint n_press, guint n_press,
gdouble x, gdouble x,
gdouble y, gdouble y,
GtkTreeView *tv) GtkTreeView *tv)
{ {
GtkTreePath *path; GtkTreePath *path;
gint tx, ty; gint tx, ty;
@ -129,7 +129,7 @@ int main (int argc, char *argv[])
gtk_tree_view_set_model (GTK_TREE_VIEW (tv), GTK_TREE_MODEL (store)); gtk_tree_view_set_model (GTK_TREE_VIEW (tv), GTK_TREE_MODEL (store));
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture),
GTK_PHASE_CAPTURE); GTK_PHASE_CAPTURE);
g_signal_connect (gesture, "released", g_signal_connect (gesture, "released",

View File

@ -1,7 +1,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
static void static void
start_resize (GtkGestureMultiPress *gesture, start_resize (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -39,7 +39,7 @@ resize_button (GdkSurfaceEdge edge)
button = gtk_image_new_from_icon_name ("view-fullscreen-symbolic"); button = gtk_image_new_from_icon_name ("view-fullscreen-symbolic");
gtk_widget_set_hexpand (button, TRUE); gtk_widget_set_hexpand (button, TRUE);
gtk_widget_set_vexpand (button, TRUE); gtk_widget_set_vexpand (button, TRUE);
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
g_signal_connect (gesture, "pressed", G_CALLBACK (start_resize), GINT_TO_POINTER (edge)); g_signal_connect (gesture, "pressed", G_CALLBACK (start_resize), GINT_TO_POINTER (edge));
gtk_widget_add_controller (button, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (button, GTK_EVENT_CONTROLLER (gesture));
@ -47,7 +47,7 @@ resize_button (GdkSurfaceEdge edge)
} }
static void static void
start_move (GtkGestureMultiPress *gesture, start_move (GtkGestureClick *gesture,
int n_press, int n_press,
double x, double x,
double y, double y,
@ -83,7 +83,7 @@ move_button (void)
button = gtk_image_new_from_icon_name ("view-grid-symbolic"); button = gtk_image_new_from_icon_name ("view-grid-symbolic");
gtk_widget_set_hexpand (button, TRUE); gtk_widget_set_hexpand (button, TRUE);
gtk_widget_set_vexpand (button, TRUE); gtk_widget_set_vexpand (button, TRUE);
gesture = gtk_gesture_multi_press_new (); gesture = gtk_gesture_click_new ();
g_signal_connect (gesture, "pressed", G_CALLBACK (start_move), NULL); g_signal_connect (gesture, "pressed", G_CALLBACK (start_move), NULL);
gtk_widget_add_controller (button, GTK_EVENT_CONTROLLER (gesture)); gtk_widget_add_controller (button, GTK_EVENT_CONTROLLER (gesture));

View File

@ -341,7 +341,7 @@ add_gesture (GtkWidget *w, const gchar *name, GtkPropagationPhase phase, GString
data->str = str; data->str = str;
data->state = state; data->state = state;
g = gtk_gesture_multi_press_new (); g = gtk_gesture_click_new ();
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (g), FALSE); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (g), FALSE);
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (g), 1); gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (g), 1);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (g), phase); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (g), phase);