mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
container: Remove include_internals parameter from forall
with include_internals=TRUE, this is the same as the (still private) gtk_widget_forall, or just using the children/sibling accessors in a loop.
This commit is contained in:
parent
066c1983ba
commit
f053a63d74
@ -200,7 +200,6 @@ gtk_fishbowl_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_fishbowl_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
@ -209,9 +208,6 @@ gtk_fishbowl_forall (GtkContainer *container,
|
||||
GtkFishbowlChild *child;
|
||||
GList *children;
|
||||
|
||||
if (!include_internals)
|
||||
return;
|
||||
|
||||
children = priv->children;
|
||||
while (children)
|
||||
{
|
||||
|
@ -112,27 +112,19 @@ gtk_action_bar_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_action_bar_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (GTK_ACTION_BAR (container));
|
||||
|
||||
if (include_internals)
|
||||
{
|
||||
(*callback) (priv->revealer, callback_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (priv->start_box != NULL)
|
||||
gtk_container_forall (GTK_CONTAINER (priv->start_box), callback, callback_data);
|
||||
if (priv->start_box != NULL)
|
||||
gtk_container_forall (GTK_CONTAINER (priv->start_box), callback, callback_data);
|
||||
|
||||
if (gtk_center_box_get_center_widget (GTK_CENTER_BOX (priv->center_box)) != NULL)
|
||||
(*callback) (gtk_center_box_get_center_widget (GTK_CENTER_BOX (priv->center_box)), callback_data);
|
||||
if (gtk_center_box_get_center_widget (GTK_CENTER_BOX (priv->center_box)) != NULL)
|
||||
(*callback) (gtk_center_box_get_center_widget (GTK_CENTER_BOX (priv->center_box)), callback_data);
|
||||
|
||||
if (priv->end_box != NULL)
|
||||
gtk_container_forall (GTK_CONTAINER (priv->end_box), callback, callback_data);
|
||||
}
|
||||
if (priv->end_box != NULL)
|
||||
gtk_container_forall (GTK_CONTAINER (priv->end_box), callback, callback_data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -692,7 +692,6 @@ gtk_application_window_real_unmap (GtkWidget *widget)
|
||||
|
||||
static void
|
||||
gtk_application_window_real_forall_internal (GtkContainer *container,
|
||||
gboolean include_internal,
|
||||
GtkCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@ -702,7 +701,7 @@ gtk_application_window_real_forall_internal (GtkContainer *container,
|
||||
callback (window->priv->menubar, user_data);
|
||||
|
||||
GTK_CONTAINER_CLASS (gtk_application_window_parent_class)
|
||||
->forall (container, include_internal, callback, user_data);
|
||||
->forall (container, callback, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -51,7 +51,6 @@ static void gtk_bin_add (GtkContainer *container,
|
||||
static void gtk_bin_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_bin_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static GType gtk_bin_child_type (GtkContainer *container);
|
||||
@ -150,7 +149,6 @@ gtk_bin_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_bin_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -163,7 +163,6 @@ static void gtk_box_add (GtkContainer *container,
|
||||
static void gtk_box_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_box_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static void gtk_box_set_child_property (GtkContainer *container,
|
||||
@ -2290,7 +2289,6 @@ gtk_box_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_box_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -254,7 +254,6 @@ static void gtk_combo_box_menu_hide (GtkWidget *menu,
|
||||
static void gtk_combo_box_unset_model (GtkComboBox *combo_box);
|
||||
|
||||
static void gtk_combo_box_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static gboolean gtk_combo_box_scroll_event (GtkWidget *widget,
|
||||
@ -1739,7 +1738,6 @@ gtk_combo_box_unset_model (GtkComboBox *combo_box)
|
||||
|
||||
static void
|
||||
gtk_combo_box_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
@ -1747,12 +1745,6 @@ gtk_combo_box_forall (GtkContainer *container,
|
||||
GtkComboBoxPrivate *priv = combo_box->priv;
|
||||
GtkWidget *child;
|
||||
|
||||
if (include_internals)
|
||||
{
|
||||
if (priv->box)
|
||||
(* callback) (priv->box, callback_data);
|
||||
}
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (container));
|
||||
if (child && child != priv->cell_view)
|
||||
(* callback) (child, callback_data);
|
||||
|
@ -1910,15 +1910,12 @@ gtk_container_forall (GtkContainer *container,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkContainerClass *class;
|
||||
|
||||
g_return_if_fail (GTK_IS_CONTAINER (container));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
class = GTK_CONTAINER_GET_CLASS (container);
|
||||
|
||||
if (class->forall)
|
||||
class->forall (container, TRUE, callback, callback_data);
|
||||
gtk_widget_forall (GTK_WIDGET (container),
|
||||
callback,
|
||||
callback_data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1950,7 +1947,7 @@ gtk_container_foreach (GtkContainer *container,
|
||||
class = GTK_CONTAINER_GET_CLASS (container);
|
||||
|
||||
if (class->forall)
|
||||
class->forall (container, FALSE, callback, callback_data);
|
||||
class->forall (container, callback, callback_data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -82,7 +82,6 @@ struct _GtkContainerClass
|
||||
GtkWidget *widget);
|
||||
void (*check_resize) (GtkContainer *container);
|
||||
void (*forall) (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
void (*set_focus_child) (GtkContainer *container,
|
||||
|
@ -106,7 +106,6 @@ static void gtk_fixed_add (GtkContainer *container,
|
||||
static void gtk_fixed_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_fixed_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static GType gtk_fixed_child_type (GtkContainer *container);
|
||||
@ -498,7 +497,6 @@ gtk_fixed_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_fixed_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -3154,7 +3154,6 @@ gtk_flow_box_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_flow_box_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_target)
|
||||
{
|
||||
@ -4374,7 +4373,7 @@ gtk_flow_box_bind_model (GtkFlowBox *box,
|
||||
g_clear_object (&priv->bound_model);
|
||||
}
|
||||
|
||||
gtk_flow_box_forall (GTK_CONTAINER (box), FALSE, (GtkCallback) gtk_widget_destroy, NULL);
|
||||
gtk_flow_box_forall (GTK_CONTAINER (box), (GtkCallback) gtk_widget_destroy, NULL);
|
||||
|
||||
if (model == NULL)
|
||||
return;
|
||||
|
@ -128,7 +128,6 @@ static void gtk_frame_size_allocate (GtkWidget *widget,
|
||||
static void gtk_frame_remove (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
static void gtk_frame_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
@ -399,7 +398,6 @@ gtk_frame_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_frame_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -526,7 +526,6 @@ gtk_grid_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_grid_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -1656,7 +1656,6 @@ gtk_header_bar_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_header_bar_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
@ -1665,9 +1664,6 @@ gtk_header_bar_forall (GtkContainer *container,
|
||||
Child *child;
|
||||
GList *children;
|
||||
|
||||
if (include_internals && priv->titlebar_start_box != NULL)
|
||||
(* callback) (priv->titlebar_start_box, callback_data);
|
||||
|
||||
children = priv->children;
|
||||
while (children)
|
||||
{
|
||||
@ -1680,9 +1676,6 @@ gtk_header_bar_forall (GtkContainer *container,
|
||||
if (priv->custom_title != NULL)
|
||||
(* callback) (priv->custom_title, callback_data);
|
||||
|
||||
if (include_internals && priv->label_box != NULL)
|
||||
(* callback) (priv->label_box, callback_data);
|
||||
|
||||
children = priv->children;
|
||||
while (children)
|
||||
{
|
||||
@ -1691,9 +1684,6 @@ gtk_header_bar_forall (GtkContainer *container,
|
||||
if (child->pack_type == GTK_PACK_END)
|
||||
(* callback) (child->widget, callback_data);
|
||||
}
|
||||
|
||||
if (include_internals && priv->titlebar_end_box != NULL)
|
||||
(* callback) (priv->titlebar_end_box, callback_data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -176,7 +176,6 @@ static gboolean gtk_icon_view_key_release (GtkWidget
|
||||
static void gtk_icon_view_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_icon_view_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
@ -1987,7 +1986,6 @@ gtk_icon_view_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_icon_view_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -137,7 +137,6 @@ static void gtk_layout_add (GtkContainer *container,
|
||||
static void gtk_layout_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_layout_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static void gtk_layout_set_child_property (GtkContainer *container,
|
||||
@ -935,7 +934,6 @@ gtk_layout_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_layout_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -221,7 +221,6 @@ static void gtk_list_box_add (GtkContai
|
||||
static void gtk_list_box_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_list_box_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_target);
|
||||
static void gtk_list_box_compute_expand (GtkWidget *widget,
|
||||
@ -2166,10 +2165,7 @@ gtk_list_box_realize (GtkWidget *widget)
|
||||
&allocation);
|
||||
gdk_window_set_user_data (priv->view_window, (GObject*) widget);
|
||||
|
||||
gtk_list_box_forall (GTK_CONTAINER (widget),
|
||||
TRUE,
|
||||
(GtkCallback) gtk_widget_set_parent_window,
|
||||
priv->view_window);
|
||||
gtk_widget_forall (widget, (GtkCallback)gtk_widget_set_parent_window, priv->view_window);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_list_box_parent_class)->realize (widget);
|
||||
}
|
||||
@ -2567,7 +2563,6 @@ gtk_list_box_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_list_box_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_target)
|
||||
{
|
||||
@ -2583,8 +2578,6 @@ gtk_list_box_forall (GtkContainer *container,
|
||||
{
|
||||
row = g_sequence_get (iter);
|
||||
iter = g_sequence_iter_next (iter);
|
||||
if (ROW_PRIV (row)->header != NULL && include_internals)
|
||||
callback (ROW_PRIV (row)->header, callback_target);
|
||||
callback (GTK_WIDGET (row), callback_target);
|
||||
}
|
||||
}
|
||||
@ -3929,7 +3922,7 @@ gtk_list_box_bind_model (GtkListBox *box,
|
||||
g_clear_object (&priv->bound_model);
|
||||
}
|
||||
|
||||
gtk_list_box_forall (GTK_CONTAINER (box), FALSE, (GtkCallback) gtk_widget_destroy, NULL);
|
||||
gtk_list_box_forall (GTK_CONTAINER (box), (GtkCallback) gtk_widget_destroy, NULL);
|
||||
|
||||
if (model == NULL)
|
||||
return;
|
||||
|
@ -166,7 +166,6 @@ static void gtk_menu_item_ensure_label (GtkMenuItem *menu_item);
|
||||
static gint gtk_menu_item_popup_timeout (gpointer data);
|
||||
|
||||
static void gtk_menu_item_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
@ -1926,7 +1925,6 @@ gtk_menu_item_get_accel_path (GtkMenuItem *menu_item)
|
||||
|
||||
static void
|
||||
gtk_menu_item_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -136,7 +136,6 @@ static void gtk_menu_shell_add (GtkContainer *container,
|
||||
static void gtk_menu_shell_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_menu_shell_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static void gtk_menu_shell_real_insert (GtkMenuShell *menu_shell,
|
||||
@ -1092,7 +1091,6 @@ gtk_menu_shell_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_menu_shell_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -448,7 +448,6 @@ static void gtk_notebook_set_focus_child (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
static GType gtk_notebook_child_type (GtkContainer *container);
|
||||
static void gtk_notebook_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
@ -4408,14 +4407,12 @@ gtk_notebook_set_focus_child (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_notebook_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK (container);
|
||||
GtkNotebookPrivate *priv = notebook->priv;
|
||||
GList *children;
|
||||
gint i;
|
||||
|
||||
children = priv->children;
|
||||
while (children)
|
||||
@ -4425,21 +4422,6 @@ gtk_notebook_forall (GtkContainer *container,
|
||||
page = children->data;
|
||||
children = children->next;
|
||||
(* callback) (page->child, callback_data);
|
||||
|
||||
if (include_internals)
|
||||
{
|
||||
if (page->tab_label)
|
||||
(* callback) (page->tab_label, callback_data);
|
||||
}
|
||||
}
|
||||
|
||||
if (include_internals)
|
||||
{
|
||||
for (i = 0; i < N_ACTION_WIDGETS; i++)
|
||||
{
|
||||
if (priv->action_widget[i])
|
||||
(* callback) (priv->action_widget[i], callback_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -596,7 +596,6 @@ gtk_overlay_reorder_overlay (GtkOverlay *overlay,
|
||||
|
||||
static void
|
||||
gtk_overlay_forall (GtkContainer *overlay,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -235,7 +235,6 @@ static void gtk_paned_add (GtkContainer *container,
|
||||
static void gtk_paned_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_paned_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static void gtk_paned_calc_position (GtkPaned *paned,
|
||||
@ -2179,7 +2178,6 @@ gtk_paned_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_paned_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -133,7 +133,6 @@ static void gtk_path_bar_add (GtkContainer *container,
|
||||
static void gtk_path_bar_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_path_bar_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static gboolean gtk_path_bar_scroll (GtkWidget *widget,
|
||||
@ -839,7 +838,6 @@ gtk_path_bar_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_path_bar_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -329,10 +329,6 @@ static void gtk_scrolled_window_add (GtkContainer *conta
|
||||
GtkWidget *widget);
|
||||
static void gtk_scrolled_window_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_scrolled_window_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static gboolean gtk_scrolled_window_scroll_child (GtkScrolledWindow *scrolled_window,
|
||||
GtkScrollType scroll,
|
||||
gboolean horizontal);
|
||||
@ -532,7 +528,6 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
|
||||
|
||||
container_class->add = gtk_scrolled_window_add;
|
||||
container_class->remove = gtk_scrolled_window_remove;
|
||||
container_class->forall = gtk_scrolled_window_forall;
|
||||
|
||||
class->scroll_child = gtk_scrolled_window_scroll_child;
|
||||
class->move_focus_out = gtk_scrolled_window_move_focus_out;
|
||||
@ -2857,31 +2852,6 @@ gtk_scrolled_window_snapshot (GtkWidget *widget,
|
||||
gtk_css_gadget_snapshot (priv->gadget, snapshot);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_scrolled_window_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkScrolledWindowPrivate *priv;
|
||||
GtkScrolledWindow *scrolled_window;
|
||||
|
||||
GTK_CONTAINER_CLASS (gtk_scrolled_window_parent_class)->forall (container,
|
||||
include_internals,
|
||||
callback,
|
||||
callback_data);
|
||||
if (include_internals)
|
||||
{
|
||||
scrolled_window = GTK_SCROLLED_WINDOW (container);
|
||||
priv = scrolled_window->priv;
|
||||
|
||||
if (priv->vscrollbar)
|
||||
callback (priv->vscrollbar, callback_data);
|
||||
if (priv->hscrollbar)
|
||||
callback (priv->hscrollbar, callback_data);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_scrolled_window_scroll_child (GtkScrolledWindow *scrolled_window,
|
||||
GtkScrollType scroll,
|
||||
|
@ -157,7 +157,6 @@ gtk_shortcuts_group_add (GtkContainer *container,
|
||||
typedef struct {
|
||||
GtkCallback callback;
|
||||
gpointer data;
|
||||
gboolean include_internal;
|
||||
} CallbackData;
|
||||
|
||||
static void
|
||||
@ -167,23 +166,21 @@ forall_cb (GtkWidget *widget, gpointer data)
|
||||
CallbackData *cbdata = data;
|
||||
|
||||
self = GTK_SHORTCUTS_GROUP (gtk_widget_get_parent (widget));
|
||||
if (cbdata->include_internal || widget != (GtkWidget*)self->title)
|
||||
if (widget != (GtkWidget*)self->title)
|
||||
cbdata->callback (widget, cbdata->data);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_shortcuts_group_forall (GtkContainer *container,
|
||||
gboolean include_internal,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
CallbackData cbdata;
|
||||
|
||||
cbdata.include_internal = include_internal;
|
||||
cbdata.callback = callback;
|
||||
cbdata.data = callback_data;
|
||||
|
||||
GTK_CONTAINER_CLASS (gtk_shortcuts_group_parent_class)->forall (container, include_internal, forall_cb, &cbdata);
|
||||
GTK_CONTAINER_CLASS (gtk_shortcuts_group_parent_class)->forall (container, forall_cb, &cbdata);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -154,24 +154,16 @@ gtk_shortcuts_section_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_shortcuts_section_forall (GtkContainer *container,
|
||||
gboolean include_internal,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkShortcutsSection *self = (GtkShortcutsSection *)container;
|
||||
GList *l;
|
||||
|
||||
if (include_internal)
|
||||
for (l = self->groups; l; l = l->next)
|
||||
{
|
||||
GTK_CONTAINER_CLASS (gtk_shortcuts_section_parent_class)->forall (container, include_internal, callback, callback_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (l = self->groups; l; l = l->next)
|
||||
{
|
||||
GtkWidget *group = l->data;
|
||||
callback (group, callback_data);
|
||||
}
|
||||
GtkWidget *group = l->data;
|
||||
callback (group, callback_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -376,38 +376,29 @@ gtk_shortcuts_window_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_shortcuts_window_forall (GtkContainer *container,
|
||||
gboolean include_internal,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkShortcutsWindow *self = (GtkShortcutsWindow *)container;
|
||||
GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
|
||||
|
||||
if (include_internal)
|
||||
if (priv->stack)
|
||||
{
|
||||
GTK_CONTAINER_CLASS (gtk_shortcuts_window_parent_class)->forall (container, include_internal, callback, callback_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (priv->stack)
|
||||
GList *children, *l;
|
||||
GtkWidget *search;
|
||||
GtkWidget *empty;
|
||||
|
||||
search = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "internal-search");
|
||||
empty = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "no-search-results");
|
||||
children = gtk_container_get_children (GTK_CONTAINER (priv->stack));
|
||||
for (l = children; l; l = l->next)
|
||||
{
|
||||
GList *children, *l;
|
||||
GtkWidget *search;
|
||||
GtkWidget *empty;
|
||||
GtkWidget *child = l->data;
|
||||
|
||||
search = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "internal-search");
|
||||
empty = gtk_stack_get_child_by_name (GTK_STACK (priv->stack), "no-search-results");
|
||||
children = gtk_container_get_children (GTK_CONTAINER (priv->stack));
|
||||
for (l = children; l; l = l->next)
|
||||
{
|
||||
GtkWidget *child = l->data;
|
||||
|
||||
if (include_internal ||
|
||||
(child != search && child != empty))
|
||||
callback (child, callback_data);
|
||||
}
|
||||
g_list_free (children);
|
||||
if (child != search && child != empty)
|
||||
callback (child, callback_data);
|
||||
}
|
||||
g_list_free (children);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,6 @@ static void gtk_stack_add (GtkContainer *widget,
|
||||
static void gtk_stack_remove (GtkContainer *widget,
|
||||
GtkWidget *child);
|
||||
static void gtk_stack_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static void gtk_stack_compute_expand (GtkWidget *widget,
|
||||
@ -1852,7 +1851,6 @@ gtk_stack_set_visible_child_full (GtkStack *stack,
|
||||
|
||||
static void
|
||||
gtk_stack_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -592,7 +592,6 @@ static void gtk_text_view_add (GtkContainer *container,
|
||||
static void gtk_text_view_remove (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
static void gtk_text_view_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
@ -6039,7 +6038,6 @@ gtk_text_view_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_text_view_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -234,7 +234,6 @@ static void gtk_toolbar_add (GtkContainer *contain
|
||||
static void gtk_toolbar_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_toolbar_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static GType gtk_toolbar_child_type (GtkContainer *container);
|
||||
@ -2366,7 +2365,6 @@ gtk_toolbar_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_toolbar_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
@ -2382,7 +2380,7 @@ gtk_toolbar_forall (GtkContainer *container,
|
||||
ToolbarContent *content = list->data;
|
||||
GList *next = list->next;
|
||||
|
||||
if (include_internals || !toolbar_content_is_placeholder (content))
|
||||
if (!toolbar_content_is_placeholder (content))
|
||||
{
|
||||
GtkWidget *child = toolbar_content_get_widget (content);
|
||||
|
||||
@ -2392,9 +2390,6 @@ gtk_toolbar_forall (GtkContainer *container,
|
||||
|
||||
list = next;
|
||||
}
|
||||
|
||||
if (include_internals && priv->arrow_button)
|
||||
callback (priv->arrow_button, callback_data);
|
||||
}
|
||||
|
||||
static GType
|
||||
|
@ -1312,7 +1312,6 @@ gtk_tool_item_group_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_tool_item_group_forall (GtkContainer *container,
|
||||
gboolean internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
@ -1320,9 +1319,6 @@ gtk_tool_item_group_forall (GtkContainer *container,
|
||||
GtkToolItemGroupPrivate* priv = group->priv;
|
||||
GList *children;
|
||||
|
||||
if (internals && priv->header)
|
||||
callback (priv->header, callback_data);
|
||||
|
||||
children = priv->children;
|
||||
while (children)
|
||||
{
|
||||
|
@ -791,7 +791,6 @@ gtk_tool_palette_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_tool_palette_forall (GtkContainer *container,
|
||||
gboolean internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
|
@ -624,7 +624,6 @@ static void gtk_tree_view_style_updated (GtkWidget *widget);
|
||||
static void gtk_tree_view_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_tree_view_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
|
||||
@ -8141,14 +8140,11 @@ gtk_tree_view_remove (GtkContainer *container,
|
||||
|
||||
static void
|
||||
gtk_tree_view_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
GtkTreeView *tree_view = GTK_TREE_VIEW (container);
|
||||
GtkTreeViewChild *child = NULL;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkWidget *button;
|
||||
GList *tmp_list;
|
||||
|
||||
tmp_list = tree_view->priv->children;
|
||||
@ -8159,17 +8155,6 @@ gtk_tree_view_forall (GtkContainer *container,
|
||||
|
||||
(* callback) (child->widget, callback_data);
|
||||
}
|
||||
if (include_internals == FALSE)
|
||||
return;
|
||||
|
||||
for (tmp_list = tree_view->priv->columns; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
column = tmp_list->data;
|
||||
button = gtk_tree_view_column_get_button (column);
|
||||
|
||||
if (button)
|
||||
(* callback) (button, callback_data);
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns TRUE is any of the columns contains a cell that can-focus.
|
||||
|
@ -430,7 +430,6 @@ static void gtk_window_remove (GtkContainer *container,
|
||||
GtkWidget *widget);
|
||||
static void gtk_window_check_resize (GtkContainer *container);
|
||||
static void gtk_window_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data);
|
||||
static gint gtk_window_focus (GtkWidget *widget,
|
||||
@ -7921,7 +7920,6 @@ gtk_window_check_resize (GtkContainer *container)
|
||||
|
||||
static void
|
||||
gtk_window_forall (GtkContainer *container,
|
||||
gboolean include_internals,
|
||||
GtkCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
@ -7929,23 +7927,12 @@ gtk_window_forall (GtkContainer *container,
|
||||
GtkWindowPrivate *priv = window->priv;
|
||||
GtkWidget *child;
|
||||
|
||||
if (include_internals)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = priv->popovers; l; l = l->next)
|
||||
{
|
||||
GtkWindowPopover *data = l->data;
|
||||
(* callback) (data->widget, callback_data);
|
||||
}
|
||||
}
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (container));
|
||||
if (child != NULL)
|
||||
(* callback) (child, callback_data);
|
||||
|
||||
if (priv->title_box != NULL &&
|
||||
(priv->titlebar == NULL || include_internals))
|
||||
priv->titlebar == NULL)
|
||||
(* callback) (priv->title_box, callback_data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user