summaryrefslogtreecommitdiff
path: root/gtk/gtksizerequest.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-11-13 21:43:50 +0100
committerBenjamin Otte <otte@redhat.com>2012-11-14 01:55:28 +0100
commit4366f80aabea3ba790109bd75517f2339ff6188b (patch)
treea34e2e07b40330ff998d43804624176abc142b96 /gtk/gtksizerequest.c
parent15570dd63df718cbb321cd83a0bb41db22fa6234 (diff)
downloadgtk+-4366f80aabea3ba790109bd75517f2339ff6188b.tar.gz
sizerequestcache: Move functions
... into the sizerequestcache.c file.
Diffstat (limited to 'gtk/gtksizerequest.c')
-rw-r--r--gtk/gtksizerequest.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 8404bd6b29..51043edb90 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -84,52 +84,6 @@ pop_recursion_check (GtkWidget *widget,
}
-static void
-clear_cache (SizeRequestCache *cache,
- GtkSizeGroupMode orientation)
-{
- SizeRequest **sizes;
- gint i;
-
- if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
- {
- sizes = cache->widths;
-
- cache->widths = NULL;
- cache->cached_widths = 0;
- cache->last_cached_width = 0;
- cache->cached_base_width = FALSE;
- }
- else
- {
- sizes = cache->heights;
-
- cache->heights = NULL;
- cache->cached_heights = 0;
- cache->last_cached_height = 0;
- cache->cached_base_height = FALSE;
- }
-
- if (sizes)
- {
- for (i = 0; i < GTK_SIZE_REQUEST_CACHED_SIZES && sizes[i] != NULL; i++)
- g_slice_free (SizeRequest, sizes[i]);
-
- g_slice_free1 (sizeof (SizeRequest *) * GTK_SIZE_REQUEST_CACHED_SIZES, sizes);
- }
-}
-
-void
-_gtk_widget_free_cached_sizes (GtkWidget *widget)
-{
- SizeRequestCache *cache;
-
- cache = _gtk_widget_peek_request_cache (widget);
-
- clear_cache (cache, GTK_SIZE_GROUP_HORIZONTAL);
- clear_cache (cache, GTK_SIZE_GROUP_VERTICAL);
-}
-
/* This function checks if 'request_needed' flag is present
* and resets the cache state if a request is needed for
* a given orientation.
@@ -142,10 +96,10 @@ init_cache (GtkWidget *widget)
cache = _gtk_widget_peek_request_cache (widget);
if (_gtk_widget_get_width_request_needed (widget))
- clear_cache (cache, GTK_SIZE_GROUP_HORIZONTAL);
+ _gtk_size_request_cache_clear (cache, GTK_SIZE_GROUP_HORIZONTAL);
if (_gtk_widget_get_height_request_needed (widget))
- clear_cache (cache, GTK_SIZE_GROUP_VERTICAL);
+ _gtk_size_request_cache_clear (cache, GTK_SIZE_GROUP_VERTICAL);
return cache;
}