Commit 5cc29888 authored by Emmanuele Bassi's avatar Emmanuele Bassi

2006-11-20 Emmanuele Bassi <ebassi@openedhand.com>

	* clutter/Makefile.am:
	* clutter/clutter.h:
	* clutter/clutter-version.h.in: Auto-generated versioning macros.

	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c: Add a ClutterActor::parent-set signal,
	for notificating changes of an actor's parent; add api-doc for
	the actor's properties; add the ClutterActor "name" property; clean
	up a bit some functions; emit the "parent-set" signal when setting
	te parent and when unparenting; better warnings when lowering
	and raising an actor.

	* configure.ac:
	* clutter/Makefile.am: Add a --enable-debug configure option,
	with three levels of debugging: no, minimum and yes; default
	for development releases (odd minor version) is "yes"; update
	the version m4 defines; update the libtool macros: now just
	changed the clutter_interface_age when releasing will update
	everything else.
parent c9b6a89d
2006-11-20 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/Makefile.am:
* clutter/clutter.h:
* clutter/clutter-version.h.in: Auto-generated versioning macros.
* clutter/clutter-actor.h:
* clutter/clutter-actor.c: Add a ClutterActor::parent-set signal,
for notificating changes of an actor's parent; add api-doc for
the actor's properties; add the ClutterActor "name" property; clean
up a bit some functions; emit the "parent-set" signal when setting
te parent and when unparenting; better warnings when lowering
and raising an actor.
* configure.ac:
* clutter/Makefile.am: Add a --enable-debug configure option,
with three levels of debugging: no, minimum and yes; default
for development releases (odd minor version) is "yes"; update
the version m4 defines; update the libtool macros: now just
changed the clutter_interface_age when releasing will update
everything else.
2006-11-17 Emmanuele Bassi <ebassi@openedhand.com> 2006-11-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-behaviour-path.h: * clutter/clutter-behaviour-path.h:
......
...@@ -2,6 +2,7 @@ SUBDIRS=pango ...@@ -2,6 +2,7 @@ SUBDIRS=pango
MARSHALFILES = clutter-marshal.c clutter-marshal.h MARSHALFILES = clutter-marshal.c clutter-marshal.h
ENUMFILES = clutter-enum-types.c clutter-enum-types.h ENUMFILES = clutter-enum-types.c clutter-enum-types.h
STAMPFILES = stamp-clutter-marshal.h stamp-clutter-enum-types.h
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0` GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0`
...@@ -28,15 +29,28 @@ source_h = \ ...@@ -28,15 +29,28 @@ source_h = \
$(srcdir)/clutter-behaviour-scale.h \ $(srcdir)/clutter-behaviour-scale.h \
$(srcdir)/clutter-alpha.h \ $(srcdir)/clutter-alpha.h \
$(srcdir)/clutter-media.h \ $(srcdir)/clutter-media.h \
$(srcdir)/clutter-version.h \
$(srcdir)/clutter-main.h $(srcdir)/clutter-main.h
clutter-marshal.h: clutter-marshal.list clutter-marshal.h: stamp-clutter-marshal.h
( $(GLIB_GENMARSHAL) --prefix=clutter_marshal \ @true
$(srcdir)/clutter-marshal.list --header > clutter-marshal.h ) stamp-clutter-marshal.h: clutter-marshal.list
$(GLIB_GENMARSHAL) \
--prefix=clutter_marshal \
--header \
$(srcdir)/clutter-marshal.list > xgen-cmh \
&& (cmp -s xgen-cmh clutter-marshal.h || cp xgen-cmh clutter-marshal.h ) \
&& rm -f xgen-cmh \
&& echo timestamp > $(@F)
clutter-marshal.c: clutter-marshal.h clutter-marshal.c: clutter-marshal.h Makefile
( $(GLIB_GENMARSHAL) --prefix=clutter_marshal \ ( echo "#include \"clutter-marshal.h\"" ; \
$(srcdir)/clutter-marshal.list --body --header > clutter-marshal.c ) $(GLIB_GENMARSHAL) \
--prefix=clutter_marshal \
--body \
$(srcdir)/clutter-marshal.list --body ) >> xgen-cmc \
&& cp xgen-cmc clutter-marshal.c \
&& rm -f xgen-cmc
clutter-enum-types.h: stamp-clutter-enum-types.h clutter-enum-types.h: stamp-clutter-enum-types.h
@true @true
...@@ -73,7 +87,9 @@ clutter-enum-types.c: clutter-enum-types.h ...@@ -73,7 +87,9 @@ clutter-enum-types.c: clutter-enum-types.h
&& cp xgen-cetc clutter-enum-types.c \ && cp xgen-cetc clutter-enum-types.c \
&& rm -f xgen-cetc && rm -f xgen-cetc
CLEANFILES = $(BUILT_SOURCES) stamp-clutter-enum-types.h CLEANFILES = \
$(BUILT_SOURCES) \
$(STAMPFILES)
source_c = clutter-main.c \ source_c = clutter-main.c \
clutter-util.c \ clutter-util.c \
...@@ -103,7 +119,16 @@ libclutter_@CLUTTER_MAJORMINOR@_la_SOURCES = $(MARSHALFILES) \ ...@@ -103,7 +119,16 @@ libclutter_@CLUTTER_MAJORMINOR@_la_SOURCES = $(MARSHALFILES) \
$(source_h) \ $(source_h) \
$(source_h_priv) $(source_h_priv)
INCLUDES = @GCC_FLAGS@ @CLUTTER_CFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/clutter/pango INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter/pango \
-DPREFIX=\""$(prefix)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DG_DISABLE_DEPRECATED \
$(GCC_FLAGS) \
$(CLUTTER_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS)
lib_LTLIBRARIES = libclutter-@CLUTTER_MAJORMINOR@.la lib_LTLIBRARIES = libclutter-@CLUTTER_MAJORMINOR@.la
...@@ -119,4 +144,4 @@ clutterheaders_HEADERS = $(source_h) \ ...@@ -119,4 +144,4 @@ clutterheaders_HEADERS = $(source_h) \
clutter-enum-types.h \ clutter-enum-types.h \
clutter.h clutter.h
EXTRA_DIST = clutter-marshal.list EXTRA_DIST = clutter-marshal.list clutter-version.h.in
...@@ -90,6 +90,7 @@ enum ...@@ -90,6 +90,7 @@ enum
SHOW, SHOW,
HIDE, HIDE,
DESTROY, DESTROY,
PARENT_SET,
LAST_SIGNAL LAST_SIGNAL
}; };
...@@ -590,69 +591,121 @@ clutter_actor_class_init (ClutterActorClass *klass) ...@@ -590,69 +591,121 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_type_class_add_private (klass, sizeof (ClutterActorPrivate)); g_type_class_add_private (klass, sizeof (ClutterActorPrivate));
g_object_class_install_property (object_class, PROP_X, /**
g_param_spec_int ("x", * ClutterActor:x:
"X co-ord", *
"X co-ord of actor", * X coordinate of the actor.
0, */
G_MAXINT, g_object_class_install_property (object_class,
0, PROP_X,
G_PARAM_READWRITE)); g_param_spec_int ("x",
"X co-ord",
g_object_class_install_property (object_class, PROP_Y, "X co-ord of actor",
g_param_spec_int ("y", 0, G_MAXINT,
"Y co-ord", 0,
"Y co-ord of actor", G_PARAM_READWRITE));
0, /**
G_MAXINT, * ClutterActor:y:
0, *
G_PARAM_READWRITE)); * Y coordinate of the actor.
*/
g_object_class_install_property (object_class, PROP_WIDTH, g_object_class_install_property (object_class,
g_param_spec_int ("width", PROP_Y,
"Width", g_param_spec_int ("y",
"Width of actor in pixels", "Y co-ord",
0, "Y co-ord of actor",
G_MAXINT, 0, G_MAXINT,
0, 0,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/**
g_object_class_install_property (object_class, PROP_HEIGHT, * ClutterActor:width:
g_param_spec_int ("height", *
"Height", * Width of the actor (in pixels).
"Height of actor in pixels", */
0, g_object_class_install_property (object_class,
G_MAXINT, PROP_WIDTH,
0, g_param_spec_int ("width",
G_PARAM_READWRITE)); "Width",
"Width of actor in pixels",
g_object_class_install_property (object_class, PROP_OPACITY, 0, G_MAXINT,
g_param_spec_uchar ("opacity", 0,
"Opacity", G_PARAM_READWRITE));
"Opacity of actor", /**
0, * ClutterActor:height:
0xff, *
0xff, * Height of the actor (in pixels).
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); */
g_object_class_install_property (object_class,
g_object_class_install_property (object_class, PROP_VISIBLE, PROP_HEIGHT,
g_param_spec_boolean ("visible", g_param_spec_int ("height",
"Visible", "Height",
"Whether the actor is visible or not", "Height of actor in pixels",
FALSE, 0, G_MAXINT,
G_PARAM_READWRITE)); 0,
g_object_class_install_property (object_class, PROP_HAS_CLIP, G_PARAM_READWRITE));
g_param_spec_boolean ("has-clip", /**
"Has Clip", * ClutterActor:opacity:
"Whether the actor has a clip set or not", *
FALSE, * Opacity of the actor.
G_PARAM_READABLE)); */
g_object_class_install_property (object_class, PROP_CLIP, g_object_class_install_property (object_class,
g_param_spec_boxed ("clip", PROP_OPACITY,
"Clip", g_param_spec_uchar ("opacity",
"The clip region for the actor", "Opacity",
CLUTTER_TYPE_GEOMETRY, "Opacity of actor",
G_PARAM_READWRITE)); 0, 0xff,
0xff,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
* ClutterActor:visible:
*
* Whether the actor is visible or not.
*/
g_object_class_install_property (object_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
"Visible",
"Whether the actor is visible or not",
FALSE,
G_PARAM_READWRITE));
/**
* ClutterActor:has-clip:
*
* Whether the actor has the clip property set or not.
*/
g_object_class_install_property (object_class,
PROP_HAS_CLIP,
g_param_spec_boolean ("has-clip",
"Has Clip",
"Whether the actor has a clip set or not",
FALSE,
G_PARAM_READABLE));
/**
* ClutterActor:clip:
*
* The clip region for the actor.
*/
g_object_class_install_property (object_class,
PROP_CLIP,
g_param_spec_boxed ("clip",
"Clip",
"The clip region for the actor",
CLUTTER_TYPE_GEOMETRY,
G_PARAM_READWRITE));
/**
* ClutterActor:name:
*
* The name of the actor.
*
* Since: 0.2
*/
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
"Name",
"Name of the actor",
NULL,
G_PARAM_READWRITE));
/** /**
* ClutterActor::destroy: * ClutterActor::destroy:
...@@ -662,7 +715,7 @@ clutter_actor_class_init (ClutterActorClass *klass) ...@@ -662,7 +715,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
* either by direct invocation of clutter_actor_destroy() or * either by direct invocation of clutter_actor_destroy() or
* when the #ClutterGroup that contains the actor is destroyed. * when the #ClutterGroup that contains the actor is destroyed.
* *
* Since: 0.1.1 * Since: 0.2
*/ */
actor_signals[DESTROY] = actor_signals[DESTROY] =
g_signal_new ("destroy", g_signal_new ("destroy",
...@@ -678,7 +731,7 @@ clutter_actor_class_init (ClutterActorClass *klass) ...@@ -678,7 +731,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
* *
* The ::show signal is emitted when an actor becomes visible. * The ::show signal is emitted when an actor becomes visible.
* *
* Since: 0.1.1 * Since: 0.2
*/ */
actor_signals[SHOW] = actor_signals[SHOW] =
g_signal_new ("show", g_signal_new ("show",
...@@ -694,7 +747,7 @@ clutter_actor_class_init (ClutterActorClass *klass) ...@@ -694,7 +747,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
* *
* The ::hide signal is emitted when an actor is no longer visible. * The ::hide signal is emitted when an actor is no longer visible.
* *
* Since: 0.1.1 * Since: 0.2
*/ */
actor_signals[HIDE] = actor_signals[HIDE] =
g_signal_new ("hide", g_signal_new ("hide",
...@@ -703,7 +756,25 @@ clutter_actor_class_init (ClutterActorClass *klass) ...@@ -703,7 +756,25 @@ clutter_actor_class_init (ClutterActorClass *klass)
G_STRUCT_OFFSET (ClutterActorClass, hide), G_STRUCT_OFFSET (ClutterActorClass, hide),
NULL, NULL, NULL, NULL,
clutter_marshal_VOID__VOID, clutter_marshal_VOID__VOID,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
/**
* ClutterActor::parent-set:
* @actor: the object which received the signal
* @old_parent: the previous parent of the actor, or %NULL
*
* This signal is emitted when the parent of the actor changes.
*
* Since: 0.2
*/
actor_signals[PARENT_SET] =
g_signal_new ("parent-set",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterActorClass, parent_set),
NULL, NULL,
clutter_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
CLUTTER_TYPE_ACTOR);
} }
static void static void
...@@ -829,10 +900,10 @@ clutter_actor_get_geometry (ClutterActor *self, ...@@ -829,10 +900,10 @@ clutter_actor_get_geometry (ClutterActor *self,
*/ */
void void
clutter_actor_get_coords (ClutterActor *self, clutter_actor_get_coords (ClutterActor *self,
gint *x1, gint *x1,
gint *y1, gint *y1,
gint *x2, gint *x2,
gint *y2) gint *y2)
{ {
ClutterActorBox box; ClutterActorBox box;
...@@ -840,10 +911,17 @@ clutter_actor_get_coords (ClutterActor *self, ...@@ -840,10 +911,17 @@ clutter_actor_get_coords (ClutterActor *self,
clutter_actor_allocate_coords (self, &box); clutter_actor_allocate_coords (self, &box);
if (x1) *x1 = box.x1; if (x1)
if (y1) *y1 = box.y1; *x1 = box.x1;
if (x2) *x2 = box.x2;
if (y2) *y2 = box.y2; if (y1)
*y1 = box.y1;
if (x2)
*x2 = box.x2;
if (y2)
*y2 = box.y2;
} }
/** /**
...@@ -857,8 +935,8 @@ clutter_actor_get_coords (ClutterActor *self, ...@@ -857,8 +935,8 @@ clutter_actor_get_coords (ClutterActor *self,
*/ */
void void
clutter_actor_set_position (ClutterActor *self, clutter_actor_set_position (ClutterActor *self,
gint x, gint x,
gint y) gint y)
{ {
ClutterActorBox box; ClutterActorBox box;
...@@ -916,8 +994,8 @@ clutter_actor_move_by (ClutterActor *self, ...@@ -916,8 +994,8 @@ clutter_actor_move_by (ClutterActor *self,
*/ */
void void
clutter_actor_set_size (ClutterActor *self, clutter_actor_set_size (ClutterActor *self,
gint width, gint width,
gint height) gint height)
{ {
ClutterActorBox box; ClutterActorBox box;
...@@ -949,9 +1027,10 @@ clutter_actor_get_size (ClutterActor *self, ...@@ -949,9 +1027,10 @@ clutter_actor_get_size (ClutterActor *self,
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
if (width) if (width)
*width = clutter_actor_get_width(self); *width = clutter_actor_get_width (self);
if (height) if (height)
*height = clutter_actor_get_height(self); *height = clutter_actor_get_height (self);
} }
/** /**
...@@ -981,17 +1060,23 @@ clutter_actor_get_abs_position (ClutterActor *self, ...@@ -981,17 +1060,23 @@ clutter_actor_get_abs_position (ClutterActor *self,
/* FIXME: must be nicer way to get 0,0 for stage ? */ /* FIXME: must be nicer way to get 0,0 for stage ? */
if (parent) if (parent)
{ {
ClutterFixed parent_scale_x, parent_scale_y, fx, fy; ClutterFixed parent_scale_x, parent_scale_y;
ClutterFixed fx, fy;
clutter_actor_get_scalex(parent, &parent_scale_x, &parent_scale_y); clutter_actor_get_scalex (parent,
&parent_scale_x,
&parent_scale_y);
if (parent_scale_x != CFX_ONE || parent_scale_y != CFX_ONE) if (parent_scale_x != CFX_ONE ||
parent_scale_y != CFX_ONE)
{ {
fx = CLUTTER_FIXED_MUL(CLUTTER_INT_TO_FIXED(box.x1),parent_scale_x); fx = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (box.x1),
fy = CLUTTER_FIXED_MUL(CLUTTER_INT_TO_FIXED(box.y1),parent_scale_y); parent_scale_x);
fy = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (box.y1),
parent_scale_y);
box.x1 = CLUTTER_FIXED_INT(fx); box.x1 = CLUTTER_FIXED_INT (fx);
box.y1 = CLUTTER_FIXED_INT(fy); box.y1 = CLUTTER_FIXED_INT (fy);
} }
if (!CLUTTER_IS_STAGE (parent)) if (!CLUTTER_IS_STAGE (parent))
...@@ -1026,6 +1111,7 @@ clutter_actor_get_abs_size (ClutterActor *self, ...@@ -1026,6 +1111,7 @@ clutter_actor_get_abs_size (ClutterActor *self,
if (width) if (width)
*width = box.x2 - box.x1; *width = box.x2 - box.x1;
if (height) if (height)
*height = box.y2 - box.y1; *height = box.y2 - box.y1;
...@@ -1033,26 +1119,27 @@ clutter_actor_get_abs_size (ClutterActor *self, ...@@ -1033,26 +1119,27 @@ clutter_actor_get_abs_size (ClutterActor *self,
do do
{ {
if (parent->priv->scale_x != CFX_ONE || parent->priv->scale_y != CFX_ONE) if (parent->priv->scale_x != CFX_ONE ||
parent->priv->scale_y != CFX_ONE)
{ {
ClutterFixed fx, fy; ClutterFixed fx, fy;
if (width) if (width)
{ {
fx = CLUTTER_FIXED_MUL(CLUTTER_INT_TO_FIXED(*width), fx = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (*width),
parent->priv->scale_x); parent->priv->scale_x);
*width = CLUTTER_FIXED_INT(fx); *width = CLUTTER_FIXED_INT (fx);
} }
if (height) if (height)
{ {
fy = CLUTTER_FIXED_MUL(CLUTTER_INT_TO_FIXED(*height), fy = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (*height),
parent->priv->scale_x); parent->priv->scale_x);
*height = CLUTTER_FIXED_INT(fy); *height = CLUTTER_FIXED_INT (fy);
} }
} }
} }
while ((parent = clutter_actor_get_parent(parent)) != NULL); while ((parent = clutter_actor_get_parent (parent)) != NULL);
} }
...@@ -1206,14 +1293,14 @@ clutter_actor_get_scalex (ClutterActor *self, ...@@ -1206,14 +1293,14 @@ clutter_actor_get_scalex (ClutterActor *self,
*/ */
void void
clutter_actor_get_scale (ClutterActor *self, clutter_actor_get_scale (ClutterActor *self,
double *scale_x, gdouble *scale_x,
double *scale_y) gdouble *scale_y)
{ {
if (scale_x) if (scale_x)
*scale_x = CLUTTER_FIXED_TO_FLOAT(self->priv->scale_x); *scale_x = CLUTTER_FIXED_TO_FLOAT (self->priv->scale_x);
if (scale_y) if (scale_y)
*scale_y = CLUTTER_FIXED_TO_FLOAT(self->priv->scale_y); *scale_y = CLUTTER_FIXED_TO_FLOAT (self->priv->scale_y);
} }
...@@ -1273,12 +1360,15 @@ clutter_actor_set_name (ClutterActor *self, ...@@ -1273,12 +1360,15 @@ clutter_actor_set_name (ClutterActor *self,
{ {
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_object_ref (self);
g_free (self->priv->name); g_free (self->priv->name);
if (name || name[0] != '\0') if (name && name[0] != '\0')
{ self->priv->name = g_strdup(name);
self->priv->name = g_strdup(name);
} g_object_notify (G_OBJECT (self), "name");
g_object_unref (self);
} }
/** /**
...@@ -1324,7 +1414,7 @@ clutter_actor_get_id (ClutterActor *self) ...@@ -1324,7 +1414,7 @@ clutter_actor_get_id (ClutterActor *self)
*/ */
void void
clutter_actor_set_depth (ClutterActor *self, clutter_actor_set_depth (ClutterActor *self,
gint depth) gint depth)
{ {
/* Sets Z value. - FIXME: should invert ?*/ /* Sets Z value. - FIXME: should invert ?*/
self->priv->z = depth; self->priv->z = depth;
...@@ -1368,10 +1458,10 @@ clutter_actor_get_depth (ClutterActor *self) ...@@ -1368,10 +1458,10 @@ clutter_actor_get_depth (ClutterActor *self)
* Rotates actor around the Z axis. * Rotates actor around the Z axis.
*/ */
void void
clutter_actor_rotate_z (ClutterActor *self, clutter_actor_rotate_z (ClutterActor *self,
gfloat angle, gfloat angle,
gint x, gint x,
gint y) gint y)
{ {
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
...@@ -1393,10 +1483,10 @@ clutter_actor_rotate_z (ClutterActor *self, ...@@ -1393,10 +1483,10 @@ clutter_actor_rotate_z (ClutterActor *self,
* Rotates actor around the X axis. * Rotates actor around the X axis.
*/ */
void void
clutter_actor_rotate_x (ClutterActor *self, clutter_actor_rotate_x (ClutterActor *self,
gfloat angle, gfloat angle,
gint y, gint y,
gint z) gint z)
{ {
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
...@@ -1418,10 +1508,10 @@ clutter_actor_rotate_x (ClutterActor *self, ...@@ -1418,10 +1508,10 @@ clutter_actor_rotate_x (ClutterActor *self,
* Rotates actor around the X axis. * Rotates actor around the X axis.
*/ */
void void
clutter_actor_rotate_y (ClutterActor *self, clutter_actor_rotate_y (ClutterActor *self,
gfloat angle, gfloat angle,
gint x, gint x,
gint z) gint z)
{ {
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
...@@ -1537,10 +1627,16 @@ clutter_actor_set_parent (ClutterActor *self, ...@@ -1537,10 +1627,16 @@ clutter_actor_set_parent (ClutterActor *self,
g_object_ref_sink (self); g_object_ref_sink (self);
self->priv->parent_actor = parent; self->priv->parent_actor = parent;
g_signal_emit (self, actor_signals[PARENT_SET], 0, NULL);
if (CLUTTER_ACTOR_IS_REALIZED (self->priv->parent_actor))
clutter_actor_realize (self);
if (CLUTTER_ACTOR_IS_VISIBLE (self->priv->parent_actor) && if (CLUTTER_ACTOR_IS_VISIBLE (self->priv->parent_actor) &&
CLUTTER_ACTOR_IS_VISIBLE (self)) CLUTTER_ACTOR_IS_VISIBLE (self))
clutter_actor_queue_redraw (self); {
clutter_actor_queue_redraw (self);
}
} }
/** /**
...@@ -1571,6 +1667,8 @@ clutter_actor_get_parent (ClutterActor *self) ...@@ -1571,6 +1667,8 @@ clutter_actor_get_parent (ClutterActor *self)
void void
clutter_actor_unparent (ClutterActor *self) clutter_actor_unparent (ClutterActor *self)
{ {
ClutterActor *old_parent;
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
if (self->priv->parent_actor == NULL) if (self->priv->parent_actor == NULL)
...@@ -1585,7 +1683,10 @@ clutter_actor_unparent (ClutterActor *self) ...@@ -1585,7 +1683,10 @@ clutter_actor_unparent (ClutterActor *self)
clutter_actor_unrealize (self); clutter_actor_unrealize (self);
} }
old_parent = self->priv->parent_actor;
self->priv->parent_actor = NULL; self->priv->parent_actor = NULL;
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
g_object_unref (self); g_object_unref (self);
} }
...@@ -1598,7 +1699,7 @@ clutter_actor_unparent (ClutterActor *self) ...@@ -1598,7 +1699,7 @@ clutter_actor_unparent (ClutterActor *self)
* logically equivalent to calling clutter_actory_unparent() * logically equivalent to calling clutter_actory_unparent()
* and clutter_actor_set_parent(). * and clutter_actor_set_parent().
* *
* Since: 0.1.1 * Since: 0.2
*/ */
void void
clutter_actor_reparent (ClutterActor *self,