![]() |
![]() |
![]() |
Clutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
enum ClutterBoxAlignment; struct ClutterBoxLayout; struct ClutterBoxLayoutClass; ClutterLayoutManager * clutter_box_layout_new (void
); void clutter_box_layout_set_pack_start (ClutterBoxLayout *layout
,gboolean pack_start
); gboolean clutter_box_layout_get_pack_start (ClutterBoxLayout *layout
); void clutter_box_layout_set_spacing (ClutterBoxLayout *layout
,guint spacing
); guint clutter_box_layout_get_spacing (ClutterBoxLayout *layout
); void clutter_box_layout_set_vertical (ClutterBoxLayout *layout
,gboolean vertical
); gboolean clutter_box_layout_get_vertical (ClutterBoxLayout *layout
); void clutter_box_layout_set_homogeneous (ClutterBoxLayout *layout
,gboolean homogeneous
); gboolean clutter_box_layout_get_homogeneous (ClutterBoxLayout *layout
); void clutter_box_layout_pack (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean expand
,gboolean x_fill
,gboolean y_fill
,ClutterBoxAlignment x_align
,ClutterBoxAlignment y_align
); void clutter_box_layout_set_alignment (ClutterBoxLayout *layout
,ClutterActor *actor
,ClutterBoxAlignment x_align
,ClutterBoxAlignment y_align
); void clutter_box_layout_get_alignment (ClutterBoxLayout *layout
,ClutterActor *actor
,ClutterBoxAlignment *x_align
,ClutterBoxAlignment *y_align
); void clutter_box_layout_set_expand (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean expand
); gboolean clutter_box_layout_get_expand (ClutterBoxLayout *layout
,ClutterActor *actor
); void clutter_box_layout_set_fill (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean x_fill
,gboolean y_fill
); void clutter_box_layout_get_fill (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean *x_fill
,gboolean *y_fill
); void clutter_box_layout_set_use_animations (ClutterBoxLayout *layout
,gboolean animate
); gboolean clutter_box_layout_get_use_animations (ClutterBoxLayout *layout
); void clutter_box_layout_set_easing_duration (ClutterBoxLayout *layout
,guint msecs
); guint clutter_box_layout_get_easing_duration (ClutterBoxLayout *layout
); void clutter_box_layout_set_easing_mode (ClutterBoxLayout *layout
,gulong mode
); gulong clutter_box_layout_get_easing_mode (ClutterBoxLayout *layout
);
"easing-duration" guint : Read / Write "easing-mode" gulong : Read / Write "homogeneous" gboolean : Read / Write "pack-start" gboolean : Read / Write "spacing" guint : Read / Write "use-animations" gboolean : Read / Write "vertical" gboolean : Read / Write
The ClutterBoxLayout is a ClutterLayoutManager implementing the following layout policy:
all children are arranged on a single line;
the axis used is controlled by the "vertical" boolean property;
the order of the packing is determined by the "pack-start" boolean property;
each child will be allocated to its natural size or, if set to expand, the available size;
if a child is set to fill on either (or both) axis, its allocation will match all the available size; the fill layout property only makes sense if the expand property is also set;
if a child is set to expand but not to fill then it is possible to control the alignment using the X and Y alignment layout properties.
if the "homogeneous" boolean property is set, then all widgets will get the same size, ignoring expand settings and the preferred sizes
It is possible to control the spacing between children of a
ClutterBoxLayout by using clutter_box_layout_set_spacing()
.
In order to set the layout properties when packing an actor inside a
ClutterBoxLayout you should use the clutter_box_layout_pack()
function.
ClutterBoxLayout is available since Clutter 1.2
typedef enum { CLUTTER_BOX_ALIGNMENT_START, CLUTTER_BOX_ALIGNMENT_END, CLUTTER_BOX_ALIGNMENT_CENTER } ClutterBoxAlignment;
The alignment policies available on each axis of the ClutterBoxLayout
Align the child to the top or to to the left, depending on the used axis | |
Align the child to the bottom or to the right, depending on the used axis | |
Align the child to the center |
Since 1.2
struct ClutterBoxLayout;
The ClutterBoxLayout structure contains only private data and should be accessed using the provided API
Since 1.2
struct ClutterBoxLayoutClass { };
The ClutterBoxLayoutClass structure contains only private data and should be accessed using the provided API
Since 1.2
ClutterLayoutManager * clutter_box_layout_new (void
);
Creates a new ClutterBoxLayout layout manager
Returns : |
the newly created ClutterBoxLayout |
Since 1.2
void clutter_box_layout_set_pack_start (ClutterBoxLayout *layout
,gboolean pack_start
);
Sets whether children of layout
should be layed out by appending
them or by prepending them
|
a ClutterBoxLayout |
|
TRUE if the layout should pack children at the
beginning of the layout
|
Since 1.2
gboolean clutter_box_layout_get_pack_start (ClutterBoxLayout *layout
);
Retrieves the value set using clutter_box_layout_set_pack_start()
|
a ClutterBoxLayout |
Returns : |
TRUE if the ClutterBoxLayout should pack children
at the beginning of the layout, and FALSE otherwise
|
Since 1.2
void clutter_box_layout_set_spacing (ClutterBoxLayout *layout
,guint spacing
);
Sets the spacing between children of layout
|
a ClutterBoxLayout |
|
the spacing between children of the layout, in pixels |
Since 1.2
guint clutter_box_layout_get_spacing (ClutterBoxLayout *layout
);
Retrieves the spacing set using clutter_box_layout_set_spacing()
|
a ClutterBoxLayout |
Returns : |
the spacing between children of the ClutterBoxLayout |
Since 1.2
void clutter_box_layout_set_vertical (ClutterBoxLayout *layout
,gboolean vertical
);
Sets whether layout
should arrange its children vertically alongside
the Y axis, instead of horizontally alongside the X axis
|
a ClutterBoxLayout |
|
TRUE if the layout should be vertical
|
Since 1.2
gboolean clutter_box_layout_get_vertical (ClutterBoxLayout *layout
);
Retrieves the orientation of the layout
as set using the
clutter_box_layout_set_vertical()
function
|
a ClutterBoxLayout |
Returns : |
TRUE if the ClutterBoxLayout is arranging its children
vertically, and FALSE otherwise
|
Since 1.2
void clutter_box_layout_set_homogeneous (ClutterBoxLayout *layout
,gboolean homogeneous
);
Sets whether the size of layout
children should be
homogeneous
|
a ClutterBoxLayout |
|
TRUE if the layout should be homogeneous
|
Since 1.4
gboolean clutter_box_layout_get_homogeneous (ClutterBoxLayout *layout
);
Retrieves if the children sizes are allocated homogeneously.
|
a ClutterBoxLayout |
Returns : |
TRUE if the ClutterBoxLayout is arranging its children
homogeneously, and FALSE otherwise
|
Since 1.4
void clutter_box_layout_pack (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean expand
,gboolean x_fill
,gboolean y_fill
,ClutterBoxAlignment x_align
,ClutterBoxAlignment y_align
);
Packs actor
inside the ClutterContainer associated to layout
and sets the layout properties
|
a ClutterBoxLayout |
|
a ClutterActor |
|
whether the actor should expand
|
|
whether the actor should fill horizontally
|
|
whether the actor should fill vertically
|
|
the horizontal alignment policy for actor
|
|
the vertical alignment policy for actor
|
Since 1.2
void clutter_box_layout_set_alignment (ClutterBoxLayout *layout
,ClutterActor *actor
,ClutterBoxAlignment x_align
,ClutterBoxAlignment y_align
);
Sets the horizontal and vertical alignment policies for actor
inside layout
|
a ClutterBoxLayout |
|
a ClutterActor child of layout
|
|
Horizontal alignment policy for actor
|
|
Vertical alignment policy for actor
|
Since 1.2
void clutter_box_layout_get_alignment (ClutterBoxLayout *layout
,ClutterActor *actor
,ClutterBoxAlignment *x_align
,ClutterBoxAlignment *y_align
);
Retrieves the horizontal and vertical alignment policies for actor
as set using clutter_box_layout_pack()
or clutter_box_layout_set_alignment()
|
a ClutterBoxLayout |
|
a ClutterActor child of layout
|
|
return location for the horizontal alignment policy. [out] |
|
return location for the vertical alignment policy. [out] |
Since 1.2
void clutter_box_layout_set_expand (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean expand
);
Sets whether actor
should expand inside layout
|
a ClutterBoxLayout |
|
a ClutterActor child of layout
|
|
whether actor should expand
|
Since 1.2
gboolean clutter_box_layout_get_expand (ClutterBoxLayout *layout
,ClutterActor *actor
);
Retrieves whether actor
should expand inside layout
|
a ClutterBoxLayout |
|
a ClutterActor child of layout
|
Returns : |
TRUE if the ClutterActor should expand, FALSE otherwise
|
Since 1.2
void clutter_box_layout_set_fill (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean x_fill
,gboolean y_fill
);
Sets the horizontal and vertical fill policies for actor
inside layout
|
a ClutterBoxLayout |
|
a ClutterActor child of layout
|
|
whether actor should fill horizontally the allocated space
|
|
whether actor should fill vertically the allocated space
|
Since 1.2
void clutter_box_layout_get_fill (ClutterBoxLayout *layout
,ClutterActor *actor
,gboolean *x_fill
,gboolean *y_fill
);
Retrieves the horizontal and vertical fill policies for actor
as set using clutter_box_layout_pack()
or clutter_box_layout_set_fill()
|
a ClutterBoxLayout |
|
a ClutterActor child of layout
|
|
return location for the horizontal fill policy. [out] |
|
return location for the vertical fill policy. [out] |
Since 1.2
void clutter_box_layout_set_use_animations (ClutterBoxLayout *layout
,gboolean animate
);
Sets whether layout
should animate changes in the layout properties
The duration of the animations is controlled by
clutter_box_layout_set_easing_duration()
; the easing mode to be used
by the animations is controlled by clutter_box_layout_set_easing_mode()
|
a ClutterBoxLayout |
|
TRUE if the layout should use animations
|
Since 1.2
gboolean clutter_box_layout_get_use_animations
(ClutterBoxLayout *layout
);
Retrieves whether layout
should animate changes in the layout properties
Since clutter_box_layout_set_use_animations()
|
a ClutterBoxLayout |
Returns : |
TRUE if the animations should be used, FALSE otherwise
|
Since 1.2
void clutter_box_layout_set_easing_duration (ClutterBoxLayout *layout
,guint msecs
);
Sets the duration of the animations used by layout
when animating changes
in the layout properties
Use clutter_box_layout_set_use_animations()
to enable and disable the
animations
|
a ClutterBoxLayout |
|
the duration of the animations, in milliseconds |
Since 1.2
guint clutter_box_layout_get_easing_duration
(ClutterBoxLayout *layout
);
Retrieves the duration set using clutter_box_layout_set_easing_duration()
|
a ClutterBoxLayout |
Returns : |
the duration of the animations, in milliseconds |
Since 1.2
void clutter_box_layout_set_easing_mode (ClutterBoxLayout *layout
,gulong mode
);
Sets the easing mode to be used by layout
when animating changes in layout
properties
Use clutter_box_layout_set_use_animations()
to enable and disable the
animations
|
a ClutterBoxLayout |
|
an easing mode, either from ClutterAnimationMode or a logical id
from clutter_alpha_register_func()
|
Since 1.2
gulong clutter_box_layout_get_easing_mode (ClutterBoxLayout *layout
);
Retrieves the easing mode set using clutter_box_layout_set_easing_mode()
|
a ClutterBoxLayout |
Returns : |
an easing mode |
Since 1.2
"easing-duration"
property "easing-duration" guint : Read / Write
The duration of the animations, in case "use-animations"
is set to TRUE
The duration is expressed in milliseconds
Default value: 500
Since 1.2
"easing-mode"
property "easing-mode" gulong : Read / Write
The easing mode for the animations, in case
"use-animations" is set to TRUE
The easing mode has the same semantics of "mode": it can
either be a value from the ClutterAnimationMode enumeration, like
CLUTTER_EASE_OUT_CUBIC
, or a logical id as returned by
clutter_alpha_register_func()
The default value is CLUTTER_EASE_OUT_CUBIC
Since 1.2
"homogeneous"
property "homogeneous" gboolean : Read / Write
Whether the ClutterBoxLayout should arrange its children homogeneously, i.e. all childs get the same size
Default value: FALSE
Since 1.4
"pack-start"
property "pack-start" gboolean : Read / Write
Whether the ClutterBoxLayout should pack items at the start or append them at the end
Default value: FALSE
Since 1.2
"spacing"
property "spacing" guint : Read / Write
The spacing between children of the ClutterBoxLayout, in pixels
Default value: 0
Since 1.2
"use-animations"
property "use-animations" gboolean : Read / Write
Whether the ClutterBoxLayout should animate changes in the layout properties
Default value: FALSE
Since 1.2
"vertical"
property "vertical" gboolean : Read / Write
Whether the ClutterBoxLayout should arrange its children alongside the Y axis, instead of alongside the X axis
Default value: FALSE
Since 1.2