## ClutterFlowLayout ClutterFlowLayout — A reflowing layout manager |

## Synopsis

    enum                ClutterFlowOrientation;
    struct              ClutterFlowLayout;
    struct              ClutterFlowLayoutClass;
    ClutterLayoutManager *  clutter_flow_layout_new         (ClutterFlowOrientation orientation);
    void                clutter_flow_layout_set_homogeneous (ClutterFlowLayout *layout,
                                                             gboolean homogeneous);
    gboolean            clutter_flow_layout_get_homogeneous (ClutterFlowLayout *layout);
    void                clutter_flow_layout_set_orientation (ClutterFlowLayout *layout,
                                                             ClutterFlowOrientation orientation);
    ClutterFlowOrientation  clutter_flow_layout_get_orientation
                                                            (ClutterFlowLayout *layout);

    void                clutter_flow_layout_set_column_spacing
                                                            (ClutterFlowLayout *layout,
                                                             gfloat spacing);
    gfloat              clutter_flow_layout_get_column_spacing
                                                            (ClutterFlowLayout *layout);
    void                clutter_flow_layout_set_row_spacing (ClutterFlowLayout *layout,
                                                             gfloat spacing);
    gfloat              clutter_flow_layout_get_row_spacing (ClutterFlowLayout *layout);
    void                clutter_flow_layout_set_column_width
                                                            (ClutterFlowLayout *layout,
                                                             gfloat min_width,
                                                             gfloat max_width);
    void                clutter_flow_layout_get_column_width
                                                            (ClutterFlowLayout *layout,
                                                             gfloat *min_width,
                                                             gfloat *max_width);
    void                clutter_flow_layout_set_row_height  (ClutterFlowLayout *layout,
                                                             gfloat min_height,
                                                             gfloat max_height);
    void                clutter_flow_layout_get_row_height  (ClutterFlowLayout *layout,
                                                             gfloat *min_height,
                                                             gfloat *max_height);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterLayoutManager
                   +----ClutterFlowLayout

## Properties

      "column-spacing"           gfloat                : Read / Write
      "homogeneous"              gboolean              : Read / Write
      "max-column-width"         gfloat                : Read / Write
      "max-row-height"           gfloat                : Read / Write
      "min-column-width"         gfloat                : Read / Write
      "min-row-height"           gfloat                : Read / Write
      "orientation"              ClutterFlowOrientation  : Read / Write / Construct
      "row-spacing"              gfloat                : Read / Write

## Description

ClutterFlowLayout is a layout manager which implements the following policy:

- the preferred natural size depends on the value of the "orientation" property; the layout will try to maintain all its children on a single row or column;

- if either the width or the height allocated are smaller than the preferred ones, the layout will wrap; in this case, the preferred height or width, respectively, will take into account the amount of columns and rows;

- each line (either column or row) in reflowing will have the size of the biggest cell on that line; if the "homogeneous" property is set to `FALSE` the actor will be allocated within that area, and if set to `TRUE` instead the actor will be given exactly that area;

- the size of the columns or rows can be controlled for both minimum and maximum; the spacing can also be controlled in both columns and rows.

Figure 5. Horizontal flow layout

The image shows a ClutterFlowLayout with the "orientation" propert set to `CLUTTER_FLOW_HORIZONTAL`.

Figure 6. Vertical flow layout

The image shows a ClutterFlowLayout with the "orientation" propert set to `CLUTTER_FLOW_VERTICAL`.

ClutterFlowLayout is available since Clutter 1.2

## Details

### enum ClutterFlowOrientation

    typedef enum { /*< prefix=CLUTTER_FLOW >*/
      CLUTTER_FLOW_HORIZONTAL,
      CLUTTER_FLOW_VERTICAL
    } ClutterFlowOrientation;

The direction of the arrangement of the children inside a ClutterFlowLayout

`CLUTTER_FLOW_HORIZONTAL` | Arrange the children of the flow layout horizontally first
`CLUTTER_FLOW_VERTICAL` | Arrange the children of the flow layout vertically first

Since 1.2

### struct ClutterFlowLayout

    struct ClutterFlowLayout;

The ClutterFlowLayout structure contains only private data and should be accessed using the provided API

Since 1.2

### struct ClutterFlowLayoutClass

    struct ClutterFlowLayoutClass {
    };

The ClutterFlowLayoutClass structure contains only private data and should be accessed using the provided API

Since 1.2

### clutter_flow_layout_new ()

    ClutterLayoutManager *  clutter_flow_layout_new         (ClutterFlowOrientation orientation);

Creates a new ClutterFlowLayout with the given `orientation`

`orientation` : | the orientation of the flow layout
Returns : | the newly created ClutterFlowLayout

Since 1.2

### clutter_flow_layout_set_homogeneous ()

    void                clutter_flow_layout_set_homogeneous (ClutterFlowLayout *layout,
                                                             gboolean homogeneous);

Sets whether the `layout` should allocate the same space for each child

`layout` : | a ClutterFlowLayout
`homogeneous` : | whether the layout should be homogeneous or not

Since 1.2

### clutter_flow_layout_get_homogeneous ()

    gboolean            clutter_flow_layout_get_homogeneous (ClutterFlowLayout *layout);

Retrieves whether the `layout` is homogeneous

`layout` : | a ClutterFlowLayout
Returns : | `TRUE` if the ClutterFlowLayout is homogeneous

Since 1.2

### clutter_flow_layout_set_orientation ()

    void                clutter_flow_layout_set_orientation (ClutterFlowLayout *layout,
                                                             ClutterFlowOrientation orientation);

