clutter/layout-manager: Consume Actors not Containers

We don't actually need the host to be a container, so simply work on
actors saving us a few casts.

This'll simplify dropping ClutterContainer entirely later, and
StViewport/ShellWindowPreviewLayout will also need to be updated for the
new signatures

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3384>
This commit is contained in:
Zander Brown 2023-11-07 09:57:37 +00:00
parent d0ebfa792d
commit e1cdeb0319
14 changed files with 119 additions and 149 deletions

View File

@ -2268,15 +2268,13 @@ clutter_actor_real_get_preferred_width (ClutterActor *self,
if (priv->layout_manager != NULL) if (priv->layout_manager != NULL)
{ {
ClutterContainer *container = CLUTTER_CONTAINER (self);
CLUTTER_NOTE (LAYOUT, "Querying the layout manager '%s'[%p] " CLUTTER_NOTE (LAYOUT, "Querying the layout manager '%s'[%p] "
"for the preferred width", "for the preferred width",
G_OBJECT_TYPE_NAME (priv->layout_manager), G_OBJECT_TYPE_NAME (priv->layout_manager),
priv->layout_manager); priv->layout_manager);
clutter_layout_manager_get_preferred_width (priv->layout_manager, clutter_layout_manager_get_preferred_width (priv->layout_manager,
container, self,
for_height, for_height,
min_width_p, min_width_p,
natural_width_p); natural_width_p);
@ -2307,15 +2305,13 @@ clutter_actor_real_get_preferred_height (ClutterActor *self,
if (priv->layout_manager != NULL) if (priv->layout_manager != NULL)
{ {
ClutterContainer *container = CLUTTER_CONTAINER (self);
CLUTTER_NOTE (LAYOUT, "Querying the layout manager '%s'[%p] " CLUTTER_NOTE (LAYOUT, "Querying the layout manager '%s'[%p] "
"for the preferred height", "for the preferred height",
G_OBJECT_TYPE_NAME (priv->layout_manager), G_OBJECT_TYPE_NAME (priv->layout_manager),
priv->layout_manager); priv->layout_manager);
clutter_layout_manager_get_preferred_height (priv->layout_manager, clutter_layout_manager_get_preferred_height (priv->layout_manager,
container, self,
for_width, for_width,
min_height_p, min_height_p,
natural_height_p); natural_height_p);
@ -2572,7 +2568,7 @@ clutter_actor_real_allocate (ClutterActor *self,
G_OBJECT_TYPE_NAME (priv->layout_manager)); G_OBJECT_TYPE_NAME (priv->layout_manager));
clutter_layout_manager_allocate (priv->layout_manager, clutter_layout_manager_allocate (priv->layout_manager,
CLUTTER_CONTAINER (self), self,
&children_box); &children_box);
} }
@ -15970,8 +15966,7 @@ clutter_actor_set_layout_manager (ClutterActor *self,
if (priv->layout_manager != NULL) if (priv->layout_manager != NULL)
{ {
g_object_ref_sink (priv->layout_manager); g_object_ref_sink (priv->layout_manager);
clutter_layout_manager_set_container (priv->layout_manager, clutter_layout_manager_set_container (priv->layout_manager, self);
CLUTTER_CONTAINER (self));
priv->layout_changed_id = priv->layout_changed_id =
g_signal_connect (priv->layout_manager, "layout-changed", g_signal_connect (priv->layout_manager, "layout-changed",
G_CALLBACK (on_layout_manager_changed), G_CALLBACK (on_layout_manager_changed),

View File

@ -52,7 +52,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterGridLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInterval, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInterval, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterKeyframeTransition, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterKeyframeTransition, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterLayoutManager, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterLayoutMeta, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterLayoutMeta, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterOffscreenEffect, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterOffscreenEffect, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPageTurnEffect, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterPageTurnEffect, g_object_unref)

View File

@ -61,7 +61,7 @@ G_DEFINE_TYPE (ClutterBinLayout,
static void static void
clutter_bin_layout_get_preferred_width (ClutterLayoutManager *manager, clutter_bin_layout_get_preferred_width (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p) gfloat *nat_width_p)
@ -98,7 +98,7 @@ clutter_bin_layout_get_preferred_width (ClutterLayoutManager *manager,
static void static void
clutter_bin_layout_get_preferred_height (ClutterLayoutManager *manager, clutter_bin_layout_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p) gfloat *nat_height_p)
@ -156,7 +156,7 @@ get_actor_align_factor (ClutterActorAlign alignment)
static void static void
clutter_bin_layout_allocate (ClutterLayoutManager *manager, clutter_bin_layout_allocate (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation) const ClutterActorBox *allocation)
{ {
gfloat allocation_x, allocation_y; gfloat allocation_x, allocation_y;

View File

@ -29,8 +29,6 @@
#endif #endif
#include "clutter/clutter-layout-manager.h" #include "clutter/clutter-layout-manager.h"
#include "clutter/clutter.h"
#include "clutter/clutter-autocleanups.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View File

@ -50,9 +50,6 @@
#include <math.h> #include <math.h>
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter/deprecated/clutter-container.h"
#include "clutter/clutter-box-layout.h" #include "clutter/clutter-box-layout.h"
#include "clutter/clutter-actor-private.h" #include "clutter/clutter-actor-private.h"
@ -64,7 +61,7 @@
struct _ClutterBoxLayoutPrivate struct _ClutterBoxLayoutPrivate
{ {
ClutterContainer *container; ClutterActor *container;
guint spacing; guint spacing;
@ -106,13 +103,13 @@ static float distribute_natural_allocation (float extra_space,
unsigned int n_requested_sizes, unsigned int n_requested_sizes,
RequestedSize *sizes); RequestedSize *sizes);
static void count_expand_children (ClutterLayoutManager *layout, static void count_expand_children (ClutterLayoutManager *layout,
ClutterContainer *container, ClutterActor *container,
gint *visible_children, gint *visible_children,
gint *expand_children); gint *expand_children);
static void static void
clutter_box_layout_set_container (ClutterLayoutManager *layout, clutter_box_layout_set_container (ClutterLayoutManager *layout,
ClutterContainer *container) ClutterActor *container)
{ {
ClutterBoxLayoutPrivate *priv = CLUTTER_BOX_LAYOUT (layout)->priv; ClutterBoxLayoutPrivate *priv = CLUTTER_BOX_LAYOUT (layout)->priv;
ClutterLayoutManagerClass *parent_class; ClutterLayoutManagerClass *parent_class;
@ -272,7 +269,6 @@ get_preferred_size_for_opposite_orientation (ClutterBoxLayout *self,
{ {
ClutterLayoutManager *layout = CLUTTER_LAYOUT_MANAGER (self); ClutterLayoutManager *layout = CLUTTER_LAYOUT_MANAGER (self);
ClutterBoxLayoutPrivate *priv = self->priv; ClutterBoxLayoutPrivate *priv = self->priv;
ClutterContainer *real_container = CLUTTER_CONTAINER (container);
ClutterActor *child; ClutterActor *child;
ClutterActorIter iter; ClutterActorIter iter;
gint nvis_children = 0, n_extra_widgets = 0; gint nvis_children = 0, n_extra_widgets = 0;
@ -286,8 +282,7 @@ get_preferred_size_for_opposite_orientation (ClutterBoxLayout *self,
minimum = natural = 0; minimum = natural = 0;
count_expand_children (layout, real_container, count_expand_children (layout, container, &nvis_children, &nexpand_children);
&nvis_children, &nexpand_children);
if (nvis_children < 1) if (nvis_children < 1)
{ {
@ -419,7 +414,7 @@ get_preferred_size_for_opposite_orientation (ClutterBoxLayout *self,
static void static void
allocate_box_child (ClutterBoxLayout *self, allocate_box_child (ClutterBoxLayout *self,
ClutterContainer *container, ClutterActor *container,
ClutterActor *child, ClutterActor *child,
ClutterActorBox *child_box) ClutterActorBox *child_box)
{ {
@ -434,7 +429,7 @@ allocate_box_child (ClutterBoxLayout *self,
static void static void
clutter_box_layout_get_preferred_width (ClutterLayoutManager *layout, clutter_box_layout_get_preferred_width (ClutterLayoutManager *layout,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *natural_width_p) gfloat *natural_width_p)
@ -458,7 +453,7 @@ clutter_box_layout_get_preferred_width (ClutterLayoutManager *layout,
static void static void
clutter_box_layout_get_preferred_height (ClutterLayoutManager *layout, clutter_box_layout_get_preferred_height (ClutterLayoutManager *layout,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *natural_height_p) gfloat *natural_height_p)
@ -482,19 +477,17 @@ clutter_box_layout_get_preferred_height (ClutterLayoutManager *layout,
static void static void
count_expand_children (ClutterLayoutManager *layout, count_expand_children (ClutterLayoutManager *layout,
ClutterContainer *container, ClutterActor *container,
gint *visible_children, gint *visible_children,
gint *expand_children) gint *expand_children)
{ {
ClutterBoxLayoutPrivate *priv = CLUTTER_BOX_LAYOUT (layout)->priv; ClutterBoxLayoutPrivate *priv = CLUTTER_BOX_LAYOUT (layout)->priv;
ClutterActor *actor, *child; ClutterActor *child;
ClutterActorIter iter; ClutterActorIter iter;
actor = CLUTTER_ACTOR (container);
*visible_children = *expand_children = 0; *visible_children = *expand_children = 0;
clutter_actor_iter_init (&iter, actor); clutter_actor_iter_init (&iter, container);
while (clutter_actor_iter_next (&iter, &child)) while (clutter_actor_iter_next (&iter, &child))
{ {
if (clutter_actor_is_visible (child)) if (clutter_actor_is_visible (child))
@ -617,7 +610,7 @@ distribute_natural_allocation (float extra_space,
static void static void
clutter_box_layout_allocate (ClutterLayoutManager *layout, clutter_box_layout_allocate (ClutterLayoutManager *layout,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *box) const ClutterActorBox *box)
{ {
ClutterBoxLayoutPrivate *priv = CLUTTER_BOX_LAYOUT (layout)->priv; ClutterBoxLayoutPrivate *priv = CLUTTER_BOX_LAYOUT (layout)->priv;

View File

@ -45,7 +45,7 @@ G_DEFINE_TYPE (ClutterFixedLayout,
static void static void
clutter_fixed_layout_get_preferred_width (ClutterLayoutManager *manager, clutter_fixed_layout_get_preferred_width (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p) gfloat *nat_width_p)
@ -90,7 +90,7 @@ clutter_fixed_layout_get_preferred_width (ClutterLayoutManager *manager,
static void static void
clutter_fixed_layout_get_preferred_height (ClutterLayoutManager *manager, clutter_fixed_layout_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p) gfloat *nat_height_p)
@ -135,7 +135,7 @@ clutter_fixed_layout_get_preferred_height (ClutterLayoutManager *manager,
static void static void
clutter_fixed_layout_allocate (ClutterLayoutManager *manager, clutter_fixed_layout_allocate (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation) const ClutterActorBox *allocation)
{ {
ClutterActor *child; ClutterActor *child;

View File

@ -55,9 +55,6 @@
#include <math.h> #include <math.h>
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter/deprecated/clutter-container.h"
#include "clutter/clutter-actor.h" #include "clutter/clutter-actor.h"
#include "clutter/clutter-animatable.h" #include "clutter/clutter-animatable.h"
#include "clutter/clutter-child-meta.h" #include "clutter/clutter-child-meta.h"
@ -69,7 +66,7 @@
struct _ClutterFlowLayoutPrivate struct _ClutterFlowLayoutPrivate
{ {
ClutterContainer *container; ClutterActor *container;
ClutterFlowOrientation orientation; ClutterFlowOrientation orientation;
@ -182,7 +179,7 @@ compute_lines (ClutterFlowLayout *self,
static void static void
clutter_flow_layout_get_preferred_width (ClutterLayoutManager *manager, clutter_flow_layout_get_preferred_width (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p) gfloat *nat_width_p)
@ -373,7 +370,7 @@ clutter_flow_layout_get_preferred_width (ClutterLayoutManager *manager,
static void static void
clutter_flow_layout_get_preferred_height (ClutterLayoutManager *manager, clutter_flow_layout_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p) gfloat *nat_height_p)
@ -564,7 +561,7 @@ clutter_flow_layout_get_preferred_height (ClutterLayoutManager *manager,
static void static void
clutter_flow_layout_allocate (ClutterLayoutManager *manager, clutter_flow_layout_allocate (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation) const ClutterActorBox *allocation)
{ {
ClutterFlowLayoutPrivate *priv = CLUTTER_FLOW_LAYOUT (manager)->priv; ClutterFlowLayoutPrivate *priv = CLUTTER_FLOW_LAYOUT (manager)->priv;
@ -740,7 +737,7 @@ clutter_flow_layout_allocate (ClutterLayoutManager *manager,
static void static void
clutter_flow_layout_set_container (ClutterLayoutManager *manager, clutter_flow_layout_set_container (ClutterLayoutManager *manager,
ClutterContainer *container) ClutterActor *container)
{ {
ClutterFlowLayoutPrivate *priv = CLUTTER_FLOW_LAYOUT (manager)->priv; ClutterFlowLayoutPrivate *priv = CLUTTER_FLOW_LAYOUT (manager)->priv;
ClutterLayoutManagerClass *parent_class; ClutterLayoutManagerClass *parent_class;

View File

@ -34,7 +34,6 @@
#include "clutter/clutter-grid-layout.h" #include "clutter/clutter-grid-layout.h"
#include "clutter/clutter-actor-private.h" #include "clutter/clutter-actor-private.h"
#include "clutter/clutter-container.h"
#include "clutter/clutter-debug.h" #include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h" #include "clutter/clutter-enum-types.h"
#include "clutter/clutter-layout-meta.h" #include "clutter/clutter-layout-meta.h"
@ -103,7 +102,7 @@ struct _ClutterGridLineData
struct _ClutterGridLayoutPrivate struct _ClutterGridLayoutPrivate
{ {
ClutterContainer *container; ClutterActor *container;
ClutterOrientation orientation; ClutterOrientation orientation;
ClutterGridLineData linedata[2]; ClutterGridLineData linedata[2];
@ -1250,7 +1249,7 @@ clutter_grid_child_init (ClutterGridChild *self)
static void static void
clutter_grid_layout_set_container (ClutterLayoutManager *self, clutter_grid_layout_set_container (ClutterLayoutManager *self,
ClutterContainer *container) ClutterActor *container)
{ {
ClutterGridLayoutPrivate *priv = CLUTTER_GRID_LAYOUT (self)->priv; ClutterGridLayoutPrivate *priv = CLUTTER_GRID_LAYOUT (self)->priv;
ClutterLayoutManagerClass *parent_class; ClutterLayoutManagerClass *parent_class;
@ -1308,7 +1307,7 @@ clutter_grid_layout_get_size_for_size (ClutterGridLayout *self,
static void static void
clutter_grid_layout_get_preferred_width (ClutterLayoutManager *manager, clutter_grid_layout_get_preferred_width (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p) gfloat *nat_width_p)
@ -1327,7 +1326,7 @@ clutter_grid_layout_get_preferred_width (ClutterLayoutManager *manager,
static void static void
clutter_grid_layout_get_preferred_height (ClutterLayoutManager *manager, clutter_grid_layout_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p) gfloat *nat_height_p)
@ -1379,7 +1378,7 @@ allocate_child (ClutterGridRequest *request,
static void static void
clutter_grid_layout_allocate (ClutterLayoutManager *layout, clutter_grid_layout_allocate (ClutterLayoutManager *layout,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation) const ClutterActorBox *allocation)
{ {
ClutterGridLayout *self = CLUTTER_GRID_LAYOUT (layout); ClutterGridLayout *self = CLUTTER_GRID_LAYOUT (layout);

View File

@ -44,10 +44,12 @@
* #ClutterActor, so you should read the relative documentation * #ClutterActor, so you should read the relative documentation
* for subclassing #ClutterActor. * for subclassing #ClutterActor.
* *
* The layout manager implementation can hold a back pointer to the * The layout manager implementation can hold a back pointer to the container
* #ClutterContainer by implementing the #ClutterLayoutManagerClass.set_container() * [type@Clutter.Actor] by implementing the
* virtual function. The layout manager should not hold a real reference (i.e. * [vfunc@Clutter.LayoutManager.set_container] virtual function. The layout
* call g_object_ref()) on the container actor, to avoid reference cycles. * manager should not hold a real reference (i.e. call
* [method@GObject.Object.ref]) on the container actor, to avoid reference
* cycles.
* *
* If a layout manager has properties affecting the layout policies then it should * If a layout manager has properties affecting the layout policies then it should
* emit the #ClutterLayoutManager::layout-changed signal on itself by using the * emit the #ClutterLayoutManager::layout-changed signal on itself by using the
@ -82,8 +84,8 @@
* ``` * ```
* *
* Where `manager` is the #ClutterLayoutManager, `container` is the * Where `manager` is the #ClutterLayoutManager, `container` is the
* #ClutterContainer using the #ClutterLayoutManager, and `actor` is * #ClutterActor using the #ClutterLayoutManager, and `actor` is
* the #ClutterActor child of the #ClutterContainer. * the #ClutterActor child of the #ClutterActor.
* *
* ## Using ClutterLayoutManager with ClutterScript * ## Using ClutterLayoutManager with ClutterScript
* *
@ -132,9 +134,6 @@
#include <glib-object.h> #include <glib-object.h>
#include <gobject/gvaluecollector.h> #include <gobject/gvaluecollector.h>
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter/deprecated/clutter-container.h"
#include "clutter/clutter-debug.h" #include "clutter/clutter-debug.h"
#include "clutter/clutter-layout-manager.h" #include "clutter/clutter-layout-manager.h"
#include "clutter/clutter-layout-meta.h" #include "clutter/clutter-layout-meta.h"
@ -218,7 +217,7 @@ layout_manager_thaw_layout_change (ClutterLayoutManager *manager)
static void static void
layout_manager_real_get_preferred_width (ClutterLayoutManager *manager, layout_manager_real_get_preferred_width (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p) gfloat *nat_width_p)
@ -234,7 +233,7 @@ layout_manager_real_get_preferred_width (ClutterLayoutManager *manager,
static void static void
layout_manager_real_get_preferred_height (ClutterLayoutManager *manager, layout_manager_real_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p) gfloat *nat_height_p)
@ -250,7 +249,7 @@ layout_manager_real_get_preferred_height (ClutterLayoutManager *manager,
static void static void
layout_manager_real_allocate (ClutterLayoutManager *manager, layout_manager_real_allocate (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation) const ClutterActorBox *allocation)
{ {
LAYOUT_MANAGER_WARN_NOT_IMPLEMENTED (manager, "allocate"); LAYOUT_MANAGER_WARN_NOT_IMPLEMENTED (manager, "allocate");
@ -258,7 +257,7 @@ layout_manager_real_allocate (ClutterLayoutManager *manager,
static void static void
layout_manager_real_set_container (ClutterLayoutManager *manager, layout_manager_real_set_container (ClutterLayoutManager *manager,
ClutterContainer *container) ClutterActor *container)
{ {
if (container != NULL) if (container != NULL)
g_object_set_data (G_OBJECT (container), "clutter-layout-manager", manager); g_object_set_data (G_OBJECT (container), "clutter-layout-manager", manager);
@ -266,7 +265,7 @@ layout_manager_real_set_container (ClutterLayoutManager *manager,
static ClutterLayoutMeta * static ClutterLayoutMeta *
layout_manager_real_create_child_meta (ClutterLayoutManager *manager, layout_manager_real_create_child_meta (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor) ClutterActor *actor)
{ {
ClutterLayoutManagerClass *klass; ClutterLayoutManagerClass *klass;
@ -357,7 +356,7 @@ clutter_layout_manager_init (ClutterLayoutManager *manager)
/** /**
* clutter_layout_manager_get_preferred_width: * clutter_layout_manager_get_preferred_width:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: the #ClutterContainer using @manager * @container: the #ClutterActor using @manager
* @for_height: the height for which the width should be computed, or -1 * @for_height: the height for which the width should be computed, or -1
* @min_width_p: (out) (allow-none): return location for the minimum width * @min_width_p: (out) (allow-none): return location for the minimum width
* of the layout, or %NULL * of the layout, or %NULL
@ -371,7 +370,7 @@ clutter_layout_manager_init (ClutterLayoutManager *manager)
*/ */
void void
clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager, clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p) gfloat *nat_width_p)
@ -379,7 +378,7 @@ clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager,
ClutterLayoutManagerClass *klass; ClutterLayoutManagerClass *klass;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (container));
klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager); klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager);
klass->get_preferred_width (manager, container, for_height, klass->get_preferred_width (manager, container, for_height,
@ -390,7 +389,7 @@ clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager,
/** /**
* clutter_layout_manager_get_preferred_height: * clutter_layout_manager_get_preferred_height:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: the #ClutterContainer using @manager * @container: the #ClutterActor using @manager
* @for_width: the width for which the height should be computed, or -1 * @for_width: the width for which the height should be computed, or -1
* @min_height_p: (out) (allow-none): return location for the minimum height * @min_height_p: (out) (allow-none): return location for the minimum height
* of the layout, or %NULL * of the layout, or %NULL
@ -404,7 +403,7 @@ clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager,
*/ */
void void
clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager, clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p) gfloat *nat_height_p)
@ -412,7 +411,7 @@ clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
ClutterLayoutManagerClass *klass; ClutterLayoutManagerClass *klass;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (container));
klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager); klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager);
klass->get_preferred_height (manager, container, for_width, klass->get_preferred_height (manager, container, for_width,
@ -423,7 +422,7 @@ clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
/** /**
* clutter_layout_manager_allocate: * clutter_layout_manager_allocate:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: the #ClutterContainer using @manager * @container: the #ClutterActor using @manager
* @allocation: the #ClutterActorBox containing the allocated area * @allocation: the #ClutterActorBox containing the allocated area
* of @container * of @container
* *
@ -433,13 +432,13 @@ clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
*/ */
void void
clutter_layout_manager_allocate (ClutterLayoutManager *manager, clutter_layout_manager_allocate (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation) const ClutterActorBox *allocation)
{ {
ClutterLayoutManagerClass *klass; ClutterLayoutManagerClass *klass;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (container));
g_return_if_fail (allocation != NULL); g_return_if_fail (allocation != NULL);
klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager); klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager);
@ -474,7 +473,7 @@ clutter_layout_manager_layout_changed (ClutterLayoutManager *manager)
/** /**
* clutter_layout_manager_set_container: * clutter_layout_manager_set_container:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: (allow-none): a #ClutterContainer using @manager * @container: (allow-none): a [type@Clutter.Actor] using @manager
* *
* If the #ClutterLayoutManager sub-class allows it, allow * If the #ClutterLayoutManager sub-class allows it, allow
* adding a weak reference of the @container using @manager * adding a weak reference of the @container using @manager
@ -485,12 +484,12 @@ clutter_layout_manager_layout_changed (ClutterLayoutManager *manager)
*/ */
void void
clutter_layout_manager_set_container (ClutterLayoutManager *manager, clutter_layout_manager_set_container (ClutterLayoutManager *manager,
ClutterContainer *container) ClutterActor *container)
{ {
ClutterLayoutManagerClass *klass; ClutterLayoutManagerClass *klass;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (container == NULL || CLUTTER_IS_CONTAINER (container)); g_return_if_fail (container == NULL || CLUTTER_IS_ACTOR (container));
klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager); klass = CLUTTER_LAYOUT_MANAGER_GET_CLASS (manager);
if (klass->set_container) if (klass->set_container)
@ -505,7 +504,7 @@ _clutter_layout_manager_get_child_meta_type (ClutterLayoutManager *manager)
static inline ClutterLayoutMeta * static inline ClutterLayoutMeta *
create_child_meta (ClutterLayoutManager *manager, create_child_meta (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor) ClutterActor *actor)
{ {
ClutterLayoutManagerClass *klass; ClutterLayoutManagerClass *klass;
@ -524,7 +523,7 @@ create_child_meta (ClutterLayoutManager *manager,
static inline ClutterLayoutMeta * static inline ClutterLayoutMeta *
get_child_meta (ClutterLayoutManager *manager, get_child_meta (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor) ClutterActor *actor)
{ {
ClutterLayoutMeta *layout = NULL; ClutterLayoutMeta *layout = NULL;
@ -535,7 +534,7 @@ get_child_meta (ClutterLayoutManager *manager,
ClutterChildMeta *child = CLUTTER_CHILD_META (layout); ClutterChildMeta *child = CLUTTER_CHILD_META (layout);
if (layout->manager == manager && if (layout->manager == manager &&
child->container == container && CLUTTER_ACTOR (child->container) == container &&
child->actor == actor) child->actor == actor)
return layout; return layout;
@ -561,8 +560,8 @@ get_child_meta (ClutterLayoutManager *manager,
/** /**
* clutter_layout_manager_get_child_meta: * clutter_layout_manager_get_child_meta:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: a #ClutterContainer using @manager * @container: a [type@Clutter.Actor] using @manager
* @actor: a #ClutterActor child of @container * @actor: a [type@Clutter.Actor] child of @container
* *
* Retrieves the #ClutterLayoutMeta that the layout @manager associated * Retrieves the #ClutterLayoutMeta that the layout @manager associated
* to the @actor child of @container, eventually by creating one if the * to the @actor child of @container, eventually by creating one if the
@ -575,11 +574,11 @@ get_child_meta (ClutterLayoutManager *manager,
*/ */
ClutterLayoutMeta * ClutterLayoutMeta *
clutter_layout_manager_get_child_meta (ClutterLayoutManager *manager, clutter_layout_manager_get_child_meta (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor) ClutterActor *actor)
{ {
g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), NULL); g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), NULL);
g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL); g_return_val_if_fail (CLUTTER_IS_ACTOR (container), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL);
return get_child_meta (manager, container, actor); return get_child_meta (manager, container, actor);
@ -634,8 +633,8 @@ layout_get_property_internal (ClutterLayoutManager *manager,
/** /**
* clutter_layout_manager_child_set: * clutter_layout_manager_child_set:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: a #ClutterContainer using @manager * @container: a [type@Clutter.Actor] using @manager
* @actor: a #ClutterActor child of @container * @actor: a [type@Clutter.Actor] child of @container
* @first_property: the first property name * @first_property: the first property name
* @...: a list of property name and value pairs * @...: a list of property name and value pairs
* *
@ -647,7 +646,7 @@ layout_get_property_internal (ClutterLayoutManager *manager,
*/ */
void void
clutter_layout_manager_child_set (ClutterLayoutManager *manager, clutter_layout_manager_child_set (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *first_property, const gchar *first_property,
...) ...)
@ -658,7 +657,7 @@ clutter_layout_manager_child_set (ClutterLayoutManager *manager,
va_list var_args; va_list var_args;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_return_if_fail (first_property != NULL); g_return_if_fail (first_property != NULL);
@ -721,8 +720,8 @@ clutter_layout_manager_child_set (ClutterLayoutManager *manager,
/** /**
* clutter_layout_manager_child_set_property: * clutter_layout_manager_child_set_property:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: a #ClutterContainer using @manager * @container: a [type@Clutter.Actor] using @manager
* @actor: a #ClutterActor child of @container * @actor: a [type@Clutter.Actor] child of @container
* @property_name: the name of the property to set * @property_name: the name of the property to set
* @value: a #GValue with the value of the property to set * @value: a #GValue with the value of the property to set
* *
@ -731,7 +730,7 @@ clutter_layout_manager_child_set (ClutterLayoutManager *manager,
*/ */
void void
clutter_layout_manager_child_set_property (ClutterLayoutManager *manager, clutter_layout_manager_child_set_property (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *property_name, const gchar *property_name,
const GValue *value) const GValue *value)
@ -741,7 +740,7 @@ clutter_layout_manager_child_set_property (ClutterLayoutManager *manager,
GParamSpec *pspec; GParamSpec *pspec;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
g_return_if_fail (value != NULL); g_return_if_fail (value != NULL);
@ -772,8 +771,8 @@ clutter_layout_manager_child_set_property (ClutterLayoutManager *manager,
/** /**
* clutter_layout_manager_child_get: * clutter_layout_manager_child_get:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: a #ClutterContainer using @manager * @container: a [type@Clutter.Actor] using @manager
* @actor: a #ClutterActor child of @container * @actor: a [type@Clutter.Actor] child of @container
* @first_property: the name of the first property * @first_property: the name of the first property
* @...: a list of property name and return location for the value pairs * @...: a list of property name and return location for the value pairs
* *
@ -783,7 +782,7 @@ clutter_layout_manager_child_set_property (ClutterLayoutManager *manager,
*/ */
void void
clutter_layout_manager_child_get (ClutterLayoutManager *manager, clutter_layout_manager_child_get (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *first_property, const gchar *first_property,
...) ...)
@ -794,7 +793,7 @@ clutter_layout_manager_child_get (ClutterLayoutManager *manager,
va_list var_args; va_list var_args;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_return_if_fail (first_property != NULL); g_return_if_fail (first_property != NULL);
@ -859,8 +858,8 @@ clutter_layout_manager_child_get (ClutterLayoutManager *manager,
/** /**
* clutter_layout_manager_child_get_property: * clutter_layout_manager_child_get_property:
* @manager: a #ClutterLayoutManager * @manager: a #ClutterLayoutManager
* @container: a #ClutterContainer using @manager * @container: a [type@Clutter.Actor] using @manager
* @actor: a #ClutterActor child of @container * @actor: a [type@Clutter.Actor] child of @container
* @property_name: the name of the property to get * @property_name: the name of the property to get
* @value: a #GValue with the value of the property to get * @value: a #GValue with the value of the property to get
* *
@ -873,7 +872,7 @@ clutter_layout_manager_child_get (ClutterLayoutManager *manager,
*/ */
void void
clutter_layout_manager_child_get_property (ClutterLayoutManager *manager, clutter_layout_manager_child_get_property (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *property_name, const gchar *property_name,
GValue *value) GValue *value)
@ -883,7 +882,7 @@ clutter_layout_manager_child_get_property (ClutterLayoutManager *manager,
GParamSpec *pspec; GParamSpec *pspec;
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_return_if_fail (property_name != NULL); g_return_if_fail (property_name != NULL);
g_return_if_fail (value != NULL); g_return_if_fail (value != NULL);

View File

@ -32,20 +32,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define CLUTTER_TYPE_LAYOUT_MANAGER (clutter_layout_manager_get_type ()) #define CLUTTER_TYPE_LAYOUT_MANAGER (clutter_layout_manager_get_type ())
#define CLUTTER_LAYOUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_LAYOUT_MANAGER, ClutterLayoutManager))
#define CLUTTER_IS_LAYOUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_LAYOUT_MANAGER))
#define CLUTTER_LAYOUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_LAYOUT_MANAGER, ClutterLayoutManagerClass))
#define CLUTTER_IS_LAYOUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_LAYOUT_MANAGER))
#define CLUTTER_LAYOUT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_LAYOUT_MANAGER, ClutterLayoutManagerClass))
typedef struct _ClutterLayoutManagerClass ClutterLayoutManagerClass; CLUTTER_EXPORT
G_DECLARE_DERIVABLE_TYPE (ClutterLayoutManager,
struct _ClutterLayoutManager clutter_layout_manager,
{ CLUTTER,
/*< private >*/ LAYOUT_MANAGER,
GInitiallyUnowned parent_instance; GInitiallyUnowned)
};
/** /**
* ClutterLayoutManagerClass: * ClutterLayoutManagerClass:
@ -59,14 +53,15 @@ struct _ClutterLayoutManager
* layout manager. See also the allocate() virtual function in * layout manager. See also the allocate() virtual function in
* #ClutterActor * #ClutterActor
* @set_container: virtual function; override to set a back pointer * @set_container: virtual function; override to set a back pointer
* on the #ClutterContainer using the layout manager. The implementation * on the [type@Clutter.Actor] using the layout manager. The implementation
* should not take a reference on the container, but just take a weak * should not take a reference on the container, but just take a weak
* reference, to avoid potential leaks due to reference cycles * reference, to avoid potential leaks due to reference cycles
* @get_child_meta_type: virtual function; override to return the #GType * @get_child_meta_type: virtual function; override to return the #GType
* of the #ClutterLayoutMeta sub-class used by the #ClutterLayoutManager * of the #ClutterLayoutMeta sub-class used by the #ClutterLayoutManager
* @create_child_meta: virtual function; override to create a * @create_child_meta: virtual function; override to create a
* #ClutterLayoutMeta instance associated to a #ClutterContainer and a * [type@Clutter.LayoutMeta] instance associated to a container
* child #ClutterActor, used to maintain layout manager specific properties * [type@Clutter.Actor] and a child [type@Clutter.Actor], used to maintain
* layout manager specific properties
* @layout_changed: class handler for the #ClutterLayoutManager::layout-changed * @layout_changed: class handler for the #ClutterLayoutManager::layout-changed
* signal * signal
* *
@ -80,53 +75,50 @@ struct _ClutterLayoutManagerClass
/*< public >*/ /*< public >*/
void (* get_preferred_width) (ClutterLayoutManager *manager, void (* get_preferred_width) (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p); gfloat *nat_width_p);
void (* get_preferred_height) (ClutterLayoutManager *manager, void (* get_preferred_height) (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p); gfloat *nat_height_p);
void (* allocate) (ClutterLayoutManager *manager, void (* allocate) (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation); const ClutterActorBox *allocation);
void (* set_container) (ClutterLayoutManager *manager, void (* set_container) (ClutterLayoutManager *manager,
ClutterContainer *container); ClutterActor *container);
GType (* get_child_meta_type) (ClutterLayoutManager *manager); GType (* get_child_meta_type) (ClutterLayoutManager *manager);
ClutterLayoutMeta *(* create_child_meta) (ClutterLayoutManager *manager, ClutterLayoutMeta *(* create_child_meta) (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor); ClutterActor *actor);
void (* layout_changed) (ClutterLayoutManager *manager); void (* layout_changed) (ClutterLayoutManager *manager);
}; };
CLUTTER_EXPORT
GType clutter_layout_manager_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager, void clutter_layout_manager_get_preferred_width (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_height, gfloat for_height,
gfloat *min_width_p, gfloat *min_width_p,
gfloat *nat_width_p); gfloat *nat_width_p);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager, void clutter_layout_manager_get_preferred_height (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
gfloat for_width, gfloat for_width,
gfloat *min_height_p, gfloat *min_height_p,
gfloat *nat_height_p); gfloat *nat_height_p);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_allocate (ClutterLayoutManager *manager, void clutter_layout_manager_allocate (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
const ClutterActorBox *allocation); const ClutterActorBox *allocation);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_set_container (ClutterLayoutManager *manager, void clutter_layout_manager_set_container (ClutterLayoutManager *manager,
ClutterContainer *container); ClutterActor *container);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_layout_changed (ClutterLayoutManager *manager); void clutter_layout_manager_layout_changed (ClutterLayoutManager *manager);
@ -139,30 +131,30 @@ GParamSpec ** clutter_layout_manager_list_child_properties (ClutterLayoutMa
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterLayoutMeta *clutter_layout_manager_get_child_meta (ClutterLayoutManager *manager, ClutterLayoutMeta *clutter_layout_manager_get_child_meta (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor); ClutterActor *actor);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_child_set (ClutterLayoutManager *manager, void clutter_layout_manager_child_set (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *first_property, const gchar *first_property,
...) G_GNUC_NULL_TERMINATED; ...) G_GNUC_NULL_TERMINATED;
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_child_get (ClutterLayoutManager *manager, void clutter_layout_manager_child_get (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *first_property, const gchar *first_property,
...) G_GNUC_NULL_TERMINATED; ...) G_GNUC_NULL_TERMINATED;
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_child_set_property (ClutterLayoutManager *manager, void clutter_layout_manager_child_set_property (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *property_name, const gchar *property_name,
const GValue *value); const GValue *value);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_layout_manager_child_get_property (ClutterLayoutManager *manager, void clutter_layout_manager_child_get_property (ClutterLayoutManager *manager,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
const gchar *property_name, const gchar *property_name,
GValue *value); GValue *value);

View File

@ -1549,7 +1549,7 @@ clutter_script_construct_parameters (ClutterScript *script,
static void static void
apply_layout_properties (ClutterScript *script, apply_layout_properties (ClutterScript *script,
ClutterContainer *container, ClutterActor *container,
ClutterActor *actor, ClutterActor *actor,
ObjectInfo *oinfo) ObjectInfo *oinfo)
{ {
@ -1737,7 +1737,7 @@ _clutter_script_check_unresolved (ClutterScript *script,
if (child_info == NULL) if (child_info == NULL)
continue; continue;
apply_layout_properties (script, CLUTTER_CONTAINER (parent), apply_layout_properties (script, parent,
child, child,
child_info); child_info);
} }

View File

@ -42,12 +42,10 @@
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS #define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter/clutter-stage.h" #include "clutter/clutter-stage.h"
#include "clutter/deprecated/clutter-container.h"
#include "clutter/clutter-action-private.h" #include "clutter/clutter-action-private.h"
#include "clutter/clutter-actor-private.h" #include "clutter/clutter-actor-private.h"
#include "clutter/clutter-backend-private.h" #include "clutter/clutter-backend-private.h"
#include "clutter/clutter-container.h"
#include "clutter/clutter-debug.h" #include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h" #include "clutter/clutter-enum-types.h"
#include "clutter/clutter-event-private.h" #include "clutter/clutter-event-private.h"
@ -321,7 +319,7 @@ clutter_stage_allocate (ClutterActor *self,
clutter_actor_set_allocation (self, box); clutter_actor_set_allocation (self, box);
clutter_layout_manager_allocate (layout_manager, clutter_layout_manager_allocate (layout_manager,
CLUTTER_CONTAINER (self), self,
&children_box); &children_box);
if (window_size.width != CLUTTER_NEARBYINT (width) || if (window_size.width != CLUTTER_NEARBYINT (width) ||

View File

@ -37,6 +37,7 @@
#include "clutter/clutter-backend.h" #include "clutter/clutter-backend.h"
#include "clutter/clutter-bind-constraint.h" #include "clutter/clutter-bind-constraint.h"
#include "clutter/clutter-binding-pool.h" #include "clutter/clutter-binding-pool.h"
#include "clutter/clutter-bin-layout.h"
#include "clutter/clutter-blur-effect.h" #include "clutter/clutter-blur-effect.h"
#include "clutter/clutter-box-layout.h" #include "clutter/clutter-box-layout.h"
#include "clutter/clutter-brightness-contrast-effect.h" #include "clutter/clutter-brightness-contrast-effect.h"
@ -107,7 +108,6 @@
#include "clutter/clutter-units.h" #include "clutter/clutter-units.h"
#include "clutter/clutter-virtual-input-device.h" #include "clutter/clutter-virtual-input-device.h"
#include "clutter/clutter-zoom-action.h" #include "clutter/clutter-zoom-action.h"
#include "clutter/clutter-bin-layout.h"
#include "clutter/clutter-deprecated.h" #include "clutter/clutter-deprecated.h"

View File

@ -280,7 +280,7 @@ test_text_field_main (gint argc,
label = create_label (CLUTTER_COLOR_White, "<b>Input field:</b>"); label = create_label (CLUTTER_COLOR_White, "<b>Input field:</b>");
g_object_set (label, "min-width", 150.0, NULL); g_object_set (label, "min-width", 150.0, NULL);
clutter_actor_add_child (box, label); clutter_actor_add_child (box, label);
clutter_layout_manager_child_set (grid, CLUTTER_CONTAINER (box), label, clutter_layout_manager_child_set (grid, box, label,
"row", 0, "row", 0,
"column", 0, "column", 0,
"x-expand", FALSE, "x-expand", FALSE,
@ -292,7 +292,7 @@ test_text_field_main (gint argc,
pango_attr_list_insert (entry_attrs, pango_attr_underline_color_new (65535, 0, 0)); pango_attr_list_insert (entry_attrs, pango_attr_underline_color_new (65535, 0, 0));
entry = create_entry (CLUTTER_COLOR_Black, "somme misspeeled textt", entry_attrs, 0, 0); entry = create_entry (CLUTTER_COLOR_Black, "somme misspeeled textt", entry_attrs, 0, 0);
clutter_actor_add_child (box, entry); clutter_actor_add_child (box, entry);
clutter_layout_manager_child_set (grid, CLUTTER_CONTAINER (box), entry, clutter_layout_manager_child_set (grid, box, entry,
"row", 0, "row", 0,
"column", 1, "column", 1,
"x-expand", TRUE, "x-expand", TRUE,
@ -303,7 +303,7 @@ test_text_field_main (gint argc,
label = create_label (CLUTTER_COLOR_White, "<b>A very long password field:</b>"); label = create_label (CLUTTER_COLOR_White, "<b>A very long password field:</b>");
clutter_actor_add_child (box, label); clutter_actor_add_child (box, label);
clutter_layout_manager_child_set (grid, CLUTTER_CONTAINER (box), label, clutter_layout_manager_child_set (grid, box, label,
"row", 1, "row", 1,
"column", 0, "column", 0,
"x-expand", FALSE, "x-expand", FALSE,
@ -312,7 +312,7 @@ test_text_field_main (gint argc,
entry = create_entry (CLUTTER_COLOR_Black, "password", NULL, '*', 8); entry = create_entry (CLUTTER_COLOR_Black, "password", NULL, '*', 8);
clutter_actor_add_child (box, entry); clutter_actor_add_child (box, entry);
clutter_layout_manager_child_set (grid, CLUTTER_CONTAINER (box), entry, clutter_layout_manager_child_set (grid, box, entry,
"row", 1, "row", 1,
"column", 1, "column", 1,
"x-expand", TRUE, "x-expand", TRUE,