[gtk+/wip/matthiasc/kill-event-signals: 74/81] Drop ::enter/leave-notify-event



commit c84ded58e03718b0ee12c8b6b6b9348437bf60f1
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 2 13:37:02 2018 -0500

    Drop ::enter/leave-notify-event
    
    These signals are no longer used in GTK+ and have a (not quite
    perfect yet) replacement with GtkEventControllerMotion.
    
    If you need to catch the raw events, the generic ::event
    signal still works.

 gtk/gtkwidget.c |   70 +-----------------------------------------------------
 gtk/gtkwidget.h |    8 ------
 2 files changed, 2 insertions(+), 76 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 23de636..d6913c7 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -509,8 +509,6 @@ enum {
   MOTION_NOTIFY_EVENT,
   KEY_PRESS_EVENT,
   KEY_RELEASE_EVENT,
-  ENTER_NOTIFY_EVENT,
-  LEAVE_NOTIFY_EVENT,
   FOCUS_IN_EVENT,
   FOCUS_OUT_EVENT,
   GRAB_BROKEN_EVENT,
@@ -1017,8 +1015,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   klass->motion_notify_event = gtk_widget_real_motion_event;
   klass->key_press_event = gtk_widget_real_key_press_event;
   klass->key_release_event = gtk_widget_real_key_release_event;
-  klass->enter_notify_event = NULL;
-  klass->leave_notify_event = NULL;
   klass->focus_in_event = gtk_widget_real_focus_in_event;
   klass->focus_out_event = gtk_widget_real_focus_out_event;
   klass->drag_begin = NULL;
@@ -2083,64 +2079,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                               _gtk_marshal_BOOLEAN__OBJECTv);
 
   /**
-   * GtkWidget::enter-notify-event:
-   * @widget: the object which received the signal
-   * @event: (type Gdk.EventCrossing): the #GdkEventCrossing which triggered
-   *   this signal.
-   *
-   * The ::enter-notify-event will be emitted when the pointer enters
-   * the @widget's window.
-   *
-   * To receive this signal, the #GdkWindow associated to the widget needs
-   * to enable the #GDK_ENTER_NOTIFY_MASK mask.
-   *
-   * This signal will be sent to the grab widget if there is one.
-   *
-   * Returns: %TRUE to stop other handlers from being invoked for the event.
-   *   %FALSE to propagate the event further.
-   */
-  widget_signals[ENTER_NOTIFY_EVENT] =
-    g_signal_new (I_("enter-notify-event"),
-                 G_TYPE_FROM_CLASS (klass),
-                 G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
-                 G_STRUCT_OFFSET (GtkWidgetClass, enter_notify_event),
-                 _gtk_boolean_handled_accumulator, NULL,
-                 _gtk_marshal_BOOLEAN__OBJECT,
-                 G_TYPE_BOOLEAN, 1,
-                 GDK_TYPE_EVENT);
-  g_signal_set_va_marshaller (widget_signals[ENTER_NOTIFY_EVENT], G_TYPE_FROM_CLASS (klass),
-                              _gtk_marshal_BOOLEAN__OBJECTv);
-
-  /**
-   * GtkWidget::leave-notify-event:
-   * @widget: the object which received the signal
-   * @event: (type Gdk.EventCrossing): the #GdkEventCrossing which triggered
-   *   this signal.
-   *
-   * The ::leave-notify-event will be emitted when the pointer leaves
-   * the @widget's window.
-   *
-   * To receive this signal, the #GdkWindow associated to the widget needs
-   * to enable the #GDK_LEAVE_NOTIFY_MASK mask.
-   *
-   * This signal will be sent to the grab widget if there is one.
-   *
-   * Returns: %TRUE to stop other handlers from being invoked for the event.
-   *   %FALSE to propagate the event further.
-   */
-  widget_signals[LEAVE_NOTIFY_EVENT] =
-    g_signal_new (I_("leave-notify-event"),
-                 G_TYPE_FROM_CLASS (klass),
-                 G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
-                 G_STRUCT_OFFSET (GtkWidgetClass, leave_notify_event),
-                 _gtk_boolean_handled_accumulator, NULL,
-                 _gtk_marshal_BOOLEAN__OBJECT,
-                 G_TYPE_BOOLEAN, 1,
-                 GDK_TYPE_EVENT);
-  g_signal_set_va_marshaller (widget_signals[LEAVE_NOTIFY_EVENT], G_TYPE_FROM_CLASS (klass),
-                              _gtk_marshal_BOOLEAN__OBJECTv);
-
-  /**
    * GtkWidget::focus-in-event:
    * @widget: the object which received the signal
    * @event: (type Gdk.EventFocus): the #GdkEventFocus which triggered
@@ -6319,6 +6257,8 @@ gtk_widget_emit_event_signals (GtkWidget      *widget,
        case GDK_MAP:
        case GDK_UNMAP:
        case GDK_CONFIGURE:
+       case GDK_ENTER_NOTIFY:
+       case GDK_LEAVE_NOTIFY:
        case GDK_NOTHING:
          signal_num = -1;
          break;
@@ -6337,12 +6277,6 @@ gtk_widget_emit_event_signals (GtkWidget      *widget,
        case GDK_KEY_RELEASE:
          signal_num = KEY_RELEASE_EVENT;
          break;
-       case GDK_ENTER_NOTIFY:
-         signal_num = ENTER_NOTIFY_EVENT;
-         break;
-       case GDK_LEAVE_NOTIFY:
-         signal_num = LEAVE_NOTIFY_EVENT;
-         break;
        case GDK_FOCUS_CHANGE:
          signal_num = event->focus_change.in ? FOCUS_IN_EVENT : FOCUS_OUT_EVENT;
          break;
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index cb2b7b5..aaabb7b 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -204,10 +204,6 @@ struct _GtkWidget
  *   the widget’s #GdkWindow.
  * @key_press_event: Signal emitted when a key is pressed.
  * @key_release_event: Signal is emitted when a key is released.
- * @enter_notify_event: Signal event will be emitted when the pointer
- *   enters the widget’s window.
- * @leave_notify_event: Will be emitted when the pointer leaves the
- *   widget’s window.
  * @focus_in_event: Signal emitted when the keyboard focus enters the
  * widget’s window.
  * @focus_out_event: Signal emitted when the keyboard focus leaves the
@@ -328,10 +324,6 @@ struct _GtkWidgetClass
                                         GdkEventKey         *event);
   gboolean (* key_release_event)       (GtkWidget           *widget,
                                         GdkEventKey         *event);
-  gboolean (* enter_notify_event)      (GtkWidget           *widget,
-                                        GdkEventCrossing    *event);
-  gboolean (* leave_notify_event)      (GtkWidget           *widget,
-                                        GdkEventCrossing    *event);
   gboolean (* focus_in_event)          (GtkWidget           *widget,
                                         GdkEventFocus       *event);
   gboolean (* focus_out_event)         (GtkWidget           *widget,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]