Commit 5f7787ab authored by Tristan Van Berkom's avatar Tristan Van Berkom

Removed tons of api that we dont absolutely need in GtkCellAreaContext:

  - gtk_cell_area_context_get_height_for_width()
  - gtk_cell_area_context_get_width_for_height()
  - gtk_cell_area_context_push_height_for_width()
  - gtk_cell_area_context_push_width_for_height()
  - gtk_cell_area_context_flush_height_for_width()
  - gtk_cell_area_context_flush_width_for_height()
  - Contextual size changed signal

All of these are not really important for the CellArea to operate
and not of any real consequential value to the user (the user can
accumulate the returned values from height-for-width requests
and do as they please with it).
parent 9d0c2f6b
...@@ -1284,8 +1284,7 @@ compute_size (GtkCellAreaBox *box, ...@@ -1284,8 +1284,7 @@ compute_size (GtkCellAreaBox *box,
for (i = 0; i < priv->groups->len; i++) for (i = 0; i < priv->groups->len; i++)
{ {
CellGroup *group = &g_array_index (priv->groups, CellGroup, i); CellGroup *group = &g_array_index (priv->groups, CellGroup, i);
gint group_min_size = 0; gint group_min = 0, group_nat = 0;
gint group_nat_size = 0;
for (list = group->cells; list; list = list->next) for (list = group->cells; list; list = list->next)
{ {
...@@ -1305,42 +1304,33 @@ compute_size (GtkCellAreaBox *box, ...@@ -1305,42 +1304,33 @@ compute_size (GtkCellAreaBox *box,
min_size += priv->spacing; min_size += priv->spacing;
nat_size += priv->spacing; nat_size += priv->spacing;
} }
if (group_min_size > 0) if (group_min > 0)
{ {
group_min_size += priv->spacing; group_min += priv->spacing;
group_nat_size += priv->spacing; group_nat += priv->spacing;
} }
min_size += renderer_min_size; min_size += renderer_min_size;
nat_size += renderer_nat_size; nat_size += renderer_nat_size;
group_min_size += renderer_min_size; group_min += renderer_min_size;
group_nat_size += renderer_nat_size; group_nat += renderer_nat_size;
} }
else else
{ {
min_size = MAX (min_size, renderer_min_size); min_size = MAX (min_size, renderer_min_size);
nat_size = MAX (nat_size, renderer_nat_size); nat_size = MAX (nat_size, renderer_nat_size);
group_min_size = MAX (group_min_size, renderer_min_size); group_min = MAX (group_min, renderer_min_size);
group_nat_size = MAX (group_nat_size, renderer_nat_size); group_nat = MAX (group_nat, renderer_nat_size);
} }
} }
if (orientation == GTK_ORIENTATION_HORIZONTAL) if (for_size < 0)
{
if (for_size < 0)
gtk_cell_area_box_context_push_group_width (context, group->id, group_min_size, group_nat_size);
else
gtk_cell_area_box_context_push_group_width_for_height (context, group->id, for_size,
group_min_size, group_nat_size);
}
else
{ {
if (for_size < 0) if (orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_cell_area_box_context_push_group_height (context, group->id, group_min_size, group_nat_size); gtk_cell_area_box_context_push_group_width (context, group->id, group_min, group_nat);
else else
gtk_cell_area_box_context_push_group_height_for_width (context, group->id, for_size, gtk_cell_area_box_context_push_group_height (context, group->id, group_min, group_nat);
group_min_size, group_nat_size);
} }
} }
...@@ -1529,17 +1519,6 @@ compute_size_for_opposing_orientation (GtkCellAreaBox *box, ...@@ -1529,17 +1519,6 @@ compute_size_for_opposing_orientation (GtkCellAreaBox *box,
min_size = MAX (min_size, group_min); min_size = MAX (min_size, group_min);
nat_size = MAX (nat_size, group_nat); nat_size = MAX (nat_size, group_nat);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_cell_area_box_context_push_group_height_for_width (context, group_idx, for_size,
group_min, group_nat);
}
else
{
gtk_cell_area_box_context_push_group_width_for_height (context, group_idx, for_size,
group_min, group_nat);
}
} }
*minimum_size = min_size; *minimum_size = min_size;
......
...@@ -32,31 +32,15 @@ static void gtk_cell_area_box_context_finalize (GOb ...@@ -32,31 +32,15 @@ static void gtk_cell_area_box_context_finalize (GOb
/* GtkCellAreaContextClass */ /* GtkCellAreaContextClass */
static void gtk_cell_area_box_context_flush_preferred_width (GtkCellAreaContext *context); static void gtk_cell_area_box_context_flush_preferred_width (GtkCellAreaContext *context);
static void gtk_cell_area_box_context_flush_preferred_height_for_width (GtkCellAreaContext *context,
gint width);
static void gtk_cell_area_box_context_flush_preferred_height (GtkCellAreaContext *context); static void gtk_cell_area_box_context_flush_preferred_height (GtkCellAreaContext *context);
static void gtk_cell_area_box_context_flush_preferred_width_for_height (GtkCellAreaContext *context,
gint height);
static void gtk_cell_area_box_context_flush_allocation (GtkCellAreaContext *context); static void gtk_cell_area_box_context_flush_allocation (GtkCellAreaContext *context);
static void gtk_cell_area_box_context_sum_preferred_width (GtkCellAreaContext *context); static void gtk_cell_area_box_context_sum_preferred_width (GtkCellAreaContext *context);
static void gtk_cell_area_box_context_sum_preferred_height_for_width (GtkCellAreaContext *context,
gint width);
static void gtk_cell_area_box_context_sum_preferred_height (GtkCellAreaContext *context); static void gtk_cell_area_box_context_sum_preferred_height (GtkCellAreaContext *context);
static void gtk_cell_area_box_context_sum_preferred_width_for_height (GtkCellAreaContext *context,
gint height);
static void gtk_cell_area_box_context_allocate_width (GtkCellAreaContext *context, static void gtk_cell_area_box_context_allocate_width (GtkCellAreaContext *context,
gint width); gint width);
static void gtk_cell_area_box_context_allocate_height (GtkCellAreaContext *context, static void gtk_cell_area_box_context_allocate_height (GtkCellAreaContext *context,
gint height); gint height);
static void free_cache_array (GArray *array);
/* CachedSize management */
typedef struct {
gint min_size;
gint nat_size;
} CachedSize;
typedef struct { typedef struct {
gint min_size; gint min_size;
gint nat_size; gint nat_size;
...@@ -69,10 +53,6 @@ struct _GtkCellAreaBoxContextPrivate ...@@ -69,10 +53,6 @@ struct _GtkCellAreaBoxContextPrivate
GArray *base_widths; GArray *base_widths;
GArray *base_heights; GArray *base_heights;
/* Table of per height/width hash tables of per renderer CachedSizes */
GHashTable *widths;
GHashTable *heights;
/* Allocation info for this context if any */ /* Allocation info for this context if any */
gint alloc_width; gint alloc_width;
gint alloc_height; gint alloc_height;
...@@ -82,12 +62,6 @@ struct _GtkCellAreaBoxContextPrivate ...@@ -82,12 +62,6 @@ struct _GtkCellAreaBoxContextPrivate
G_DEFINE_TYPE (GtkCellAreaBoxContext, gtk_cell_area_box_context, GTK_TYPE_CELL_AREA_CONTEXT); G_DEFINE_TYPE (GtkCellAreaBoxContext, gtk_cell_area_box_context, GTK_TYPE_CELL_AREA_CONTEXT);
static void
free_cache_array (GArray *array)
{
g_array_free (array, TRUE);
}
static void static void
gtk_cell_area_box_context_init (GtkCellAreaBoxContext *box_context) gtk_cell_area_box_context_init (GtkCellAreaBoxContext *box_context)
{ {
...@@ -101,11 +75,6 @@ gtk_cell_area_box_context_init (GtkCellAreaBoxContext *box_context) ...@@ -101,11 +75,6 @@ gtk_cell_area_box_context_init (GtkCellAreaBoxContext *box_context)
priv->base_widths = g_array_new (FALSE, TRUE, sizeof (BaseSize)); priv->base_widths = g_array_new (FALSE, TRUE, sizeof (BaseSize));
priv->base_heights = g_array_new (FALSE, TRUE, sizeof (BaseSize)); priv->base_heights = g_array_new (FALSE, TRUE, sizeof (BaseSize));
priv->widths = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify)free_cache_array);
priv->heights = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify)free_cache_array);
priv->alloc_width = 0; priv->alloc_width = 0;
priv->alloc_height = 0; priv->alloc_height = 0;
priv->orientation_allocs = NULL; priv->orientation_allocs = NULL;
...@@ -122,15 +91,11 @@ gtk_cell_area_box_context_class_init (GtkCellAreaBoxContextClass *class) ...@@ -122,15 +91,11 @@ gtk_cell_area_box_context_class_init (GtkCellAreaBoxContextClass *class)
object_class->finalize = gtk_cell_area_box_context_finalize; object_class->finalize = gtk_cell_area_box_context_finalize;
context_class->flush_preferred_width = gtk_cell_area_box_context_flush_preferred_width; context_class->flush_preferred_width = gtk_cell_area_box_context_flush_preferred_width;
context_class->flush_preferred_height_for_width = gtk_cell_area_box_context_flush_preferred_height_for_width;
context_class->flush_preferred_height = gtk_cell_area_box_context_flush_preferred_height; context_class->flush_preferred_height = gtk_cell_area_box_context_flush_preferred_height;
context_class->flush_preferred_width_for_height = gtk_cell_area_box_context_flush_preferred_width_for_height;
context_class->flush_allocation = gtk_cell_area_box_context_flush_allocation; context_class->flush_allocation = gtk_cell_area_box_context_flush_allocation;
context_class->sum_preferred_width = gtk_cell_area_box_context_sum_preferred_width; context_class->sum_preferred_width = gtk_cell_area_box_context_sum_preferred_width;
context_class->sum_preferred_height_for_width = gtk_cell_area_box_context_sum_preferred_height_for_width;
context_class->sum_preferred_height = gtk_cell_area_box_context_sum_preferred_height; context_class->sum_preferred_height = gtk_cell_area_box_context_sum_preferred_height;
context_class->sum_preferred_width_for_height = gtk_cell_area_box_context_sum_preferred_width_for_height;
context_class->allocate_width = gtk_cell_area_box_context_allocate_width; context_class->allocate_width = gtk_cell_area_box_context_allocate_width;
context_class->allocate_height = gtk_cell_area_box_context_allocate_height; context_class->allocate_height = gtk_cell_area_box_context_allocate_height;
...@@ -149,8 +114,6 @@ gtk_cell_area_box_context_finalize (GObject *object) ...@@ -149,8 +114,6 @@ gtk_cell_area_box_context_finalize (GObject *object)
g_array_free (priv->base_widths, TRUE); g_array_free (priv->base_widths, TRUE);
g_array_free (priv->base_heights, TRUE); g_array_free (priv->base_heights, TRUE);
g_hash_table_destroy (priv->widths);
g_hash_table_destroy (priv->heights);
g_free (priv->orientation_allocs); g_free (priv->orientation_allocs);
...@@ -179,23 +142,6 @@ gtk_cell_area_box_context_flush_preferred_width (GtkCellAreaContext *context) ...@@ -179,23 +142,6 @@ gtk_cell_area_box_context_flush_preferred_width (GtkCellAreaContext *context)
(gtk_cell_area_box_context_parent_class)->flush_preferred_width (context); (gtk_cell_area_box_context_parent_class)->flush_preferred_width (context);
} }
static void
gtk_cell_area_box_context_flush_preferred_height_for_width (GtkCellAreaContext *context,
gint width)
{
GtkCellAreaBoxContext *box_context = GTK_CELL_AREA_BOX_CONTEXT (context);
GtkCellAreaBoxContextPrivate *priv = box_context->priv;
/* Flush all sizes for special -1 value */
if (width < 0)
g_hash_table_remove_all (priv->heights);
else
g_hash_table_remove (priv->heights, GINT_TO_POINTER (width));
GTK_CELL_AREA_CONTEXT_CLASS
(gtk_cell_area_box_context_parent_class)->flush_preferred_height_for_width (context, width);
}
static void static void
gtk_cell_area_box_context_flush_preferred_height (GtkCellAreaContext *context) gtk_cell_area_box_context_flush_preferred_height (GtkCellAreaContext *context)
{ {
...@@ -215,23 +161,6 @@ gtk_cell_area_box_context_flush_preferred_height (GtkCellAreaContext *context) ...@@ -215,23 +161,6 @@ gtk_cell_area_box_context_flush_preferred_height (GtkCellAreaContext *context)
(gtk_cell_area_box_context_parent_class)->flush_preferred_height (context); (gtk_cell_area_box_context_parent_class)->flush_preferred_height (context);
} }
static void
gtk_cell_area_box_context_flush_preferred_width_for_height (GtkCellAreaContext *context,
gint height)
{
GtkCellAreaBoxContext *box_context = GTK_CELL_AREA_BOX_CONTEXT (context);
GtkCellAreaBoxContextPrivate *priv = box_context->priv;
/* Flush all sizes for special -1 value */
if (height < 0)
g_hash_table_remove_all (priv->widths);
else
g_hash_table_remove (priv->widths, GINT_TO_POINTER (height));
GTK_CELL_AREA_CONTEXT_CLASS
(gtk_cell_area_box_context_parent_class)->flush_preferred_width_for_height (context, height);
}
static void static void
gtk_cell_area_box_context_flush_allocation (GtkCellAreaContext *context) gtk_cell_area_box_context_flush_allocation (GtkCellAreaContext *context)
{ {
...@@ -285,55 +214,6 @@ gtk_cell_area_box_context_sum_preferred_width (GtkCellAreaContext *context) ...@@ -285,55 +214,6 @@ gtk_cell_area_box_context_sum_preferred_width (GtkCellAreaContext *context)
gtk_cell_area_context_push_preferred_width (context, min_size, nat_size); gtk_cell_area_context_push_preferred_width (context, min_size, nat_size);
} }
static void
gtk_cell_area_box_context_sum_preferred_height_for_width (GtkCellAreaContext *context,
gint width)
{
GtkCellAreaBoxContext *box_context = GTK_CELL_AREA_BOX_CONTEXT (context);
GtkCellAreaBoxContextPrivate *priv = box_context->priv;
GArray *group_array;
GtkCellArea *area;
GtkOrientation orientation;
gint spacing, i;
gint min_size = 0, nat_size = 0;
group_array = g_hash_table_lookup (priv->heights, GINT_TO_POINTER (width));
if (group_array)
{
area = gtk_cell_area_context_get_area (context);
spacing = gtk_cell_area_box_get_spacing (GTK_CELL_AREA_BOX (area));
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (area));
for (i = 0; i < group_array->len; i++)
{
CachedSize *size = &g_array_index (group_array, CachedSize, i);
if (orientation == GTK_ORIENTATION_VERTICAL)
{
/* Dont add spacing for 0 size groups, they can be 0 size because
* they contain only invisible cells for this round of requests
*/
if (min_size > 0 && size->nat_size > 0)
{
min_size += spacing;
nat_size += spacing;
}
min_size += size->min_size;
nat_size += size->nat_size;
}
else
{
min_size = MAX (min_size, size->min_size);
nat_size = MAX (nat_size, size->nat_size);
}
}
gtk_cell_area_context_push_preferred_height_for_width (context, width, min_size, nat_size);
}
}
static void static void
gtk_cell_area_box_context_sum_preferred_height (GtkCellAreaContext *context) gtk_cell_area_box_context_sum_preferred_height (GtkCellAreaContext *context)
{ {
...@@ -376,55 +256,6 @@ gtk_cell_area_box_context_sum_preferred_height (GtkCellAreaContext *context) ...@@ -376,55 +256,6 @@ gtk_cell_area_box_context_sum_preferred_height (GtkCellAreaContext *context)
gtk_cell_area_context_push_preferred_height (context, min_size, nat_size); gtk_cell_area_context_push_preferred_height (context, min_size, nat_size);
} }
static void
gtk_cell_area_box_context_sum_preferred_width_for_height (GtkCellAreaContext *context,
gint height)
{
GtkCellAreaBoxContext *box_context = GTK_CELL_AREA_BOX_CONTEXT (context);
GtkCellAreaBoxContextPrivate *priv = box_context->priv;
GArray *group_array;
GtkCellArea *area;
GtkOrientation orientation;
gint spacing, i;
gint min_size = 0, nat_size = 0;
group_array = g_hash_table_lookup (priv->widths, GINT_TO_POINTER (height));
if (group_array)
{
area = gtk_cell_area_context_get_area (context);
spacing = gtk_cell_area_box_get_spacing (GTK_CELL_AREA_BOX (area));
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (area));
for (i = 0; i < group_array->len; i++)
{
CachedSize *size = &g_array_index (group_array, CachedSize, i);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
/* Dont add spacing for 0 size groups, they can be 0 size because
* they contain only invisible cells for this round of requests
*/
if (min_size > 0 && size->nat_size > 0)
{
min_size += spacing;
nat_size += spacing;
}
min_size += size->min_size;
nat_size += size->nat_size;
}
else
{
min_size = MAX (min_size, size->min_size);
nat_size = MAX (nat_size, size->nat_size);
}
}
gtk_cell_area_context_push_preferred_width_for_height (context, height, min_size, nat_size);
}
}
static GtkRequestedSize * static GtkRequestedSize *
gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context, gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
GtkOrientation orientation, GtkOrientation orientation,
...@@ -658,36 +489,6 @@ gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context, ...@@ -658,36 +489,6 @@ gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context,
size->nat_size = MAX (size->nat_size, natural_width); size->nat_size = MAX (size->nat_size, natural_width);
} }
void
gtk_cell_area_box_context_push_group_height_for_width (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_width,
gint minimum_height,
gint natural_height)
{
GtkCellAreaBoxContextPrivate *priv;
GArray *group_array;
CachedSize *size;
g_return_if_fail (GTK_IS_CELL_AREA_BOX_CONTEXT (box_context));
priv = box_context->priv;
g_return_if_fail (group_idx < priv->base_widths->len);
group_array = g_hash_table_lookup (priv->heights, GINT_TO_POINTER (for_width));
if (!group_array)
{
group_array = g_array_new (FALSE, TRUE, sizeof (CachedSize));
g_array_set_size (group_array, priv->base_heights->len);
g_hash_table_insert (priv->heights, GINT_TO_POINTER (for_width), group_array);
}
size = &g_array_index (group_array, CachedSize, group_idx);
size->min_size = MAX (size->min_size, minimum_height);
size->nat_size = MAX (size->nat_size, natural_height);
}
void void
gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context, gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
gint group_idx, gint group_idx,
...@@ -707,36 +508,6 @@ gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context, ...@@ -707,36 +508,6 @@ gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
size->nat_size = MAX (size->nat_size, natural_height); size->nat_size = MAX (size->nat_size, natural_height);
} }
void
gtk_cell_area_box_context_push_group_width_for_height (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_height,
gint minimum_width,
gint natural_width)
{
GtkCellAreaBoxContextPrivate *priv;
GArray *group_array;
CachedSize *size;
g_return_if_fail (GTK_IS_CELL_AREA_BOX_CONTEXT (box_context));
priv = box_context->priv;
g_return_if_fail (group_idx < priv->base_widths->len);
group_array = g_hash_table_lookup (priv->widths, GINT_TO_POINTER (for_height));
if (!group_array)
{
group_array = g_array_new (FALSE, TRUE, sizeof (CachedSize));
g_array_set_size (group_array, priv->base_heights->len);
g_hash_table_insert (priv->widths, GINT_TO_POINTER (for_height), group_array);
}
size = &g_array_index (group_array, CachedSize, group_idx);
size->min_size = MAX (size->min_size, minimum_width);
size->nat_size = MAX (size->nat_size, natural_width);
}
void void
gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context, gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
gint group_idx, gint group_idx,
...@@ -760,43 +531,6 @@ gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context, ...@@ -760,43 +531,6 @@ gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
*natural_width = size->nat_size; *natural_width = size->nat_size;
} }
void
gtk_cell_area_box_context_get_group_height_for_width (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_width,
gint *minimum_height,
gint *natural_height)
{
GtkCellAreaBoxContextPrivate *priv;
GArray *group_array;
g_return_if_fail (GTK_IS_CELL_AREA_BOX_CONTEXT (box_context));
priv = box_context->priv;
g_return_if_fail (group_idx < priv->base_widths->len);
group_array = g_hash_table_lookup (priv->heights, GINT_TO_POINTER (for_width));
if (group_array)
{
CachedSize *size = &g_array_index (group_array, CachedSize, group_idx);
if (minimum_height)
*minimum_height = size->min_size;
if (natural_height)
*natural_height = size->nat_size;
}
else
{
if (minimum_height)
*minimum_height = -1;
if (natural_height)
*natural_height = -1;
}
}
void void
gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context, gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
gint group_idx, gint group_idx,
...@@ -820,43 +554,6 @@ gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context, ...@@ -820,43 +554,6 @@ gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
*natural_height = size->nat_size; *natural_height = size->nat_size;
} }
void
gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_height,
gint *minimum_width,
gint *natural_width)
{
GtkCellAreaBoxContextPrivate *priv;
GArray *group_array;
g_return_if_fail (GTK_IS_CELL_AREA_BOX_CONTEXT (box_context));
priv = box_context->priv;
g_return_if_fail (group_idx < priv->base_widths->len);
group_array = g_hash_table_lookup (priv->widths, GINT_TO_POINTER (for_height));
if (group_array)
{
CachedSize *size = &g_array_index (group_array, CachedSize, group_idx);
if (minimum_width)
*minimum_width = size->min_size;
if (natural_width)
*natural_width = size->nat_size;
}
else
{
if (minimum_width)
*minimum_width = -1;
if (natural_width)
*natural_width = -1;
}
}
GtkRequestedSize * GtkRequestedSize *
gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context, gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context,
gint *n_widths) gint *n_widths)
......
...@@ -72,47 +72,20 @@ void gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxCo ...@@ -72,47 +72,20 @@ void gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxCo
gint group_idx, gint group_idx,
gint minimum_width, gint minimum_width,
gint natural_width); gint natural_width);
void gtk_cell_area_box_context_push_group_height_for_width (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_width,
gint minimum_height,
gint natural_height);
void gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context, void gtk_cell_area_box_context_push_group_height (GtkCellAreaBoxContext *box_context,
gint group_idx, gint group_idx,
gint minimum_height, gint minimum_height,
gint natural_height); gint natural_height);
void gtk_cell_area_box_context_push_group_width_for_height (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_height,
gint minimum_width,
gint natural_width);
/* Fetch cell-group sizes */ /* Fetch cell-group sizes */
void gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context, void gtk_cell_area_box_context_get_group_width (GtkCellAreaBoxContext *box_context,
gint group_idx, gint group_idx,
gint *minimum_width, gint *minimum_width,
gint *natural_width); gint *natural_width);
void gtk_cell_area_box_context_get_group_height_for_width (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_width,
gint *minimum_height,
gint *natural_height);
void gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context, void gtk_cell_area_box_context_get_group_height (GtkCellAreaBoxContext *box_context,
gint group_idx, gint group_idx,
gint *minimum_height, gint *minimum_height,
gint *natural_height); gint *natural_height);
void gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *box_context,
gint group_idx,
gint for_height,
gint *minimum_width,
gint *natural_width);
GtkRequestedSize *gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context, GtkRequestedSize *gtk_cell_area_box_context_get_widths (GtkCellAreaBoxContext *box_context,
gint *n_widths); gint *n_widths);
GtkRequestedSize *gtk_cell_area_box_context_get_heights (GtkCellAreaBoxContext *box_context, GtkRequestedSize *gtk_cell_area_box_context_get_heights (GtkCellAreaBoxContext *box_context,
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "gtkprivate.h" #include "gtkprivate.h"
/* GObjectClass */ /* GObjectClass */
static void gtk_cell_area_context_finalize (GObject *object);
static void gtk_cell_area_context_dispose (GObject *object); static void gtk_cell_area_context_dispose (GObject *object);
static void gtk_cell_area_context_get_property (GObject *object, static void gtk_cell_area_context_get_property (GObject *object,
guint prop_id, guint prop_id,
...@@ -41,26 +40,13 @@ static void gtk_cell_area_context_set_property (GObject ...@@ -41,26 +40,13 @@ static void gtk_cell_area_context_set_property (GObject
/* GtkCellAreaContextClass */ /* GtkCellAreaContextClass */
static void gtk_cell_area_context_real_flush_preferred_width (GtkCellAreaContext *context); static void gtk_cell_area_context_real_flush_preferred_width (GtkCellAreaContext *context);
static void gtk_cell_area_context_real_flush_preferred_height_for_width (GtkCellAreaContext *context,
gint width);
static void gtk_cell_area_context_real_flush_preferred_height (GtkCellAreaContext *context); static void gtk_cell_area_context_real_flush_preferred_height (GtkCellAreaContext *context);
static void gtk_cell_area_context_real_flush_preferred_width_for_height (GtkCellAreaContext *context,
gint height);
static void gtk_cell_area_context_real_flush_allocation (GtkCellAreaContext *context); static void gtk_cell_area_context_real_flush_allocation (GtkCellAreaContext *context);
static void gtk_cell_area_context_real_allocate_width (GtkCellAreaContext *context, static void gtk_cell_area_context_real_allocate_width (GtkCellAreaContext *context,
gint width); gint width);
static void gtk_cell_area_context_real_allocate_height (GtkCellAreaContext *context, static void gtk_cell_area_context_real_allocate_height (GtkCellAreaContext *context,
gint height); gint height);
/* CachedSize management */
typedef struct {
gint min_size;
gint nat_size;
} CachedSize;
static CachedSize *cached_size_new (gint min_size, gint nat_size);
static void cached_size_free (CachedSize *size);
struct _GtkCellAreaContextPrivate struct _GtkCellAreaContextPrivate
{ {
GtkCellArea *cell_area; GtkCellArea *cell_area;
...@@ -71,9 +57,6 @@ struct _GtkCellAreaContextPrivate ...@@ -71,9 +57,6 @@ struct _GtkCellAreaContextPrivate
gint nat_height; gint nat_height;
gint alloc_width; gint alloc_width;
gint alloc_height; gint alloc_height;
GHashTable *widths;
GHashTable *heights;
}; };
enum { enum {
...@@ -85,14 +68,6 @@ enum { ...@@ -85,14 +68,6 @@ enum {
PROP_NAT_HEIGHT PROP_NAT_HEIGHT
}; };
enum {
SIGNAL_WIDTH_CHANGED,
SIGNAL_HEIGHT_CHANGED,
LAST_SIGNAL
};
static guint cell_area_context_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GtkCellAreaContext, gtk_cell_area_context, G_TYPE_OBJECT); G_DEFINE_TYPE (GtkCellAreaContext, gtk_cell_area_context, G_TYPE_OBJECT);
static void static void
...@@ -109,10 +84,6 @@ gtk_cell_area_context_init (GtkCellAreaContext *context) ...@@ -109,10 +84,6 @