[gtk+/wip/cssvalue: 147/164] container: Split out a function
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssvalue: 147/164] container: Split out a function
- Date: Wed, 11 Apr 2012 14:52:16 +0000 (UTC)
commit 7e036e683cdb9326c2dc6efa35b2827d50327164
Author: Benjamin Otte <otte redhat com>
Date: Mon Apr 9 21:04:47 2012 +0200
container: Split out a function
gtk/gtkcontainer.c | 63 +++++++++++++++++++++++++-------------------
gtk/gtkcontainerprivate.h | 3 ++
2 files changed, 39 insertions(+), 27 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 75c7d53..2bba490 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1690,37 +1690,46 @@ _gtk_container_queue_resize_internal (GtkContainer *container,
while (widget);
if (widget && !invalidate_only)
- {
- container = GTK_CONTAINER (widget);
+ _gtk_container_queue_resize_handler (GTK_CONTAINER (widget));
+}
+
+void
+_gtk_container_queue_resize_handler (GtkContainer *container)
+{
+ GtkWidget *widget;
+
+ g_return_if_fail (GTK_IS_RESIZE_CONTAINER (container));
+
+ widget = GTK_WIDGET (container);
- if (gtk_widget_get_visible (widget) &&
- (gtk_widget_is_toplevel (widget) ||
- gtk_widget_get_realized (widget)))
+ if (gtk_widget_get_visible (widget) &&
+ (gtk_widget_is_toplevel (widget) ||
+ gtk_widget_get_realized (widget)))
+ {
+ switch (container->priv->resize_mode)
{
- switch (container->priv->resize_mode)
+ case GTK_RESIZE_QUEUE:
+ if (!_gtk_widget_get_resize_pending (widget))
{
- case GTK_RESIZE_QUEUE:
- if (!_gtk_widget_get_resize_pending (widget))
- {
- _gtk_widget_set_resize_pending (widget, TRUE);
- if (container_resize_queue == NULL)
- gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE,
- gtk_container_idle_sizer,
- NULL, NULL);
- container_resize_queue = g_slist_prepend (container_resize_queue, container);
- }
- break;
+ _gtk_widget_set_resize_pending (widget, TRUE);
+ if (container_resize_queue == NULL)
+ gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE,
+ gtk_container_idle_sizer,
+ NULL, NULL);
+ container_resize_queue = g_slist_prepend (container_resize_queue, container);
+ }
+ break;
- case GTK_RESIZE_IMMEDIATE:
- _gtk_style_context_validate (gtk_widget_get_style_context (widget),
- g_get_monotonic_time (),
- 0);
- break;
+ case GTK_RESIZE_IMMEDIATE:
+ _gtk_style_context_validate (gtk_widget_get_style_context (widget),
+ g_get_monotonic_time (),
+ 0);
+ gtk_container_check_resize (container);
- case GTK_RESIZE_PARENT:
- g_assert_not_reached ();
- break;
- }
+ case GTK_RESIZE_PARENT:
+ default:
+ g_assert_not_reached ();
+ break;
}
}
}
diff --git a/gtk/gtkcontainerprivate.h b/gtk/gtkcontainerprivate.h
index f96ae0b..81b485d 100644
--- a/gtk/gtkcontainerprivate.h
+++ b/gtk/gtkcontainerprivate.h
@@ -20,6 +20,8 @@
#ifndef __GTK_CONTAINER_PRIVATE_H__
#define __GTK_CONTAINER_PRIVATE_H__
+#include "gtkcontainer.h"
+
G_BEGIN_DECLS
@@ -29,6 +31,7 @@ void _gtk_container_resize_invalidate (GtkContainer *container);
void _gtk_container_clear_resize_widgets (GtkContainer *container);
gchar* _gtk_container_child_composite_name (GtkContainer *container,
GtkWidget *child);
+void _gtk_container_queue_resize_handler (GtkContainer *container);
void _gtk_container_dequeue_resize_handler (GtkContainer *container);
GList * _gtk_container_focus_sort (GtkContainer *container,
GList *children,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]