[gtk+/wip/baedert/visible-widgets] widget: Remove show_all vfunc



commit c694c0e66865d1f8768ee7901bedea1e3cdb29b2
Author: Timm Bäder <mail baedert org>
Date:   Thu Jan 19 08:50:37 2017 +0100

    widget: Remove show_all vfunc

 gtk/gtkfilechooserwidget.c    |   18 ------------------
 gtk/gtkmenu.c                 |   10 ----------
 gtk/gtkmenuitem.c             |   16 ----------------
 gtk/gtkrecentchooserdefault.c |   13 -------------
 gtk/gtktoolbar.c              |   30 ------------------------------
 gtk/gtkwidget.c               |   29 +----------------------------
 gtk/gtkwidget.h               |    3 ---
 7 files changed, 1 insertions(+), 118 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index d0b7286..4f5af5b 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -455,7 +455,6 @@ static void     gtk_file_chooser_widget_get_property (GObject               *obj
                                                        GValue                *value,
                                                        GParamSpec            *pspec);
 static void     gtk_file_chooser_widget_dispose      (GObject               *object);
-static void     gtk_file_chooser_widget_show_all       (GtkWidget             *widget);
 static void     gtk_file_chooser_widget_realize        (GtkWidget             *widget);
 static void     gtk_file_chooser_widget_map            (GtkWidget             *widget);
 static void     gtk_file_chooser_widget_unmap          (GtkWidget             *widget);
@@ -3661,22 +3660,6 @@ gtk_file_chooser_widget_dispose (GObject *object)
   G_OBJECT_CLASS (gtk_file_chooser_widget_parent_class)->dispose (object);
 }
 
-/* We override show-all since we have internal widgets that
- * shouldn’t be shown when you call show_all(), like the filter
- * combo box.
- */
-static void
-gtk_file_chooser_widget_show_all (GtkWidget *widget)
-{
-  GtkFileChooserWidget *impl = (GtkFileChooserWidget *) widget;
-  GtkFileChooserWidgetPrivate *priv = impl->priv;
-
-  gtk_widget_show (widget);
-
-  if (priv->extra_widget)
-    gtk_widget_show_all (priv->extra_widget);
-}
-
 /* Handler for GtkWindow::set-focus; this is where we save the last-focused
  * widget on our toplevel.  See gtk_file_chooser_widget_hierarchy_changed()
  */
@@ -8099,7 +8082,6 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
   gobject_class->get_property = gtk_file_chooser_widget_get_property;
   gobject_class->dispose = gtk_file_chooser_widget_dispose;
 
-  widget_class->show_all = gtk_file_chooser_widget_show_all;
   widget_class->realize = gtk_file_chooser_widget_realize;
   widget_class->map = gtk_file_chooser_widget_map;
   widget_class->unmap = gtk_file_chooser_widget_unmap;
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index c70b3ea..105f98d 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -288,7 +288,6 @@ static void     gtk_menu_set_submenu_navigation_region (GtkMenu          *menu,
                                                         GdkEventCrossing *event);
  
 static void gtk_menu_deactivate     (GtkMenuShell      *menu_shell);
