GnuiFlowLayout

GnuiFlowLayout — A reusable flow layout manager

Stability Level

Unstable, unless otherwise indicated

Functions

Properties

int leading Read / Write
GtkTextDirection line-direction Read / Write
GtkJustification line-justify Read / Write
GtkTextDirection page-direction Read / Write
GtkJustification page-justify Read / Write
int spacing Read / Write

Types and Values

Object Hierarchy

    GObject
    ├── GtkLayoutChild
       ╰── GnuiFlowChildLayout
    ╰── GtkLayoutManager
        ╰── GnuiFlowLayout

Implemented Interfaces

GnuiFlowLayout implements GtkOrientable.

Includes

#include <gnuisance/gnui-flow-layout.h>

Description

GnuiFlowLayout is a reusable layout manager that allocates widgets like words in a text (exactly like GnuiFlow does).

You would normally use it in custom widgets derived directly from GtkWidget, assigning GnuiFlowLayout to them as layout manager:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
static void xyz_foo_bar_class_init (
    XyzFooBarClass * const klass
) {

    // ...

    GtkWidgetClass * const widget_class = GTK_WIDGET_CLASS(klass);

    // ...

    gtk_widget_class_set_layout_manager_type(
        widget_class,
        GNUI_TYPE_FLOW_LAYOUT
    );

    // ...

}

Functions

gnui_flow_layout_new ()

GtkLayoutManager *
gnui_flow_layout_new (void);

Create a new flow layout manager

Returns

The newly created flow layout manager


gnui_flow_layout_get_spacing ()

gint
gnui_flow_layout_get_spacing (GnuiFlowLayout * const self);

Get the flow layout manager's spacing between children in pixels

[get-property spacing]

Parameters

self

The flow layout manager.

[not nullable]

Returns

The flow layout manager's spacing between children in pixels (can be negative for overlapping widgets)


gnui_flow_layout_set_spacing ()

void
gnui_flow_layout_set_spacing (GnuiFlowLayout * const self,
                              const gint spacing);

Set the flow layout manager's spacing between children in pixels

[set-property spacing]

Parameters

self

The flow layout manager.

[not nullable]

spacing

The flow layout manager's spacing between children in pixels (can be negative for overlapping widgets)

 

gnui_flow_layout_get_leading ()

gint
gnui_flow_layout_get_leading (GnuiFlowLayout * const self);

Get the flow layout manager's leading between children in pixels

[get-property leading]

Parameters

self

The flow layout manager.

[not nullable]

Returns

The flow layout manager's leading between children in pixels (can be negative for overlapping widgets)


gnui_flow_layout_set_leading ()

void
gnui_flow_layout_set_leading (GnuiFlowLayout * const self,
                              const gint leading);

Set the flow layout manager's leading between children in pixels

[set-property leading]

Parameters

self

The flow layout manager.

[not nullable]

leading

The flow layout manager's leading between children in pixels (can be negative for overlapping widgets)

 

gnui_flow_layout_get_page_direction ()

GtkTextDirection
gnui_flow_layout_get_page_direction (GnuiFlowLayout * const self);

Get the flow layout manager's page direction

[get-property page-direction]

Parameters

self

The flow layout manager.

[not nullable]

Returns

The flow layout manager's page direction


gnui_flow_layout_set_page_direction ()

void
gnui_flow_layout_set_page_direction (GnuiFlowLayout * const self,
                                     const GtkTextDirection direction);

Set the flow layout manager's page direction

[set-property page-direction]

Parameters

self

The flow layout manager.

[not nullable]

direction

The flow layout manager's page direction

 

gnui_flow_layout_get_page_justify ()

GtkJustification
gnui_flow_layout_get_page_justify (GnuiFlowLayout * const self);

Get the flow layout manager's page justification

[get-property page-justify]

Parameters

self

The flow layout manager.

[not nullable]

Returns

The flow layout manager's page justification


gnui_flow_layout_set_page_justify ()

void
gnui_flow_layout_set_page_justify (GnuiFlowLayout * const self,
                                   const GtkJustification justification);

Set the flow layout manager's page justification

[set-property page-justify]

Parameters

self

The flow layout manager.

[not nullable]

justification

The flow layout manager's page justification

 

gnui_flow_layout_get_orientation ()

GtkOrientation
gnui_flow_layout_get_orientation (GnuiFlowLayout * const self);

