[gtk+] widget: Get rid of unused flags
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Get rid of unused flags
- Date: Wed, 14 Nov 2012 01:05:18 +0000 (UTC)
commit 14c8e33ab93be91d76d1b301f824c36fd734a45a
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 13 22:16:51 2012 +0100
widget: Get rid of unused flags
Now that we clear the cache immediately, there's no need anymore to
track if a request has been queued.
gtk/gtkcontainer.c | 2 --
gtk/gtksizegroup.c | 2 --
gtk/gtksizerequest.c | 5 -----
gtk/gtkwidget.c | 39 +++------------------------------------
gtk/gtkwidgetprivate.h | 6 ------
5 files changed, 3 insertions(+), 51 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 6f50359..4377a5f 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1754,8 +1754,6 @@ _gtk_container_queue_resize_internal (GtkContainer *container,
do
{
_gtk_widget_set_alloc_needed (widget, TRUE);
- _gtk_widget_set_width_request_needed (widget, TRUE);
- _gtk_widget_set_height_request_needed (widget, TRUE);
_gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
if (GTK_IS_RESIZE_CONTAINER (widget))
diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c
index bcd9255..e5c370c 100644
--- a/gtk/gtksizegroup.c
+++ b/gtk/gtksizegroup.c
@@ -197,8 +197,6 @@ real_queue_resize (GtkWidget *widget,
GtkWidget *container;
_gtk_widget_set_alloc_needed (widget, TRUE);
- _gtk_widget_set_width_request_needed (widget, TRUE);
- _gtk_widget_set_height_request_needed (widget, TRUE);
_gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
container = gtk_widget_get_parent (widget);
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 99191f5..1ea000a 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -354,11 +354,6 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget,
G_OBJECT_TYPE_NAME (widget), widget, min_size, nat_size, get_vfunc_name (orientation, for_size));
}
- if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
- _gtk_widget_set_width_request_needed (widget, FALSE);
- else
- _gtk_widget_set_height_request_needed (widget, FALSE);
-
adjusted_min = min_size;
adjusted_natural = nat_size;
GTK_WIDGET_GET_CLASS (widget)->adjust_size_request (widget,
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 4a5c7fd..d313a73 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -344,8 +344,6 @@ struct _GtkWidgetPrivate
/* Queue-resize related flags */
guint alloc_needed : 1;
- guint width_request_needed : 1;
- guint height_request_needed : 1;
/* Expand-related flags */
guint need_compute_expand : 1; /* Need to recompute computed_[hv]_expand */
@@ -3674,8 +3672,6 @@ gtk_widget_init (GtkWidget *widget)
priv->composite_child = composite_child_stack != 0;
priv->double_buffered = TRUE;
priv->redraw_on_alloc = TRUE;
- priv->width_request_needed = TRUE;
- priv->height_request_needed = TRUE;
priv->alloc_needed = TRUE;
/* this will be set to TRUE if the widget gets a child or if the
@@ -4833,9 +4829,8 @@ gtk_widget_size_allocate (GtkWidget *widget,
#endif /* G_ENABLE_DEBUG */
alloc_needed = priv->alloc_needed;
- if (!priv->width_request_needed && !priv->height_request_needed)
- /* Preserve request/allocate ordering */
- priv->alloc_needed = FALSE;
+ /* Preserve request/allocate ordering */
+ priv->alloc_needed = FALSE;
old_allocation = priv->allocation;
real_allocation = *allocation;
@@ -4927,9 +4922,7 @@ gtk_widget_size_allocate (GtkWidget *widget,
g_signal_emit (widget, widget_signals[SIZE_ALLOCATE], 0, &real_allocation);
/* Size allocation is god... after consulting god, no further requests or allocations are needed */
- priv->width_request_needed = FALSE;
- priv->height_request_needed = FALSE;
- priv->alloc_needed = FALSE;
+ priv->alloc_needed = FALSE;
if (gtk_widget_get_mapped (widget))
{
@@ -13793,32 +13786,6 @@ _gtk_widget_set_alloc_needed (GtkWidget *widget,
widget->priv->alloc_needed = alloc_needed;
}
-gboolean
-_gtk_widget_get_width_request_needed (GtkWidget *widget)
-{
- return widget->priv->width_request_needed;
-}
-
-void
-_gtk_widget_set_width_request_needed (GtkWidget *widget,
- gboolean width_request_needed)
-{
- widget->priv->width_request_needed = width_request_needed;
-}
-
-gboolean
-_gtk_widget_get_height_request_needed (GtkWidget *widget)
-{
- return widget->priv->height_request_needed;
-}
-
-void
-_gtk_widget_set_height_request_needed (GtkWidget *widget,
- gboolean height_request_needed)
-{
- widget->priv->height_request_needed = height_request_needed;
-}
-
void
_gtk_widget_add_sizegroup (GtkWidget *widget,
gpointer group)
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index ca1bd24..78e0e35 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -45,12 +45,6 @@ void _gtk_widget_set_shadowed (GtkWidget *widget,
gboolean _gtk_widget_get_alloc_needed (GtkWidget *widget);
void _gtk_widget_set_alloc_needed (GtkWidget *widget,
gboolean alloc_needed);
-gboolean _gtk_widget_get_width_request_needed (GtkWidget *widget);
-void _gtk_widget_set_width_request_needed (GtkWidget *widget,
- gboolean width_request_needed);
-gboolean _gtk_widget_get_height_request_needed (GtkWidget *widget);
-void _gtk_widget_set_height_request_needed (GtkWidget *widget,
- gboolean height_request_needed);
void _gtk_widget_add_sizegroup (GtkWidget *widget,
gpointer group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]