-static void gtk_menu_show_all       (GtkWidget         *widget);
 static void gtk_menu_position       (GtkMenu           *menu,
                                      gboolean           set_scroll_offset);
 static void gtk_menu_remove         (GtkContainer      *menu,
@@ -519,7 +518,6 @@ gtk_menu_class_init (GtkMenuClass *class)
   widget_class->scroll_event = gtk_menu_scroll;
   widget_class->key_press_event = gtk_menu_key_press;
   widget_class->motion_notify_event = gtk_menu_motion_notify;
-  widget_class->show_all = gtk_menu_show_all;
   widget_class->enter_notify_event = gtk_menu_enter_notify;
   widget_class->leave_notify_event = gtk_menu_leave_notify;
   widget_class->focus = gtk_menu_focus;
@@ -4760,14 +4758,6 @@ gtk_menu_select_item (GtkMenuShell *menu_shell,
   GTK_MENU_SHELL_CLASS (gtk_menu_parent_class)->select_item (menu_shell, menu_item);
 }
 
-
-static void
-gtk_menu_show_all (GtkWidget *widget)
-{
-  /* Show children, but not self. */
-  gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_show_all, NULL);
-}
-
 /**
  * gtk_menu_set_screen:
  * @menu: a #GtkMenu
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 4a52a4e..d2ae63a 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -164,7 +164,6 @@ static gboolean gtk_menu_item_mnemonic_activate     (GtkWidget   *widget,
 
 static void gtk_menu_item_ensure_label   (GtkMenuItem      *menu_item);
 static gint gtk_menu_item_popup_timeout  (gpointer          data);
-static void gtk_menu_item_show_all       (GtkWidget        *widget);
 
 static void gtk_menu_item_forall         (GtkContainer    *container,
                                           gboolean         include_internals,
@@ -595,7 +594,6 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
   widget_class->unmap = gtk_menu_item_unmap;
   widget_class->enter_notify_event = gtk_menu_item_enter;
   widget_class->leave_notify_event = gtk_menu_item_leave;
-  widget_class->show_all = gtk_menu_item_show_all;
   widget_class->mnemonic_activate = gtk_menu_item_mnemonic_activate;
   widget_class->parent_set = gtk_menu_item_parent_set;
   widget_class->can_activate_accel = gtk_menu_item_can_activate_accel;
@@ -1725,20 +1723,6 @@ _gtk_menu_item_popdown_submenu (GtkWidget *widget)
     }
 }
 
-static void
-gtk_menu_item_show_all (GtkWidget *widget)
-{
-  GtkMenuItem *menu_item = GTK_MENU_ITEM (widget);
-  GtkMenuItemPrivate *priv = menu_item->priv;
-
-  /* show children including submenu */
-  if (priv->submenu)
-    gtk_widget_show_all (priv->submenu);
-  gtk_container_foreach (GTK_CONTAINER (widget), (GtkCallback) gtk_widget_show_all, NULL);
-
-  gtk_widget_show (widget);
-}
-
 static gboolean
 gtk_menu_item_can_activate_accel (GtkWidget *widget,
                                   guint      signal_id)
diff --git a/gtk/gtkrecentchooserdefault.c b/gtk/gtkrecentchooserdefault.c
index f6c74da..6d85951 100644
--- a/gtk/gtkrecentchooserdefault.c
+++ b/gtk/gtkrecentchooserdefault.c
@@ -201,7 +201,6 @@ static GSList *          gtk_recent_chooser_default_list_filters       (GtkRecen
 
 
 static void gtk_recent_chooser_default_map      (GtkWidget *widget);
-static void gtk_recent_chooser_default_show_all (GtkWidget *widget);
 
 static void set_current_filter        (GtkRecentChooserDefault *impl,
                                       GtkRecentFilter         *filter);
@@ -306,7 +305,6 @@ _gtk_recent_chooser_default_class_init (GtkRecentChooserDefaultClass *klass)
   gobject_class->finalize = gtk_recent_chooser_default_finalize;
   
   widget_class->map = gtk_recent_chooser_default_map;
-  widget_class->show_all = gtk_recent_chooser_default_show_all;
   
   _gtk_recent_chooser_install_properties (gobject_class);
 
@@ -577,17 +575,6 @@ gtk_recent_chooser_default_finalize (GObject *object)
   G_OBJECT_CLASS (_gtk_recent_chooser_default_parent_class)->finalize (object);
 }
 