Get the flow layout manager's orientation

[get-property orientation]

Parameters

self

The flow layout manager.

[not nullable]

Returns

The flow layout manager's orientation


gnui_flow_layout_set_orientation ()

void
gnui_flow_layout_set_orientation (GnuiFlowLayout * const self,
                                  const GtkOrientation orientation);

Set the flow layout manager's orientation

[set-property orientation]

Parameters

self

The flow layout manager.

[not nullable]

orientation

The flow layout manager's orientation

 

gnui_flow_layout_get_line_direction ()

GtkTextDirection
gnui_flow_layout_get_line_direction (GnuiFlowLayout * const self);

Get the flow layout manager's line direction

[get-property line-direction]

Parameters

self

The flow layout manager.

[not nullable]

Returns

The flow layout manager's line direction


gnui_flow_layout_set_line_direction ()

void
gnui_flow_layout_set_line_direction (GnuiFlowLayout * const self,
                                     const GtkTextDirection direction);

Set the flow layout manager's line direction

[set-property line-direction]

Parameters

self

The flow layout manager.

[not nullable]

direction

The flow layout manager's line direction

 

gnui_flow_layout_get_line_justify ()

GtkJustification
gnui_flow_layout_get_line_justify (GnuiFlowLayout * const self);

Get the flow layout manager's line justification

[get-property line-justify]

Parameters

self

The flow layout manager.

[not nullable]

Returns

The flow layout manager's line justification


gnui_flow_layout_set_line_justify ()

void
gnui_flow_layout_set_line_justify (GnuiFlowLayout * const self,
                                   const GtkJustification justification);

Set the flow layout manager's line justification

[set-property line-justify]

Parameters

self

The flow layout manager.

[not nullable]

justification

The flow layout manager's line justification

 

Types and Values

GNUI_TYPE_FLOW_LAYOUT

#define GNUI_TYPE_FLOW_LAYOUT (gnui_flow_layout_get_type())

The GType of GnuiFlowLayout


GNUI_TYPE_FLOW_CHILD_LAYOUT

#define GNUI_TYPE_FLOW_CHILD_LAYOUT (gnui_flow_child_layout_get_type())

The GType of GnuiFlowChildLayout


struct GnuiFlowChildLayoutClass

struct GnuiFlowChildLayoutClass {
    GtkLayoutChildClass parent_class;
};

The flow child layout's class


struct GnuiFlowLayoutClass

struct GnuiFlowLayoutClass {
    GtkLayoutManagerClass parent_class;
};

The flow layout manager's class


GnuiFlowChildLayout

typedef struct _GnuiFlowChildLayout GnuiFlowChildLayout;

The GnuiFlowChildLayout layout child


GnuiFlowLayout

typedef struct _GnuiFlowLayout GnuiFlowLayout;

The GnuiFlowLayout layout manager

Property Details

The “leading” property

  “leading”                  int

Space between rows of children perpendicularly to the “orientation” axis.

Owner: GnuiFlowLayout

Flags: Read / Write

Default value: 0


The “line-direction” property

  “line-direction”           GtkTextDirection

The direction of child placement within the given “orientation” axis.

Owner: GnuiFlowLayout

Flags: Read / Write

Default value: GTK_TEXT_DIR_LTR


The “line-justify” property

  “line-justify”             GtkJustification

The alignment of the children relative to each other within each line; this does not affect the alignment of the flow widget within its allocation – see “halign” and “valign” for that.

Owner: GnuiFlowLayout

Flags: Read / Write

Default value: GTK_JUSTIFY_LEFT


The “page-direction” property

  “page-direction”           GtkTextDirection

The direction of child placement perpendicularly to the “orientation” axis.

Owner: GnuiFlowLayout

Flags: Read / Write

Default value: GTK_TEXT_DIR_LTR


The “page-justify” property

  “page-justify”             GtkJustification

The alignment of the lines of children widgets relative to each other; this does not affect the alignment of the flow widget within its allocation – see “halign” and “valign” for that.

Owner: GnuiFlowLayout

Flags: Read / Write

Default value: GTK_JUSTIFY_LEFT


The “spacing” property

  “spacing”                  int

Space between children along the “orientation” axis.

Owner: GnuiFlowLayout

Flags: Read / Write

Default value: 0

See Also

GnuiFlow, GnuiTaggedEntry