[gtk/readonly-events-1: 2/9] Drop gtk_widget_event from API
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/readonly-events-1: 2/9] Drop gtk_widget_event from API
- Date: Tue, 18 Feb 2020 05:01:18 +0000 (UTC)
commit 89158c2c102b18536286b87b6360e2f726e69aad
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 17 07:40:31 2020 -0500
Drop gtk_widget_event from API
We don't want events to be injected randomly from
the outside. Plus, there's no way to create such
events from the outside now.
gtk/gtkwidget.c | 37 ++++---------------------------------
gtk/gtkwidget.h | 4 ----
gtk/gtkwidgetprivate.h | 4 +++-
3 files changed, 7 insertions(+), 38 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index cfb0708a6d..6f64a3ae2a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -634,9 +634,6 @@ static void gtk_widget_propagate_state (GtkWidget
const GtkStateData *data);
static void gtk_widget_update_alpha (GtkWidget *widget);
-static gboolean gtk_widget_event_internal (GtkWidget *widget,
- GdkEvent *event,
- GtkWidget *target);
static gboolean gtk_widget_real_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling);
static void gtk_widget_real_measure (GtkWidget *widget,
@@ -4786,32 +4783,6 @@ gtk_widget_real_mnemonic_activate (GtkWidget *widget,
#define WIDGET_REALIZED_FOR_EVENT(widget, event) \
(gdk_event_get_event_type (event) == GDK_FOCUS_CHANGE || _gtk_widget_get_realized (widget))
-/**
- * gtk_widget_event:
- * @widget: a #GtkWidget
- * @event: a #GdkEvent
- *
- * Rarely-used function. This function is used to emit
- * the event signals on a widget (those signals should never
- * be emitted without using this function to do so).
- * If you want to synthesize an event though, don’t use this function;
- * instead, use gtk_main_do_event() so the event will behave as if
- * it were in the event queue.
- *
- * Returns: return from the event signal emission (%TRUE if
- * the event was handled)
- **/
-gboolean
-gtk_widget_event (GtkWidget *widget,
- GdkEvent *event,
- GtkWidget *target)
-{
- g_return_val_if_fail (GTK_IS_WIDGET (widget), TRUE);
- g_return_val_if_fail (WIDGET_REALIZED_FOR_EVENT (widget, event), TRUE);
-
- return gtk_widget_event_internal (widget, event, target);
-}
-
gboolean
gtk_widget_run_controllers (GtkWidget *widget,
GdkEvent *event,
@@ -4989,10 +4960,10 @@ translate_event_coordinates (GdkEvent *event,
return TRUE;
}
-static gboolean
-gtk_widget_event_internal (GtkWidget *widget,
- GdkEvent *event,
- GtkWidget *target)
+gboolean
+gtk_widget_event (GtkWidget *widget,
+ GdkEvent *event,
+ GtkWidget *target)
{
gboolean return_val = FALSE;
double x, y;
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 4e43fff36a..92272125e8 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -398,10 +398,6 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling);
GDK_AVAILABLE_IN_ALL
-gboolean gtk_widget_event (GtkWidget *widget,
- GdkEvent *event,
- GtkWidget *target);
-GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_activate (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 7ba6c12bcd..b3519f04b8 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -342,7 +342,9 @@ void gtk_widget_cancel_event_sequence (GtkWidget
GtkGesture *gesture,
GdkEventSequence *sequence,
GtkEventSequenceState state);
-
+gboolean gtk_widget_event (GtkWidget *widget,
+ GdkEvent *event,
+ GtkWidget *target);
gboolean gtk_widget_run_controllers (GtkWidget *widget,
GdkEvent *event,
GtkWidget *target,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]