-/* override GtkWidget::show_all since we have internal widgets we wish to keep
- * hidden unless we decide otherwise, like the filter combo box.
- */
-static void
-gtk_recent_chooser_default_show_all (GtkWidget *widget)
-{
-  gtk_widget_show (widget);
-}
-
-
-
 /* Shows an error dialog set as transient for the specified window */
 static void
 error_message_with_parent (GtkWindow   *parent,
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index db198b3..c800077 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -229,7 +229,6 @@ static void       gtk_toolbar_get_child_property   (GtkContainer        *contain
                                                    GParamSpec          *pspec);
 static void       gtk_toolbar_finalize             (GObject             *object);
 static void       gtk_toolbar_dispose              (GObject             *object);
-static void       gtk_toolbar_show_all             (GtkWidget           *widget);
 static void       gtk_toolbar_add                  (GtkContainer        *container,
                                                    GtkWidget           *widget);
 static void       gtk_toolbar_remove               (GtkContainer        *container,
@@ -334,7 +333,6 @@ static void            toolbar_content_toolbar_reconfigured (ToolbarContent
 static GtkWidget *     toolbar_content_retrieve_menu_item   (ToolbarContent      *content);
 static gboolean        toolbar_content_has_proxy_menu_item  (ToolbarContent     *content);
 static gboolean        toolbar_content_is_separator         (ToolbarContent      *content);
-static void            toolbar_content_show_all             (ToolbarContent      *content);
 static void           toolbar_content_set_expand           (ToolbarContent      *content,
                                                             gboolean             expand);
 
@@ -423,7 +421,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
   widget_class->map = gtk_toolbar_map;
   widget_class->unmap = gtk_toolbar_unmap;
   widget_class->popup_menu = gtk_toolbar_popup_menu;
-  widget_class->show_all = gtk_toolbar_show_all;
   widget_class->direction_changed = gtk_toolbar_direction_changed;
   
   container_class->add    = gtk_toolbar_add;
@@ -2333,23 +2330,6 @@ gtk_toolbar_set_child_property (GtkContainer *container,
 }
 
 static void
-gtk_toolbar_show_all (GtkWidget *widget)
-{
-  GtkToolbar *toolbar = GTK_TOOLBAR (widget);
-  GtkToolbarPrivate *priv = toolbar->priv;
-  GList *list;
-
-  for (list = priv->content; list != NULL; list = list->next)
-    {
-      ToolbarContent *content = list->data;
-      
-      toolbar_content_show_all (content);
-    }
-  
-  gtk_widget_show (widget);
-}
-
-static void
 gtk_toolbar_add (GtkContainer *container,
                 GtkWidget    *widget)
 {
@@ -3401,16 +3381,6 @@ toolbar_content_set_expand (ToolbarContent *content,
   gtk_tool_item_set_expand (content->item, expand);
 }
 
-static void
-toolbar_content_show_all (ToolbarContent  *content)
-{
-  GtkWidget *widget;
-  
-  widget = toolbar_content_get_widget (content);
-  if (widget)
-    gtk_widget_show_all (widget);
-}
-
 /* GTK+ internal methods */
 gchar *
 _gtk_toolbar_elide_underscores (const gchar *original)
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index dc15025..00188ec 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -946,22 +946,6 @@ gtk_widget_real_snapshot (GtkWidget   *widget,
 }
 
 static void
-gtk_widget_real_show_all (GtkWidget *widget)
-{
-  GtkWidget *p;
-
-  for (p = gtk_widget_get_first_child (widget);
-       p != NULL;
-       p = gtk_widget_get_next_sibling (p))
-    {
-      if (!GTK_IS_POPOVER (p))
-        gtk_widget_show_all (p);
-    }
-
-  gtk_widget_show (widget);
-}
-
-static void
 gtk_widget_class_init (GtkWidgetClass *klass)
 {
   static GObjectNotifyContext cpn_context = { 0, NULL, NULL };
@@ -1009,7 +993,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   klass->activate_signal = 0;
   klass->dispatch_child_properties_changed = gtk_widget_dispatch_child_properties_changed;
   klass->show = gtk_widget_real_show;
-  klass->show_all = gtk_widget_real_show_all;
   klass->hide = gtk_widget_real_hide;
   klass->map = gtk_widget_real_map;
   klass->unmap = gtk_widget_real_unmap;
@@ -4411,17 +4394,7 @@ gtk_widget_hide_on_delete (GtkWidget *widget)
 void
 gtk_widget_show_all (GtkWidget *widget)
 {
-  GtkWidgetClass *class;
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  if (gtk_widget_get_no_show_all (widget))
-    return;
-
-  class = GTK_WIDGET_GET_CLASS (widget);
-
-  if (class->show_all)
-    class->show_all (widget);
+  gtk_widget_show (widget);
 }
 
 /**
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index d24661b..67622c1 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -139,8 +139,6 @@ struct _GtkWidget
  * @destroy: Signals that all holders of a reference to the widget
  *   should release the reference that they hold.
  * @show: Signal emitted when widget is shown
- * @show_all: Recursively shows a widget, and any child widgets (if the widget is
- * a container).
  * @hide: Signal emitted when widget is hidden.
  * @map: Signal emitted when widget is going to be mapped, that is
  *   when the widget is visible (which is controlled with
@@ -301,7 +299,6 @@ struct _GtkWidgetClass
   /* basics */
   void (* destroy)             (GtkWidget        *widget);
   void (* show)                       (GtkWidget        *widget);
-  void (* show_all)            (GtkWidget        *widget);
   void (* hide)                       (GtkWidget        *widget);
   void (* map)                (GtkWidget        *widget);
   void (* unmap)              (GtkWidget        *widget);


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