[gtk/wip/matthiasc/shortcut-4: 9/85] window: Get rid of public APIs that shouldn't be



commit e398f63bf6f4fdedb9e5784663ca9b0d594f6213
Author: Benjamin Otte <otte redhat com>
Date:   Wed Aug 15 06:19:52 2018 +0200

    window: Get rid of public APIs that shouldn't be
    
    Event controllers should have replaced all of them.
    And if they haven't, apps need to fix their code (I'm
    looking at you Gimp).

 docs/reference/gtk/gtk4-sections.txt |  3 --
 gtk/gtkwindow.c                      | 64 ++----------------------------------
 gtk/gtkwindow.h                      | 11 -------
 gtk/gtkwindowprivate.h               |  3 ++
 4 files changed, 5 insertions(+), 76 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 3a5b41d257..cfc8e03fde 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4272,9 +4272,6 @@ gtk_window_get_toplevels
 gtk_window_list_toplevels
 gtk_window_add_mnemonic
 gtk_window_remove_mnemonic
-gtk_window_mnemonic_activate
-gtk_window_activate_key
-gtk_window_propagate_key_event
 gtk_window_get_focus
 gtk_window_set_focus
 gtk_window_get_default_widget
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 95764e53f0..03bbc6fdd0 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -2593,7 +2593,7 @@ gtk_window_remove_mnemonic (GtkWindow *window,
   _gtk_window_notify_keys_changed (window);
 }
 
-/**
+/*
  * gtk_window_mnemonic_activate:
  * @window: a #GtkWindow
  * @keyval: the mnemonic
@@ -2603,7 +2603,7 @@ gtk_window_remove_mnemonic (GtkWindow *window,
  *
  * Returns: %TRUE if the activation is done.
  */
-gboolean
+static gboolean
 gtk_window_mnemonic_activate (GtkWindow      *window,
                              guint           keyval,
                              GdkModifierType modifier)
@@ -5522,66 +5522,6 @@ _gtk_window_query_nonaccels (GtkWindow      *window,
   return FALSE;
 }
 
-/**
- * gtk_window_propagate_key_event:
- * @window:  a #GtkWindow
- * @event:   a #GdkEvent
- *
- * Propagate a key press or release event to the focus widget and
- * up the focus container chain until a widget handles @event.
- * This is normally called by the default ::key_press_event and
- * ::key_release_event handlers for toplevel windows,
- * however in some cases it may be useful to call this directly when
- * overriding the standard key handling for a toplevel window.
- *
- * Returns: %TRUE if a widget in the focus chain handled the event.
- */
-gboolean
-gtk_window_propagate_key_event (GtkWindow *window,
-                                GdkEvent  *event)
-{
-  GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-  gboolean handled = FALSE;
-  GtkWidget *widget, *focus, *target;
-
-  g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
-
-  widget = GTK_WIDGET (window);
-
-  focus = priv->focus_widget;
-  if (focus)
-    g_object_ref (focus);
-  
-  target = focus;
-
-  while (!handled &&
-         focus && focus != widget &&
-         gtk_widget_get_root (focus) == GTK_ROOT (widget))
-    {
-      GtkWidget *parent;
-      
-      if (gtk_widget_is_sensitive (focus))
-        {
-          handled = gtk_widget_event (focus, (GdkEvent *)event, target);
-          if (handled)
-            break;
-        }
-
-      parent = _gtk_widget_get_parent (focus);
-      if (parent)
-        g_object_ref (parent);
-      
-      g_object_unref (focus);
-      
-      focus = parent;
-    }
-  
-  if (focus)
-    g_object_unref (focus);
-
-  return handled;
-}
-
 static GtkWindowRegion
 get_active_region_type (GtkWindow *window, gint x, gint y)
 {
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 8f4c964fee..88f55b013d 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -199,22 +199,11 @@ void     gtk_window_remove_mnemonic       (GtkWindow       *window,
                                           guint            keyval,
                                           GtkWidget       *target);
 GDK_AVAILABLE_IN_ALL
-gboolean gtk_window_mnemonic_activate     (GtkWindow       *window,
-                                          guint            keyval,
-                                          GdkModifierType  modifier);
-GDK_AVAILABLE_IN_ALL
 void     gtk_window_set_mnemonic_modifier (GtkWindow       *window,
                                           GdkModifierType  modifier);
 GDK_AVAILABLE_IN_ALL
 GdkModifierType gtk_window_get_mnemonic_modifier (GtkWindow *window);
 
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_window_activate_key          (GtkWindow        *window,
-                                          GdkEvent         *event);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_window_propagate_key_event   (GtkWindow        *window,
-                                          GdkEvent         *event);
-
 GDK_AVAILABLE_IN_ALL
 void     gtk_window_present            (GtkWindow *window);
 GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h
index 74031618df..e58d099811 100644
--- a/gtk/gtkwindowprivate.h
+++ b/gtk/gtkwindowprivate.h
@@ -69,6 +69,9 @@ gboolean        _gtk_window_query_nonaccels     (GtkWindow      *window,
                                                  guint           accel_key,
                                                  GdkModifierType accel_mods);
 
+gboolean         gtk_window_activate_key (GtkWindow *window,
+                                          GdkEvent  *event);
+
 void            _gtk_window_schedule_mnemonics_visible (GtkWindow *window);
 
 void            _gtk_window_notify_keys_changed (GtkWindow *window);


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