static GQuark quark_object_animation = 0;
-G_DEFINE_TYPE (ClutterAnimation, clutter_animation, G_TYPE_INITIALLY_UNOWNED);
+G_DEFINE_TYPE (ClutterAnimation, clutter_animation, G_TYPE_OBJECT);
static void on_animation_weak_notify (gpointer data,
GObject *animation_pointer);
* lifetime of a #ClutterAnimation instance, so you should consider using
* those functions instead of manually creating an animation.
*
- * Return value: the newly created #ClutterAnimation. Use g_object_ref_sink()
- * to take ownership of the Animation instance, and g_object_unref() to
- * release the associated resources
+ * Return value: the newly created #ClutterAnimation. Use g_object_unref()
+ * to release the associated resources
*
* Since: 1.0
*/
priv = animation->priv;
- g_object_ref (object);
-
if (priv->object)
{
g_object_weak_unref (G_OBJECT (animation),
g_object_unref (priv->object);
}
- priv->object = object;
+ priv->object = g_object_ref (object);
g_object_weak_ref (G_OBJECT (animation),
on_animation_weak_notify,
priv->object);
- g_object_set_qdata (G_OBJECT (priv->object),
- quark_object_animation,
- animation);
+ g_object_set_qdata_full (G_OBJECT (priv->object),
+ quark_object_animation,
+ animation,
+ NULL);
g_object_notify (G_OBJECT (animation), "object");
}
struct _ClutterAnimation
{
/*< private >*/
- GInitiallyUnowned parent_instance;
+ GObject parent_instance;
ClutterAnimationPrivate *priv;
};
struct _ClutterAnimationClass
{
/*< private >*/
- GInitiallyUnownedClass parent_class;
+ GObjectClass parent_class;
/*< public >*/
void (* started) (ClutterAnimation *animation);