Formatting and typo fixes

This commit is contained in:
Matthias Clasen 2010-04-23 21:52:55 -04:00
parent 909ca43c1a
commit 148ea63dba

View File

@ -36,7 +36,7 @@
* Some important things to keep in mind when implementing
* or using the extended layout.
*
* The Extended Layout system will query a logical heirarchy in
* The Extended Layout system will query a logical hierarchy in
* only one orientation at a time. When widgets are initially queried
* for their minimum sizes it is generally done in a dual pass
* in the direction chosen by the toplevel.
@ -46,22 +46,22 @@
* in the interface will computed and collectively returned to
* the toplevel by way of gtk_extended_layout_get_desired_width().
* Next; the toplevel will use the minimum width to query for the
* minimum height contextual to that width using gtk_extended_layout_get_height_for_width()
* which will also be a highly recursive operation. This minimum
* for minimum size can be used to set the minimum size constraint
* on the toplevel.
* minimum height contextual to that width using
* gtk_extended_layout_get_height_for_width() which will also be a
* highly recursive operation. This minimum for minimum size can be
* used to set the minimum size constraint on the toplevel.
*
* When allocating; each container can use the minimum and natural
* sizes reported by thier children to allocate natural sizes and
* sizes reported by their children to allocate natural sizes and
* expose as much content as possible with the given allocation.
*
* That means that the request operation at allocation time will
* usually fire again in contexts of different allocated sizes than
* the ones originally queried for.
*
* A Widget that does not actually do height-for-width
* A widget that does not actually do height-for-width
* or width-for-height size negotiations only has to implement
* get_desired_width() and get_desired_height()
* get_desired_width() and get_desired_height().
*
* If a widget does move content around to smartly use up the
* allocated size, then it must support the request properly in
@ -151,8 +151,7 @@ get_cached_desired_size (gint for_size,
cs = &cached_sizes[i];
if (cs->age > 0 &&
cs->for_size == for_size)
if (cs->age > 0 && cs->for_size == for_size)
{
*result = cs;
return TRUE;
@ -172,8 +171,9 @@ destroy_cache (ExtendedLayoutCache *cache)
g_slice_free (ExtendedLayoutCache, cache);
}
ExtendedLayoutCache *
get_cache (GtkExtendedLayout *layout, gboolean create)
static ExtendedLayoutCache *
get_cache (GtkExtendedLayout *layout,
gboolean create)
{
ExtendedLayoutCache *cache;
@ -228,11 +228,11 @@ compute_size_for_orientation (GtkExtendedLayout *layout,
{
cached_size = &cache->desired_widths[0];
if (GTK_WIDGET_WIDTH_REQUEST_NEEDED (layout) == FALSE)
if (!GTK_WIDGET_WIDTH_REQUEST_NEEDED (layout))
found_in_cache = get_cached_desired_size (for_size, cache->desired_widths, &cached_size);
else
{
memset (cache->desired_widths, 0x0, N_CACHED_SIZES * sizeof (DesiredSize));
memset (cache->desired_widths, 0, N_CACHED_SIZES * sizeof (DesiredSize));
cache->cached_width_age = 1;
}
}
@ -240,11 +240,11 @@ compute_size_for_orientation (GtkExtendedLayout *layout,
{
cached_size = &cache->desired_heights[0];
if (GTK_WIDGET_HEIGHT_REQUEST_NEEDED (layout) == FALSE)
if (!GTK_WIDGET_HEIGHT_REQUEST_NEEDED (layout))
found_in_cache = get_cached_desired_size (for_size, cache->desired_heights, &cached_size);
else
{
memset (cache->desired_heights, 0x0, N_CACHED_SIZES * sizeof (DesiredSize));
memset (cache->desired_heights, 0, N_CACHED_SIZES * sizeof (DesiredSize));
cache->cached_height_age = 1;
}
}
@ -302,10 +302,12 @@ compute_size_for_orientation (GtkExtendedLayout *layout,
GTK_PRIVATE_UNSET_FLAG (layout, GTK_HEIGHT_REQUEST_NEEDED);
}
/* Get size groups to compute the base requisition once one of the values have been cached,
* then go ahead and update the cache with the sizegroup computed value.
/* Get size groups to compute the base requisition once one
* of the values have been cached, then go ahead and update
* the cache with the sizegroup computed value.
*
* Note this is also where values from gtk_widget_set_size_request() are considered.
* Note this is also where values from gtk_widget_set_size_request()
* are considered.
*/
group_size =
_gtk_size_group_bump_requisition (GTK_WIDGET (layout),
@ -340,15 +342,16 @@ compute_size_for_orientation (GtkExtendedLayout *layout,
* @layout: a #GtkExtendedLayout instance
*
* Gets whether the widget prefers a height-for-width layout
* or a width-for-height layout
* or a width-for-height layout.
*
* <note><para>#GtkBin widgets generally propagate the preference of
* their child, container widgets need to request something either in
* context of their children or in context of their allocation
* capabilities.</para></note>
*
* Returns: %TRUE if the widget prefers height-for-width, %FALSE if
* the widget should be treated with a width-for-height preference.
*
* <note><para>#GtkBin widgets generally propagate the preference of thier child,
* container widgets need to request something either in context of their
* children or in context of their allocation capabilities.</para></note>
*
* Since: 3.0
*/
gboolean
@ -369,12 +372,13 @@ gtk_extended_layout_is_height_for_width (GtkExtendedLayout *layout)
/**
* gtk_extended_layout_get_desired_width:
* @layout: a #GtkExtendedLayout instance
* @minimum_width: location to store the minimum size, or %NULL
* @natural_width: location to store the natural size, or %NULL
* @minimum_width: location to store the minimum width, or %NULL
* @natural_width: location to store the natural width, or %NULL
*
* Retreives a widget's initial minimum and natural width.
* Retrieves a widget's initial minimum and natural width.
*
* <note><para>This call is specific to height for width requests.</para></note>
* <note><para>This call is specific to height-for-width
* requests.</para></note>
*
* Since: 3.0
*/
@ -383,19 +387,21 @@ gtk_extended_layout_get_desired_width (GtkExtendedLayout *layout,
gint *minimum_width,
gint *natural_width)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL, -1, minimum_width, natural_width);
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL,
-1, minimum_width, natural_width);
}
/**
* gtk_extended_layout_get_desired_height:
* @layout: a #GtkExtendedLayout instance
* @minimum_width: location to store the minimum size, or %NULL
* @natural_width: location to store the natural size, or %NULL
* @minimum_width: location to store the minimum height, or %NULL
* @natural_width: location to store the natural height, or %NULL
*
* Retreives a widget's minimum and natural size in a single dimension.
* Retrieves a widget's initial minimum and natural height.
*
* <note><para>This call is specific to width for height requests.</para></note>
* <note><para>This call is specific to width-for-height
* requests.</para></note>
*
* Since: 3.0
*/
@ -404,7 +410,8 @@ gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout,
gint *minimum_height,
gint *natural_height)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL, -1, minimum_height, natural_height);
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL,
-1, minimum_height, natural_height);
}
@ -416,7 +423,7 @@ gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout,
* @minimum_size: location for storing the minimum size, or %NULL
* @natural_size: location for storing the natural size, or %NULL
*
* Retreives a widget's desired width if it would be given
* Retrieves a widget's desired width if it would be given
* the specified @height.
*
* Since: 3.0
@ -427,7 +434,8 @@ gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout,
gint *minimum_width,
gint *natural_width)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL, height, minimum_width, natural_width);
compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL,
height, minimum_width, natural_width);
}
/**
@ -437,7 +445,7 @@ gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout,
* @minimum_size: location for storing the minimum size, or %NULL
* @natural_size: location for storing the natural size, or %NULL
*
* Retreives a widget's desired height if it would be given
* Retrieves a widget's desired height if it would be given
* the specified @width.
*
* Since: 3.0
@ -448,7 +456,8 @@ gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout,
gint *minimum_height,
gint *natural_height)
{
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL, width, minimum_height, natural_height);
compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL,
width, minimum_height, natural_height);
}
/**
@ -460,14 +469,14 @@ gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout,
* @minimum_size: location for storing the minimum size, or %NULL
* @natural_size: location for storing the natural size, or %NULL
*
* Retreives the minimum and natural size of a widget taking
* Retrieves the minimum and natural size of a widget taking
* into account the widget's preference for height-for-width management.
*
* If request_natural is specified, the non-contextual natural value will
* be used to make the contextual request; otherwise the minimum will be used.
*
* This is used to retreive a suitable size by container widgets whom dont
* impose any restrictions on the child placement
* This is used to retrieve a suitable size by container widgets which do
* not impose any restrictions on the child placement.
*
* Since: 3.0
*/