Sets the orientation of the flow layout

The orientation controls the direction used to allocate the children: either horizontally or vertically. The orientation also controls the direction of the overflowing

`layout` : | a ClutterFlowLayout
`orientation` : | the orientation of the layout

Since 1.2

### clutter_flow_layout_get_orientation ()

    ClutterFlowOrientation  clutter_flow_layout_get_orientation
                                                            (ClutterFlowLayout *layout);

Retrieves the orientation of the `layout`

`layout` : | a ClutterFlowLayout
Returns : | the orientation of the ClutterFlowLayout

Since 1.2

### clutter_flow_layout_set_column_spacing ()

    void                clutter_flow_layout_set_column_spacing
                                                            (ClutterFlowLayout *layout,
                                                             gfloat spacing);

Sets the space between columns, in pixels

`layout` : | a ClutterFlowLayout
`spacing` : | the space between columns

Since 1.2

### clutter_flow_layout_get_column_spacing ()

    gfloat              clutter_flow_layout_get_column_spacing
                                                            (ClutterFlowLayout *layout);

Retrieves the spacing between columns

`layout` : | a ClutterFlowLayout
Returns : | the spacing between columns of the ClutterFlowLayout, in pixels

Since 1.2

### clutter_flow_layout_set_row_spacing ()

    void                clutter_flow_layout_set_row_spacing (ClutterFlowLayout *layout,
                                                             gfloat spacing);

Sets the spacing between rows, in pixels

`layout` : | a ClutterFlowLayout
`spacing` : | the space between rows

Since 1.2

### clutter_flow_layout_get_row_spacing ()

    gfloat              clutter_flow_layout_get_row_spacing (ClutterFlowLayout *layout);

Retrieves the spacing between rows

`layout` : | a ClutterFlowLayout
Returns : | the spacing between rows of the ClutterFlowLayout, in pixels

Since 1.2

### clutter_flow_layout_set_column_width ()

    void                clutter_flow_layout_set_column_width
                                                            (ClutterFlowLayout *layout,
                                                             gfloat min_width,
                                                             gfloat max_width);

Sets the minimum and maximum widths that a column can have

`layout` : | a ClutterFlowLayout
`min_width` : | minimum width of a column
`max_width` : | maximum width of a column

Since 1.2

### clutter_flow_layout_get_column_width ()

    void                clutter_flow_layout_get_column_width
                                                            (ClutterFlowLayout *layout,
                                                             gfloat *min_width,
                                                             gfloat *max_width);

Retrieves the minimum and maximum column widths

`layout` : | a ClutterFlowLayout
`min_width` : | return location for the minimum column width, or `NULL`. [out]
`max_width` : | return location for the maximum column width, or `NULL`. [out]

Since 1.2

### clutter_flow_layout_set_row_height ()

    void                clutter_flow_layout_set_row_height  (ClutterFlowLayout *layout,
                                                             gfloat min_height,
                                                             gfloat max_height);

Sets the minimum and maximum heights that a row can have

`layout` : | a ClutterFlowLayout
`min_height` : | the minimum height of a row
`max_height` : | the maximum height of a row

Since 1.2

### clutter_flow_layout_get_row_height ()

    void                clutter_flow_layout_get_row_height  (ClutterFlowLayout *layout,
                                                             gfloat *min_height,
                                                             gfloat *max_height);

Retrieves the minimum and maximum row heights

`layout` : | a ClutterFlowLayout
`min_height` : | return location for the minimum row height, or `NULL`. [out]
`max_height` : | return location for the maximum row height, or `NULL`. [out]

Since 1.2

## Property Details

### The `"column-spacing"` property

      "column-spacing"           gfloat                : Read / Write

The spacing between columns, in pixels; the value of this property is honoured by horizontal non-overflowing layouts and by vertical overflowing layouts

Allowed values: >= 0

Default value: 0

Since 1.2

### The `"homogeneous"` property

      "homogeneous"              gboolean              : Read / Write

Whether each child inside the ClutterFlowLayout should receive the same allocation

Default value: FALSE

Since 1.2

### The `"max-column-width"` property

      "max-column-width"         gfloat                : Read / Write

Maximum width for each column in the layout, in pixels. If set to -1 the width will be the maximum child width

Allowed values: >= -1

Default value: -1

Since 1.2

### The `"max-row-height"` property

      "max-row-height"           gfloat                : Read / Write

Maximum height for each row in the layout, in pixels. If set to -1 the width will be the maximum child height

Allowed values: >= -1

Default value: -1

Since 1.2

### The `"min-column-width"` property

      "min-column-width"         gfloat                : Read / Write

Minimum width for each column in the layout, in pixels

Allowed values: >= 0

Default value: 0

Since 1.2

### The `"min-row-height"` property

      "min-row-height"           gfloat                : Read / Write

Minimum height for each row in the layout, in pixels

Allowed values: >= 0

Default value: 0

Since 1.2

### The `"orientation"` property

      "orientation"              ClutterFlowOrientation  : Read / Write / Construct

The orientation of the ClutterFlowLayout. The children of the layout will be layed out following the orientation.

This property also controls the overflowing directions

Default value: CLUTTER_FLOW_HORIZONTAL

Since 1.2

### The `"row-spacing"` property

      "row-spacing"              gfloat                : Read / Write

The spacing between rows, in pixels; the value of this property is honoured by vertical non-overflowing layouts and by horizontal overflowing layouts

Allowed values: >= 0

Default value: 0

Since 1.2