Clutter.LayoutManager

g Clutter.LayoutManager Clutter.LayoutManager GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Clutter.LayoutManager GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

Clutter.BinLayout, Clutter.BoxLayout, Clutter.FixedLayout, Clutter.FlowLayout, Clutter.GridLayout, Clutter.TableLayout

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

allocate (container, allocation, flags)

begin_animation (duration, mode)

child_get_property (container, actor, property_name, value)

child_set_property (container, actor, property_name, value)

end_animation ()

find_child_property (name)

get_animation_progress ()

get_child_meta (container, actor)

get_preferred_height (container, for_width)

get_preferred_width (container, for_height)

layout_changed ()

list_child_properties ()

set_container (container)

Virtual Methods

Inherited:

GObject.Object (7)

do_allocate (container, allocation, flags)

do_begin_animation (duration, mode)

do_end_animation ()

do_get_animation_progress ()

do_get_child_meta_type ()

do_get_preferred_height (container, for_width)

do_get_preferred_width (container, for_height)

do_layout_changed ()

do_set_container (container)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

layout-changed

The ::layout-changed signal is emitted each time a layout manager has been changed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

dummy

object

r

parent_instance

GObject.InitiallyUnowned

r

Class Details

class Clutter.LayoutManager(**kwargs)
Bases:

GObject.InitiallyUnowned

Abstract:

Yes

Structure:

Clutter.LayoutManagerClass

The Clutter.LayoutManager structure contains only private data and should be accessed using the provided API

New in version 1.2.

allocate(container, allocation, flags)
Parameters:

Allocates the children of container given an area

See also Clutter.Actor.allocate()

New in version 1.2.

begin_animation(duration, mode)
Parameters:
  • duration (int) – the duration of the animation, in milliseconds

  • mode (int) – the easing mode of the animation

Returns:

The Clutter.Alpha created by the layout manager; the returned instance is owned by the layout manager and should not be unreferenced

Return type:

Clutter.Alpha

Begins an animation of duration milliseconds, using the provided easing mode

The easing mode can be specified either as a Clutter.AnimationMode or as a logical id returned by Clutter.Alpha.register_func()

The result of this function depends on the self implementation

New in version 1.2.

Deprecated since version 1.12.

child_get_property(container, actor, property_name, value)
Parameters:

Gets a property on the Clutter.LayoutMeta created by self and attached to a child of container

The GObject.Value must already be initialized to the type of the property and has to be unset with GObject.Value.unset() after extracting the real value out of it

New in version 1.2.

child_set_property(container, actor, property_name, value)
Parameters:

Sets a property on the Clutter.LayoutMeta created by self and attached to a child of container

New in version 1.2.

end_animation()

Ends an animation started by Clutter.LayoutManager.begin_animation()

The result of this call depends on the self implementation

New in version 1.2.

Deprecated since version 1.12.

find_child_property(name)
Parameters:

name (str) – the name of the property

Returns:

a GObject.ParamSpec describing the property, or None if no property with that name exists. The returned GObject.ParamSpec is owned by the layout manager and should not be modified or freed

Return type:

GObject.ParamSpec

Retrieves the GObject.ParamSpec for the layout property name inside the Clutter.LayoutMeta sub-class used by self

New in version 1.2.

get_animation_progress()
Returns:

the progress of the animation

Return type:

float

Retrieves the progress of the animation, if one has been started by Clutter.LayoutManager.begin_animation()

The returned value has the same semantics of the Clutter.Alpha :alpha value

New in version 1.2.

Deprecated since version 1.12.

get_child_meta(container, actor)
Parameters:
Returns:

a Clutter.LayoutMeta, or None if the Clutter.LayoutManager does not have layout properties. The returned layout meta instance is owned by the Clutter.LayoutManager and it should not be unreferenced

Return type:

Clutter.LayoutMeta

Retrieves the Clutter.LayoutMeta that the layout self associated to the actor child of container, eventually by creating one if the Clutter.LayoutManager supports layout properties

New in version 1.0.

get_preferred_height(container, for_width)
Parameters:
Returns:

min_height_p:

return location for the minimum height of the layout, or None

nat_height_p:

return location for the natural height of the layout, or None

Return type:

(min_height_p: float, nat_height_p: float)

Computes the minimum and natural heights of the container according to self.

See also Clutter.Actor.get_preferred_height()

New in version 1.2.

get_preferred_width(container, for_height)
Parameters:
Returns:

min_width_p:

return location for the minimum width of the layout, or None

nat_width_p:

return location for the natural width of the layout, or None

Return type:

(min_width_p: float, nat_width_p: float)

Computes the minimum and natural widths of the container according to self.

See also Clutter.Actor.get_preferred_width()

New in version 1.2.

layout_changed()

Emits the Clutter.LayoutManager ::layout-changed signal on self

This function should only be called by implementations of the Clutter.LayoutManager class

New in version 1.2.

list_child_properties()
Returns:

the newly-allocated, None-terminated array of GObject.ParamSpec s. Use GLib.free() to free the resources allocated for the array

Return type:

[GObject.ParamSpec]

Retrieves all the GObject.ParamSpec s for the layout properties stored inside the Clutter.LayoutMeta sub-class used by self

New in version 1.2.

set_container(container)
Parameters:

container (Clutter.Container or None) – a Clutter.Container using self

If the Clutter.LayoutManager sub-class allows it, allow adding a weak reference of the container using self from within the layout manager

The layout manager should not increase the reference count of the container

New in version 1.2.

do_allocate(container, allocation, flags) virtual
Parameters:

Allocates the children of container given an area

See also Clutter.Actor.allocate()

New in version 1.2.

do_begin_animation(duration, mode) virtual
Parameters:
  • duration (int) – the duration of the animation, in milliseconds

  • mode (int) – the easing mode of the animation

Returns:

The Clutter.Alpha created by the layout manager; the returned instance is owned by the layout manager and should not be unreferenced

Return type:

Clutter.Alpha

Begins an animation of duration milliseconds, using the provided easing mode

The easing mode can be specified either as a Clutter.AnimationMode or as a logical id returned by Clutter.Alpha.register_func()

The result of this function depends on the manager implementation

New in version 1.2.

Deprecated since version 1.12.

do_end_animation() virtual

Ends an animation started by Clutter.LayoutManager.begin_animation()

The result of this call depends on the manager implementation

New in version 1.2.

Deprecated since version 1.12.

do_get_animation_progress() virtual
Returns:

the progress of the animation

Return type:

float

Retrieves the progress of the animation, if one has been started by Clutter.LayoutManager.begin_animation()

The returned value has the same semantics of the Clutter.Alpha :alpha value

New in version 1.2.

Deprecated since version 1.12.

do_get_child_meta_type() virtual
Return type:

GObject.GType

do_get_preferred_height(container, for_width) virtual
Parameters:
Returns:

min_height_p:

return location for the minimum height of the layout, or None

nat_height_p:

return location for the natural height of the layout, or None

Return type:

(min_height_p: float, nat_height_p: float)

Computes the minimum and natural heights of the container according to manager.

See also Clutter.Actor.get_preferred_height()

New in version 1.2.

do_get_preferred_width(container, for_height) virtual
Parameters:
Returns:

min_width_p:

return location for the minimum width of the layout, or None

nat_width_p:

return location for the natural width of the layout, or None

Return type:

(min_width_p: float, nat_width_p: float)

Computes the minimum and natural widths of the container according to manager.

See also Clutter.Actor.get_preferred_width()

New in version 1.2.

do_layout_changed() virtual

Emits the Clutter.LayoutManager ::layout-changed signal on manager

This function should only be called by implementations of the Clutter.LayoutManager class

New in version 1.2.

do_set_container(container) virtual
Parameters:

container (Clutter.Container or None) – a Clutter.Container using manager

If the Clutter.LayoutManager sub-class allows it, allow adding a weak reference of the container using manager from within the layout manager

The layout manager should not increase the reference count of the container

New in version 1.2.

Signal Details

Clutter.LayoutManager.signals.layout_changed(layout_manager)
Signal Name:

layout-changed

Flags:

RUN_LAST

Parameters:

layout_manager (Clutter.LayoutManager) – The object which received the signal

The ::layout-changed signal is emitted each time a layout manager has been changed. Every Clutter.Actor using the manager instance as a layout manager should connect a handler to the ::layout-changed signal and queue a relayout on themselves:

static void layout_changed (ClutterLayoutManager *manager,
                            ClutterActor         *self)
{
  clutter_actor_queue_relayout (self);
}
...
  self->manager = g_object_ref_sink (manager);
  g_signal_connect (self->manager, "layout-changed",
                    G_CALLBACK (layout_changed),
                    self);

Sub-classes of Clutter.LayoutManager that implement a layout that can be controlled or changed using parameters should emit the ::layout-changed signal whenever one of the parameters changes, by using Clutter.LayoutManager.layout_changed().

New in version 1.2.