[gtk+/wip/otte/queue-resize: 28/31] widget: Move resize function into gtkwidget.c
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/queue-resize: 28/31] widget: Move resize function into gtkwidget.c
- Date: Tue, 29 Sep 2015 21:24:08 +0000 (UTC)
commit 75ed90ae2c75bbf54fa8b5de4a512439f8e64aa6
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 28 21:54:23 2015 +0200
widget: Move resize function into gtkwidget.c
There's no sizegroup specific code left in it, but lots of
widget-specifics.
gtk/gtksizegroup-private.h | 1 -
gtk/gtksizegroup.c | 45 --------------------------------------
gtk/gtkwidget.c | 51 ++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 49 insertions(+), 48 deletions(-)
---
diff --git a/gtk/gtksizegroup-private.h b/gtk/gtksizegroup-private.h
index 6950844..c192c48 100644
--- a/gtk/gtksizegroup-private.h
+++ b/gtk/gtksizegroup-private.h
@@ -25,7 +25,6 @@ G_BEGIN_DECLS
GHashTable * _gtk_size_group_get_widget_peers (GtkWidget *for_widget,
GtkOrientation orientation);
-void _gtk_size_group_queue_resize (GtkWidget *widget);
G_END_DECLS
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index a30ab87..5d3eaf1 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -519,51 +519,6 @@ gtk_size_group_get_widgets (GtkSizeGroup *size_group)
return size_group->priv->widgets;
}
-/**
- * _gtk_size_group_queue_resize:
- * @widget: a #GtkWidget
- *
- * Queue a resize on a widget, and on all other widgets grouped with this widget.
- **/
-void
-_gtk_size_group_queue_resize (GtkWidget *widget)
-{
- GtkWidget *parent;
- GSList *groups, *l;
-
- parent = widget;
-
- do
- {
- if (gtk_widget_get_resize_needed (parent))
- return;
-
- gtk_widget_queue_resize_on_widget (parent);
-
-
- groups = _gtk_widget_get_sizegroups (parent);
-
- for (l = groups; l; l = l->next)
- {
- if (((GtkSizeGroup *) (l->data))->priv->ignore_hidden && !gtk_widget_is_visible (widget))
- continue;
-
- queue_resize_on_group (l->data);
- }
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- if (GTK_IS_RESIZE_CONTAINER (parent))
- {
- gtk_container_queue_resize_handler (GTK_CONTAINER (parent));
- break;
- }
-G_GNUC_END_IGNORE_DEPRECATIONS;
-
- parent = _gtk_widget_get_parent (parent);
- }
- while (parent);
-}
-
typedef struct {
gchar *name;
gint line;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index bb9e512..2e9e995 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5596,6 +5596,53 @@ gtk_widget_queue_allocate (GtkWidget *widget)
}
/**
+ * gtk_widget_queue_resize_internal:
+ * @widget: a #GtkWidget
+ *
+ * Queue a resize on a widget, and on all other widgets grouped with this widget.
+ **/
+void
+gtk_widget_queue_resize_internal (GtkWidget *widget)
+{
+ GtkWidget *parent;
+ GSList *groups, *l, *widgets;
+
+ parent = widget;
+
+ do
+ {
+ if (gtk_widget_get_resize_needed (parent))
+ return;
+
+ gtk_widget_queue_resize_on_widget (parent);
+
+ groups = _gtk_widget_get_sizegroups (parent);
+
+ for (l = groups; l; l = l->next)
+ {
+ if (gtk_size_group_get_ignore_hidden (l->data) && !gtk_widget_is_visible (widget))
+ continue;
+
+ for (widgets = gtk_size_group_get_widgets (l->data); widgets; widgets = widgets->next)
+ {
+ gtk_widget_queue_resize_internal (widgets->data);
+ }
+ }
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ if (GTK_IS_RESIZE_CONTAINER (parent))
+ {
+ gtk_container_queue_resize_handler (GTK_CONTAINER (parent));
+ break;
+ }
+G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ parent = _gtk_widget_get_parent (parent);
+ }
+ while (parent);
+}
+
+/**
* gtk_widget_queue_resize:
* @widget: a #GtkWidget
*
@@ -5618,7 +5665,7 @@ gtk_widget_queue_resize (GtkWidget *widget)
if (_gtk_widget_get_realized (widget))
gtk_widget_queue_draw (widget);
- _gtk_size_group_queue_resize (widget);
+ gtk_widget_queue_resize_internal (widget);
}
/**
@@ -5635,7 +5682,7 @@ gtk_widget_queue_resize_no_redraw (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
- _gtk_size_group_queue_resize (widget);
+ gtk_widget_queue_resize_internal (widget);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]