* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
for (i = array->len - 1; i >= 0; i--)
{
if (priv->align[i] &&
- _gtk_cell_area_box_group_visible (area, i))
- break;
+ _gtk_cell_area_box_group_visible (area, i))
+ break;
}
last_aligned_group_idx = i >= 0 ? i : 0;
if (box_orientation == orientation)
{
- if (i > last_aligned_group_idx &&
- !_gtk_cell_area_box_group_visible (area, i))
- continue;
+ if (i > last_aligned_group_idx &&
+ !_gtk_cell_area_box_group_visible (area, i))
+ continue;
/* Dont add spacing for 0 size groups, they can be 0 size because
* they contain only invisible cells for this round of requests
copy = g_object_new (GTK_TYPE_CELL_AREA_BOX_CONTEXT,
"area", box, NULL);
- gtk_cell_area_box_init_groups (copy,
- context->priv->base_widths->len,
- context->priv->expand,
- context->priv->align);
+ _gtk_cell_area_box_init_groups (copy,
+ context->priv->base_widths->len,
+ context->priv->expand,
+ context->priv->align);
/* Copy the base arrays */
copy_size_array (context->priv->base_widths,
}
void
-gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
- guint n_groups,
- gboolean *expand_groups,
- gboolean *align_groups)
+_gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
+ guint n_groups,
+ gboolean *expand_groups,
+ gboolean *align_groups)
{
GtkCellAreaBoxContextPrivate *priv;
static GtkRequestedSize *
_gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
- GtkCellAreaBox *area,
+ GtkCellAreaBox *area,
GtkOrientation orientation,
gint for_size,
gint *n_requests)
for (i = priv->base_widths->len - 1; i >= 0; i--)
{
if (priv->align[i] &&
- _gtk_cell_area_box_group_visible (area, i))
- break;
+ _gtk_cell_area_box_group_visible (area, i))
+ break;
}
last_aligned_group_idx = i >= 0 ? i : 0;
size = &g_array_index (array, CachedSize, i);
if (size->nat_size > 0 &&
- (i <= last_aligned_group_idx ||
- _gtk_cell_area_box_group_visible (area, i)))
- visible_groups++;
+ (i <= last_aligned_group_idx ||
+ _gtk_cell_area_box_group_visible (area, i)))
+ visible_groups++;
}
requests = g_new (GtkRequestedSize, visible_groups);
size = &g_array_index (array, CachedSize, i);
if (size->nat_size > 0 &&
- (i <= last_aligned_group_idx ||
- _gtk_cell_area_box_group_visible (area, i)))
+ (i <= last_aligned_group_idx ||
+ _gtk_cell_area_box_group_visible (area, i)))
{
requests[j].data = GINT_TO_POINTER (i);
requests[j].minimum_size = size->min_size;
static GtkCellAreaBoxAllocation *
allocate_for_orientation (GtkCellAreaBoxContext *context,
- GtkCellAreaBox *area,
+ GtkCellAreaBox *area,
GtkOrientation orientation,
gint spacing,
gint size,
GtkCellAreaBoxContextPrivate *priv = context->priv;
GtkCellAreaBoxAllocation *allocs;
GtkRequestedSize *sizes;
- GArray *array;
gint n_expand_groups = 0;
gint i, n_groups, position, vis_position;
gint extra_size, extra_extra;
gint avail_size = size;
sizes = _gtk_cell_area_box_context_get_requests (context, area, orientation, for_size, &n_groups);
- array = get_array (context, orientation, for_size);
n_expand_groups = count_expand_groups (context);
/* First start by naturally allocating space among groups */
allocs[i].group_idx = GPOINTER_TO_INT (sizes[i].data);
if (priv->align[allocs[i].group_idx])
- vis_position = position;
+ vis_position = position;
allocs[i].position = vis_position;
allocs[i].size = sizes[i].minimum_size;
position += spacing;
if (_gtk_cell_area_box_group_visible (area, allocs[i].group_idx))
- {
- vis_position += allocs[i].size;
- vis_position += spacing;
- }
+ {
+ vis_position += allocs[i].size;
+ vis_position += spacing;
+ }
}
if (n_allocs)
if (orientation == GTK_ORIENTATION_HORIZONTAL && width > 0)
allocs = allocate_for_orientation (context, area, orientation,
- spacing, width, height,
- &alloc_count);
+ spacing, width, height,
+ &alloc_count);
else if (orientation == GTK_ORIENTATION_VERTICAL && height > 0)
allocs = allocate_for_orientation (context, area, orientation,
- spacing, height, width,
- &alloc_count);
+ spacing, height, width,
+ &alloc_count);
*n_allocs = alloc_count;