[clutter/wip/clutter-1.99: 3/4] 2.0: First pass at deprecated API removal
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/clutter-1.99: 3/4] 2.0: First pass at deprecated API removal
- Date: Thu, 23 Aug 2012 17:14:34 +0000 (UTC)
commit 55d53085135bff56f41d97161e1142c935e5b01e
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Aug 23 17:37:40 2012 +0100
2.0: First pass at deprecated API removal
This is the minimum required commit to get Clutter and the examples
building.
clutter/clutter-actor-private.h | 9 -
clutter/clutter-actor.c | 2411 ++------------------------------------
clutter/clutter-animatable.c | 74 --
clutter/clutter-interval.c | 15 -
clutter/clutter-layout-manager.c | 281 +-----
clutter/clutter-layout-manager.h | 20 -
clutter/clutter-script-parser.c | 259 +----
clutter/clutter-script-private.h | 5 -
clutter/clutter-script.c | 296 -----
clutter/clutter-stage.c | 4 +-
clutter/clutter-stage.h | 4 +-
11 files changed, 125 insertions(+), 3253 deletions(-)
---
diff --git a/clutter/clutter-actor-private.h b/clutter/clutter-actor-private.h
index 6c86967..d6e7db7 100644
--- a/clutter/clutter-actor-private.h
+++ b/clutter/clutter-actor-private.h
@@ -183,22 +183,13 @@ struct _ClutterTransformInfo
{
/* rotation (angle and center) */
gdouble rx_angle;
- AnchorCoord rx_center;
-
gdouble ry_angle;
- AnchorCoord ry_center;
-
gdouble rz_angle;
- AnchorCoord rz_center;
/* scaling */
gdouble scale_x;
gdouble scale_y;
gdouble scale_z;
- AnchorCoord scale_center;
-
- /* anchor point */
- AnchorCoord anchor;
/* translation */
ClutterVertex translation;
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 7dc35d4..0df8a88 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -38,12 +38,11 @@
* the following:</para>
* <orderedlist>
* <listitem><para>translation by the origin of the #ClutterActor:allocation;</para></listitem>
- * <listitem><para>translation by the actor's #ClutterActor:depth;</para></listitem>
- * <listitem><para>scaling by the #ClutterActor:scale-x and #ClutterActor:scale-y factors;</para></listitem>
+ * <listitem><para>translation by the actor's #ClutterActor:z-position;</para></listitem>
+ * <listitem><para>scaling by the #ClutterActor:scale-x, #ClutterActor:scale-y, and #ClutterActor:scale-z factors;</para></listitem>
* <listitem><para>rotation around the #ClutterActor:rotation-angle-x and #ClutterActor:rotation-center-x;</para></listitem>
* <listitem><para>rotation around the #ClutterActor:rotation-angle-y and #ClutterActor:rotation-center-y;</para></listitem>
* <listitem><para>rotation around the #ClutterActor:rotation-angle-z and #ClutterActor:rotation-center-z;</para></listitem>
- * <listitem><para>negative translation by the #ClutterActor:anchor-x and #ClutterActor:anchor-y point.</para></listitem>
* </orderedlist>
* </refsect2>
*
@@ -247,13 +246,13 @@
* /* animate the actor's opacity and depth */
* clutter_actor_save_easing_state (actor);
* clutter_actor_set_opacity (actor, 0);
- * clutter_actor_set_depth (actor, -100);
+ * clutter_actor_set_z_position (actor, -100);
* clutter_actor_restore_easing_state (actor);
*
* /* animate another actor's opacity */
* clutter_actor_save_easing_state (another_actor);
* clutter_actor_set_opacity (another_actor, 255);
- * clutter_actor_set_depth (another_actor, 100);
+ * clutter_actor_set_z_position (another_actor, 100);
* clutter_actor_restore_easing_state (another_actor);
* </programlisting></informalexample>
* <para>Implicit animations use a default duration of 250 milliseconds,
@@ -624,10 +623,6 @@
#include "clutter-transition.h"
#include "clutter-units.h"
-#include "deprecated/clutter-actor.h"
-#include "deprecated/clutter-behaviour.h"
-#include "deprecated/clutter-container.h"
-
#define CLUTTER_ACTOR_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_ACTOR, ClutterActorPrivate))
@@ -785,7 +780,6 @@ struct _ClutterActorPrivate
guint needs_height_request : 1;
/* cached allocation is invalid (request has changed, probably) */
guint needs_allocation : 1;
- guint show_on_set_parent : 1;
guint has_clip : 1;
guint clip_to_allocation : 1;
guint enable_model_view_transform : 1;
@@ -854,10 +848,8 @@ enum
/* Allocation properties are read-only */
PROP_ALLOCATION,
- PROP_DEPTH, /* XXX:2.0 remove */
PROP_Z_POSITION,
- PROP_CLIP, /* XXX:2.0 remove */
PROP_CLIP_RECT,
PROP_HAS_CLIP,
PROP_CLIP_TO_ALLOCATION,
@@ -877,24 +869,10 @@ enum
PROP_SCALE_X,
PROP_SCALE_Y,
PROP_SCALE_Z,
- PROP_SCALE_CENTER_X, /* XXX:2.0 remove */
- PROP_SCALE_CENTER_Y, /* XXX:2.0 remove */
- PROP_SCALE_GRAVITY, /* XXX:2.0 remove */
-
- PROP_ROTATION_ANGLE_X, /* XXX:2.0 rename to rotation-x */
- PROP_ROTATION_ANGLE_Y, /* XXX:2.0 rename to rotation-y */
- PROP_ROTATION_ANGLE_Z, /* XXX:2.0 rename to rotation-z */
- PROP_ROTATION_CENTER_X, /* XXX:2.0 remove */
- PROP_ROTATION_CENTER_Y, /* XXX:2.0 remove */
- PROP_ROTATION_CENTER_Z, /* XXX:2.0 remove */
- /* This property only makes sense for the z rotation because the
- others would depend on the actor having a size along the
- z-axis */
- PROP_ROTATION_CENTER_Z_GRAVITY, /* XXX:2.0 remove */
-
- PROP_ANCHOR_X, /* XXX:2.0 remove */
- PROP_ANCHOR_Y, /* XXX:2.0 remove */
- PROP_ANCHOR_GRAVITY, /*XXX:2.0 remove */
+
+ PROP_ROTATION_ANGLE_X,
+ PROP_ROTATION_ANGLE_Y,
+ PROP_ROTATION_ANGLE_Z,
PROP_TRANSLATION_X,
PROP_TRANSLATION_Y,
@@ -905,8 +883,6 @@ enum
PROP_CHILD_TRANSFORM,
PROP_CHILD_TRANSFORM_SET,
- PROP_SHOW_ON_SET_PARENT, /*XXX:2.0 remove */
-
PROP_TEXT_DIRECTION,
PROP_HAS_POINTER,
@@ -1015,23 +991,6 @@ static void clutter_actor_update_map_state (ClutterActor *self,
MapStateChange change);
static void clutter_actor_unrealize_not_hiding (ClutterActor *self);
-/* Helper routines for managing anchor coords */
-static void clutter_anchor_coord_get_units (ClutterActor *self,
- const AnchorCoord *coord,
- gfloat *x,
- gfloat *y,
- gfloat *z);
-static void clutter_anchor_coord_set_units (AnchorCoord *coord,
- gfloat x,
- gfloat y,
- gfloat z);
-
-static ClutterGravity clutter_anchor_coord_get_gravity (const AnchorCoord *coord);
-static void clutter_anchor_coord_set_gravity (AnchorCoord *coord,
- ClutterGravity gravity);
-
-static gboolean clutter_anchor_coord_is_zero (const AnchorCoord *coord);
-
static void _clutter_actor_queue_only_relayout (ClutterActor *self);
static void _clutter_actor_get_relative_transformation_matrix (ClutterActor *self,
@@ -1054,16 +1013,6 @@ static inline void clutter_actor_set_margin_internal (ClutterActor *self,
gfloat margin,
GParamSpec *pspec);
-/* Helper macro which translates by the anchor coord, applies the
- given transformation and then translates back */
-#define TRANSFORM_ABOUT_ANCHOR_COORD(a,m,c,_transform) G_STMT_START { \
- gfloat _tx, _ty, _tz; \
- clutter_anchor_coord_get_units ((a), (c), &_tx, &_ty, &_tz); \
- cogl_matrix_translate ((m), _tx, _ty, _tz); \
- { _transform; } \
- cogl_matrix_translate ((m), -_tx, -_ty, -_tz); } G_STMT_END
-
-static GQuark quark_shader_data = 0;
static GQuark quark_actor_layout_info = 0;
static GQuark quark_actor_transform_info = 0;
static GQuark quark_actor_animation_info = 0;
@@ -1638,25 +1587,6 @@ clutter_actor_real_show (ClutterActor *self)
}
}
-static inline void
-set_show_on_set_parent (ClutterActor *self,
- gboolean set_show)
-{
- ClutterActorPrivate *priv = self->priv;
-
- set_show = !!set_show;
-
- if (priv->show_on_set_parent == set_show)
- return;
-
- if (priv->parent == NULL)
- {
- priv->show_on_set_parent = set_show;
- g_object_notify_by_pspec (G_OBJECT (self),
- obj_props[PROP_SHOW_ON_SET_PARENT]);
- }
-}
-
/**
* clutter_actor_show:
* @self: A #ClutterActor
@@ -1679,13 +1609,7 @@ clutter_actor_show (ClutterActor *self)
/* simple optimization */
if (CLUTTER_ACTOR_IS_VISIBLE (self))
- {
- /* we still need to set the :show-on-set-parent property, in
- * case show() is called on an unparented actor
- */
- set_show_on_set_parent (self, TRUE);
- return;
- }
+ return;
#ifdef CLUTTER_ENABLE_DEBUG
clutter_actor_verify_map_state (self);
@@ -1695,8 +1619,6 @@ clutter_actor_show (ClutterActor *self)
g_object_freeze_notify (G_OBJECT (self));
- set_show_on_set_parent (self, TRUE);
-
/* if we're showing a child that needs to expand, or may
* expand, then we need to recompute the expand flags for
* its parent as well
@@ -1717,28 +1639,6 @@ clutter_actor_show (ClutterActor *self)
g_object_thaw_notify (G_OBJECT (self));
}
-/**
- * clutter_actor_show_all:
- * @self: a #ClutterActor
- *
- * Calls clutter_actor_show() on all children of an actor (if any).
- *
- * Since: 0.2
- *
- * Deprecated: 1.10: Actors are visible by default
- */
-void
-clutter_actor_show_all (ClutterActor *self)
-{
- ClutterActorClass *klass;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- klass = CLUTTER_ACTOR_GET_CLASS (self);
- if (klass->show_all)
- klass->show_all (self);
-}
-
static void
clutter_actor_real_hide (ClutterActor *self)
{
@@ -1785,13 +1685,7 @@ clutter_actor_hide (ClutterActor *self)
/* simple optimization */
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
- {
- /* we still need to set the :show-on-set-parent property, in
- * case hide() is called on an unparented actor
- */
- set_show_on_set_parent (self, FALSE);
- return;
- }
+ return;
#ifdef CLUTTER_ENABLE_DEBUG
clutter_actor_verify_map_state (self);
@@ -1801,8 +1695,6 @@ clutter_actor_hide (ClutterActor *self)
g_object_freeze_notify (G_OBJECT (self));
- set_show_on_set_parent (self, FALSE);
-
/* if we're hiding a child that needs to expand, or may
* expand, then we need to recompute the expand flags for
* its parent as well
@@ -1824,29 +1716,6 @@ clutter_actor_hide (ClutterActor *self)
}
/**
- * clutter_actor_hide_all:
- * @self: a #ClutterActor
- *
- * Calls clutter_actor_hide() on all child actors (if any).
- *
- * Since: 0.2
- *
- * Deprecated: 1.10: Using clutter_actor_hide() on the actor will
- * prevent its children from being painted as well.
- */
-void
-clutter_actor_hide_all (ClutterActor *self)
-{
- ClutterActorClass *klass;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- klass = CLUTTER_ACTOR_GET_CLASS (self);
- if (klass->hide_all)
- klass->hide_all (self);
-}
-
-/**
* clutter_actor_realize:
* @self: A #ClutterActor
*
@@ -3020,55 +2889,24 @@ clutter_actor_real_apply_transform (ClutterActor *self,
* not scaled and so the entire object will move on the screen
* as a result of rotating it).
*/
- if (info->scale_x != 1.0 || info->scale_y != 1.0)
+ if (info->scale_x != 1.0 ||
+ info->scale_y != 1.0 ||
+ info->scale_z != 1.0)
{
- /* XXX:2.0 remove anchor coord */
- TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
- &info->scale_center,
- cogl_matrix_scale (transform,
- info->scale_x,
- info->scale_y,
- info->scale_z));
+ cogl_matrix_scale (transform,
+ info->scale_x,
+ info->scale_y,
+ info->scale_z);
}
if (info->rz_angle)
- {
- /* XXX:2.0 remove anchor coord */
- TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
- &info->rz_center,
- cogl_matrix_rotate (transform,
- info->rz_angle,
- 0, 0, 1.0));
- }
+ cogl_matrix_rotate (transform, info->rz_angle, 0.0, 0.0, 1.0);
if (info->ry_angle)
- {
- /* XXX:2.0 remove anchor coord */
- TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
- &info->ry_center,
- cogl_matrix_rotate (transform,
- info->ry_angle,
- 0, 1.0, 0));
- }
+ cogl_matrix_rotate (transform, info->ry_angle, 0.0, 1.0, 0.0);
if (info->rx_angle)
- {
- /* XXX:2.0 remove anchor coord */
- TRANSFORM_ABOUT_ANCHOR_COORD (self, transform,
- &info->rx_center,
- cogl_matrix_rotate (transform,
- info->rx_angle,
- 1.0, 0, 0));
- }
-
- /* XXX:2.0 remove */
- if (!clutter_anchor_coord_is_zero (&info->anchor))
- {
- gfloat x, y, z;
-
- clutter_anchor_coord_get_units (self, &info->anchor, &x, &y, &z);
- cogl_matrix_translate (transform, -x, -y, -z);
- }
+ cogl_matrix_rotate (transform, info->rx_angle, 1.0, 0.0, 0.0);
/* roll back the pivot translation */
if (pivot_x != 0.f || pivot_y != 0.f || info->pivot_z != 0.f)
@@ -3381,12 +3219,6 @@ _clutter_actor_update_last_paint_volume (ClutterActor *self)
priv->last_paint_volume_valid = TRUE;
}
-static inline gboolean
-actor_has_shader_data (ClutterActor *self)
-{
- return g_object_get_qdata (G_OBJECT (self), quark_shader_data) != NULL;
-}
-
guint32
_clutter_actor_get_pick_id (ClutterActor *self)
{
@@ -3599,7 +3431,6 @@ clutter_actor_paint (ClutterActor *self)
ClutterActorPrivate *priv;
ClutterPickMode pick_mode;
gboolean clip_set = FALSE;
- gboolean shader_applied = FALSE;
CLUTTER_STATIC_COUNTER (actor_paint_counter,
"Actor real-paint counter",
@@ -3777,25 +3608,12 @@ clutter_actor_paint (ClutterActor *self)
}
if (priv->effects == NULL)
- {
- if (pick_mode == CLUTTER_PICK_NONE &&
- actor_has_shader_data (self))
- {
- _clutter_actor_shader_pre_paint (self, FALSE);
- shader_applied = TRUE;
- }
-
- priv->next_effect_to_paint = NULL;
- }
+ priv->next_effect_to_paint = NULL;
else
- priv->next_effect_to_paint =
- _clutter_meta_group_peek_metas (priv->effects);
+ priv->next_effect_to_paint = _clutter_meta_group_peek_metas (priv->effects);
clutter_actor_continue_paint (self);
- if (shader_applied)
- _clutter_actor_shader_post_paint (self);
-
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&
pick_mode == CLUTTER_PICK_NONE))
_clutter_actor_draw_paint_volume (self);
@@ -4011,13 +3829,6 @@ typedef enum {
REMOVE_CHILD_EMIT_ACTOR_REMOVED |
REMOVE_CHILD_CHECK_STATE |
REMOVE_CHILD_FLUSH_QUEUE |
- REMOVE_CHILD_NOTIFY_FIRST_LAST,
-
- /* flags for legacy/deprecated API */
- REMOVE_CHILD_LEGACY_FLAGS = REMOVE_CHILD_STOP_TRANSITIONS |
- REMOVE_CHILD_CHECK_STATE |
- REMOVE_CHILD_FLUSH_QUEUE |
- REMOVE_CHILD_EMIT_PARENT_SET |
REMOVE_CHILD_NOTIFY_FIRST_LAST
} ClutterActorRemoveChildFlags;
@@ -4147,13 +3958,11 @@ clutter_actor_remove_child_internal (ClutterActor *self,
}
static const ClutterTransformInfo default_transform_info = {
- 0.0, { 0, }, /* rotation-x */
- 0.0, { 0, }, /* rotation-y */
- 0.0, { 0, }, /* rotation-z */
-
- 1.0, 1.0, 1.0, { 0, }, /* scale */
+ 0.0, /* rotation-x */
+ 0.0, /* rotation-y */
+ 0.0, /* rotation-z */
- { 0, }, /* anchor XXX:2.0 - remove*/
+ 1.0, 1.0, 1.0, /* scale */
CLUTTER_VERTEX_INIT_ZERO, /* translation */
@@ -4532,63 +4341,6 @@ clutter_actor_get_rotation_angle (ClutterActor *self,
return retval;
}
-/*< private >
- * clutter_actor_set_rotation_center_internal:
- * @self: a #ClutterActor
- * @axis: the axis of the center to change
- * @center: the coordinates of the rotation center
- *
- * Sets the rotation center on the given axis without affecting the
- * rotation angle.
- */
-static inline void
-clutter_actor_set_rotation_center_internal (ClutterActor *self,
- ClutterRotateAxis axis,
- const ClutterVertex *center)
-{
- ClutterVertex v = CLUTTER_VERTEX_INIT_ZERO;
- GObject *obj = G_OBJECT (self);
- ClutterTransformInfo *info;
-
- info = _clutter_actor_get_transform_info (self);
-
- if (center != NULL)
- v = *center;
-
- g_object_freeze_notify (obj);
-
- switch (axis)
- {
- case CLUTTER_X_AXIS:
- clutter_anchor_coord_set_units (&info->rx_center, v.x, v.y, v.z);
- g_object_notify_by_pspec (obj, obj_props[PROP_ROTATION_CENTER_X]);
- break;
-
- case CLUTTER_Y_AXIS:
- clutter_anchor_coord_set_units (&info->ry_center, v.x, v.y, v.z);
- g_object_notify_by_pspec (obj, obj_props[PROP_ROTATION_CENTER_Y]);
- break;
-
- case CLUTTER_Z_AXIS:
- /* if the previously set rotation center was fractional, then
- * setting explicit coordinates will have to notify the
- * :rotation-center-z-gravity property as well
- */
- if (info->rz_center.is_fractional)
- g_object_notify_by_pspec (obj, obj_props[PROP_ROTATION_CENTER_Z_GRAVITY]);
-
- clutter_anchor_coord_set_units (&info->rz_center, v.x, v.y, v.z);
- g_object_notify_by_pspec (obj, obj_props[PROP_ROTATION_CENTER_Z]);
- break;
- }
-
- self->priv->transform_valid = FALSE;
-
- g_object_thaw_notify (obj);
-
- clutter_actor_queue_redraw (self);
-}
-
static void
clutter_actor_set_scale_factor_internal (ClutterActor *self,
double factor,
@@ -4648,129 +4400,6 @@ clutter_actor_set_scale_factor (ClutterActor *self,
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
}
-static inline void
-clutter_actor_set_scale_center (ClutterActor *self,
- ClutterRotateAxis axis,
- gfloat coord)
-{
- GObject *obj = G_OBJECT (self);
- ClutterTransformInfo *info;
- gfloat center_x, center_y;
-
- info = _clutter_actor_get_transform_info (self);
-
- g_object_freeze_notify (obj);
-
- /* get the current scale center coordinates */
- clutter_anchor_coord_get_units (self, &info->scale_center,
- ¢er_x,
- ¢er_y,
- NULL);
-
- /* we need to notify this too, because setting explicit coordinates will
- * change the gravity as a side effect
- */
- if (info->scale_center.is_fractional)
- g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_GRAVITY]);
-
- switch (axis)
- {
- case CLUTTER_X_AXIS:
- clutter_anchor_coord_set_units (&info->scale_center, coord, center_y, 0);
- g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_CENTER_X]);
- break;
-
- case CLUTTER_Y_AXIS:
- clutter_anchor_coord_set_units (&info->scale_center, center_x, coord, 0);
- g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_CENTER_Y]);
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- self->priv->transform_valid = FALSE;
-
- clutter_actor_queue_redraw (self);
-
- g_object_thaw_notify (obj);
-}
-
-static inline void
-clutter_actor_set_scale_gravity (ClutterActor *self,
- ClutterGravity gravity)
-{
- ClutterTransformInfo *info;
- GObject *obj;
-
- info = _clutter_actor_get_transform_info (self);
- obj = G_OBJECT (self);
-
- if (gravity == CLUTTER_GRAVITY_NONE)
- clutter_anchor_coord_set_units (&info->scale_center, 0, 0, 0);
- else
- clutter_anchor_coord_set_gravity (&info->scale_center, gravity);
-
- self->priv->transform_valid = FALSE;
-
- g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_CENTER_X]);
- g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_CENTER_Y]);
- g_object_notify_by_pspec (obj, obj_props[PROP_SCALE_GRAVITY]);
-
- clutter_actor_queue_redraw (self);
-}
-
-/* XXX:2.0 - remove */
-static inline void
-clutter_actor_set_anchor_coord (ClutterActor *self,
- ClutterRotateAxis axis,
- gfloat coord)
-{
- GObject *obj = G_OBJECT (self);
- ClutterTransformInfo *info;
- gfloat anchor_x, anchor_y;
-
- info = _clutter_actor_get_transform_info (self);
-
- g_object_freeze_notify (obj);
-
- clutter_anchor_coord_get_units (self, &info->anchor,
- &anchor_x,
- &anchor_y,
- NULL);
-
- if (info->anchor.is_fractional)
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_GRAVITY]);
-
- switch (axis)
- {
- case CLUTTER_X_AXIS:
- clutter_anchor_coord_set_units (&info->anchor,
- coord,
- anchor_y,
- 0.0);
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_X]);
- break;
-
- case CLUTTER_Y_AXIS:
- clutter_anchor_coord_set_units (&info->anchor,
- anchor_x,
- coord,
- 0.0);
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_Y]);
- break;
-
- default:
- g_assert_not_reached ();
- }
-
- self->priv->transform_valid = FALSE;
-
- clutter_actor_queue_redraw (self);
-
- g_object_thaw_notify (obj);
-}
-
static void
clutter_actor_set_clip_rect (ClutterActor *self,
const ClutterRect *clip)
@@ -4788,7 +4417,6 @@ clutter_actor_set_clip_rect (ClutterActor *self,
clutter_actor_queue_redraw (self);
- g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]); /* XXX:2.0 - remove */
g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);
g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);
}
@@ -4800,7 +4428,6 @@ clutter_actor_set_property (GObject *object,
GParamSpec *pspec)
{
ClutterActor *actor = CLUTTER_ACTOR (object);
- ClutterActorPrivate *priv = actor->priv;
switch (prop_id)
{
@@ -4890,10 +4517,6 @@ clutter_actor_set_property (GObject *object,
clutter_actor_set_request_mode (actor, g_value_get_enum (value));
break;
- case PROP_DEPTH: /* XXX:2.0 - remove */
- clutter_actor_set_depth (actor, g_value_get_float (value));
- break;
-
case PROP_Z_POSITION:
clutter_actor_set_z_position (actor, g_value_get_float (value));
break;
@@ -4962,30 +4585,6 @@ clutter_actor_set_property (GObject *object,
g_value_get_double (value));
break;
- case PROP_SCALE_CENTER_X: /* XXX:2.0 - remove */
- clutter_actor_set_scale_center (actor, CLUTTER_X_AXIS,
- g_value_get_float (value));
- break;
-
- case PROP_SCALE_CENTER_Y: /* XXX:2.0 - remove */
- clutter_actor_set_scale_center (actor, CLUTTER_Y_AXIS,
- g_value_get_float (value));
- break;
-
- case PROP_SCALE_GRAVITY: /* XXX:2.0 - remove */
- clutter_actor_set_scale_gravity (actor, g_value_get_enum (value));
- break;
-
- case PROP_CLIP: /* XXX:2.0 - remove */
- {
- const ClutterGeometry *geom = g_value_get_boxed (value);
-
- clutter_actor_set_clip (actor,
- geom->x, geom->y,
- geom->width, geom->height);
- }
- break;
-
case PROP_CLIP_RECT:
clutter_actor_set_clip_rect (actor, g_value_get_boxed (value));
break;
@@ -5016,49 +4615,6 @@ clutter_actor_set_property (GObject *object,
g_value_get_double (value));
break;
- case PROP_ROTATION_CENTER_X: /* XXX:2.0 - remove */
- clutter_actor_set_rotation_center_internal (actor,
- CLUTTER_X_AXIS,
- g_value_get_boxed (value));
- break;
-
- case PROP_ROTATION_CENTER_Y: /* XXX:2.0 - remove */
- clutter_actor_set_rotation_center_internal (actor,
- CLUTTER_Y_AXIS,
- g_value_get_boxed (value));
- break;
-
- case PROP_ROTATION_CENTER_Z: /* XXX:2.0 - remove */
- clutter_actor_set_rotation_center_internal (actor,
- CLUTTER_Z_AXIS,
- g_value_get_boxed (value));
- break;
-
- case PROP_ROTATION_CENTER_Z_GRAVITY: /* XXX:2.0 - remove */
- {
- const ClutterTransformInfo *info;
-
- info = _clutter_actor_get_transform_info_or_defaults (actor);
- clutter_actor_set_z_rotation_from_gravity (actor, info->rz_angle,
- g_value_get_enum (value));
- }
- break;
-
- case PROP_ANCHOR_X: /* XXX:2.0 - remove */
- clutter_actor_set_anchor_coord (actor, CLUTTER_X_AXIS,
- g_value_get_float (value));
- break;
-
- case PROP_ANCHOR_Y: /* XXX:2.0 - remove */
- clutter_actor_set_anchor_coord (actor, CLUTTER_Y_AXIS,
- g_value_get_float (value));
- break;
-
- case PROP_ANCHOR_GRAVITY: /* XXX:2.0 - remove */
- clutter_actor_set_anchor_point_from_gravity (actor,
- g_value_get_enum (value));
- break;
-
case PROP_TRANSFORM:
clutter_actor_set_transform (actor, g_value_get_boxed (value));
break;
@@ -5067,10 +4623,6 @@ clutter_actor_set_property (GObject *object,
clutter_actor_set_child_transform (actor, g_value_get_boxed (value));
break;
- case PROP_SHOW_ON_SET_PARENT: /* XXX:2.0 - remove */
- priv->show_on_set_parent = g_value_get_boolean (value);
- break;
-
case PROP_TEXT_DIRECTION:
clutter_actor_set_text_direction (actor, g_value_get_enum (value));
break;
@@ -5288,10 +4840,6 @@ clutter_actor_get_property (GObject *object,
g_value_set_boxed (value, &priv->allocation);
break;
- case PROP_DEPTH: /* XXX:2.0 - remove */
- g_value_set_float (value, clutter_actor_get_depth (actor));
- break;
-
case PROP_Z_POSITION:
g_value_set_float (value, clutter_actor_get_z_position (actor));
break;
@@ -5324,19 +4872,6 @@ clutter_actor_get_property (GObject *object,
g_value_set_boolean (value, priv->has_clip);
break;
- case PROP_CLIP: /* XXX:2.0 - remove */
- {
- ClutterGeometry clip;
-
- clip.x = CLUTTER_NEARBYINT (priv->clip.origin.x);
- clip.y = CLUTTER_NEARBYINT (priv->clip.origin.y);
- clip.width = CLUTTER_NEARBYINT (priv->clip.size.width);
- clip.height = CLUTTER_NEARBYINT (priv->clip.size.height);
-
- g_value_set_boxed (value, &clip);
- }
- break;
-
case PROP_CLIP_RECT:
g_value_set_boxed (value, &priv->clip);
break;
@@ -5417,49 +4952,21 @@ clutter_actor_get_property (GObject *object,
}
break;
- case PROP_SCALE_CENTER_X: /* XXX:2.0 - remove */
+ case PROP_ROTATION_ANGLE_X:
{
- gfloat center;
-
- clutter_actor_get_scale_center (actor, ¢er, NULL);
+ const ClutterTransformInfo *info;
- g_value_set_float (value, center);
+ info = _clutter_actor_get_transform_info_or_defaults (actor);
+ g_value_set_double (value, info->rx_angle);
}
break;
- case PROP_SCALE_CENTER_Y: /* XXX:2.0 - remove */
+ case PROP_ROTATION_ANGLE_Y:
{
- gfloat center;
-
- clutter_actor_get_scale_center (actor, NULL, ¢er);
+ const ClutterTransformInfo *info;
- g_value_set_float (value, center);
- }
- break;
-
- case PROP_SCALE_GRAVITY: /* XXX:2.0 - remove */
- g_value_set_enum (value, clutter_actor_get_scale_gravity (actor));
- break;
-
- case PROP_REACTIVE:
- g_value_set_boolean (value, clutter_actor_get_reactive (actor));
- break;
-
- case PROP_ROTATION_ANGLE_X:
- {
- const ClutterTransformInfo *info;
-
- info = _clutter_actor_get_transform_info_or_defaults (actor);
- g_value_set_double (value, info->rx_angle);
- }
- break;
-
- case PROP_ROTATION_ANGLE_Y:
- {
- const ClutterTransformInfo *info;
-
- info = _clutter_actor_get_transform_info_or_defaults (actor);
- g_value_set_double (value, info->ry_angle);
+ info = _clutter_actor_get_transform_info_or_defaults (actor);
+ g_value_set_double (value, info->ry_angle);
}
break;
@@ -5472,81 +4979,6 @@ clutter_actor_get_property (GObject *object,
}
break;
- case PROP_ROTATION_CENTER_X: /* XXX:2.0 - remove */
- {
- ClutterVertex center;
-
- clutter_actor_get_rotation (actor, CLUTTER_X_AXIS,
- ¢er.x,
- ¢er.y,
- ¢er.z);
-
- g_value_set_boxed (value, ¢er);
- }
- break;
-
- case PROP_ROTATION_CENTER_Y: /* XXX:2.0 - remove */
- {
- ClutterVertex center;
-
- clutter_actor_get_rotation (actor, CLUTTER_Y_AXIS,
- ¢er.x,
- ¢er.y,
- ¢er.z);
-
- g_value_set_boxed (value, ¢er);
- }
- break;
-
- case PROP_ROTATION_CENTER_Z: /* XXX:2.0 - remove */
- {
- ClutterVertex center;
-
- clutter_actor_get_rotation (actor, CLUTTER_Z_AXIS,
- ¢er.x,
- ¢er.y,
- ¢er.z);
-
- g_value_set_boxed (value, ¢er);
- }
- break;
-
- case PROP_ROTATION_CENTER_Z_GRAVITY: /* XXX:2.0 - remove */
- g_value_set_enum (value, clutter_actor_get_z_rotation_gravity (actor));
- break;
-
- case PROP_ANCHOR_X: /* XXX:2.0 - remove */
- {
- const ClutterTransformInfo *info;
- gfloat anchor_x;
-
- info = _clutter_actor_get_transform_info_or_defaults (actor);
- clutter_anchor_coord_get_units (actor, &info->anchor,
- &anchor_x,
- NULL,
- NULL);
- g_value_set_float (value, anchor_x);
- }
- break;
-
- case PROP_ANCHOR_Y: /* XXX:2.0 - remove */
- {
- const ClutterTransformInfo *info;
- gfloat anchor_y;
-
- info = _clutter_actor_get_transform_info_or_defaults (actor);
- clutter_anchor_coord_get_units (actor, &info->anchor,
- NULL,
- &anchor_y,
- NULL);
- g_value_set_float (value, anchor_y);
- }
- break;
-
- case PROP_ANCHOR_GRAVITY: /* XXX:2.0 - remove */
- g_value_set_enum (value, clutter_actor_get_anchor_point_gravity (actor));
- break;
-
case PROP_TRANSFORM:
{
ClutterMatrix m;
@@ -5583,10 +5015,6 @@ clutter_actor_get_property (GObject *object,
}
break;
- case PROP_SHOW_ON_SET_PARENT: /* XXX:2.0 - remove */
- g_value_set_boolean (value, priv->show_on_set_parent);
- break;
-
case PROP_TEXT_DIRECTION:
g_value_set_enum (value, priv->text_direction);
break;
@@ -5740,17 +5168,8 @@ clutter_actor_dispose (GObject *object)
{
ClutterActor *parent = priv->parent;
- /* go through the Container implementation unless this
- * is an internal child and has been marked as such.
- *
- * removing the actor from its parent will reset the
- * realized and mapped states.
- */
- if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
- clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self);
- else
- clutter_actor_remove_child_internal (parent, self,
- REMOVE_CHILD_LEGACY_FLAGS);
+ clutter_actor_remove_child_internal (parent, self,
+ REMOVE_CHILD_DEFAULT_FLAGS);
}
/* parent must be gone at this point */
@@ -6076,7 +5495,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- quark_shader_data = g_quark_from_static_string ("-clutter-actor-shader-data");
quark_actor_layout_info = g_quark_from_static_string ("-clutter-actor-layout-info");
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
@@ -6493,34 +5911,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
CLUTTER_PARAM_READWRITE);
/**
- * ClutterActor:depth:
- *
- * The position of the actor on the Z axis.
- *
- * The #ClutterActor:depth property is relative to the parent's
- * modelview matrix.
- *
- * Setting this property will call #ClutterContainerIface.sort_depth_order()
- * which is usually a no-op, and it's most likely not what you want.
- *
- * The #ClutterActor:depth property is animatable.
- *
- * Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:z-position instead.
- */
- obj_props[PROP_DEPTH] =
- g_param_spec_float ("depth",
- P_("Depth"),
- P_("Position on the Z axis"),
- -G_MAXFLOAT, G_MAXFLOAT,
- 0.0,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED |
- CLUTTER_PARAM_ANIMATABLE);
-
- /**
* ClutterActor:z-position:
*
* The actor's position on the Z axis, relative to the parent's
@@ -6595,7 +5985,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_param_spec_boolean ("visible",
P_("Visible"),
P_("Whether the actor is visible or not"),
- FALSE,
+ TRUE,
CLUTTER_PARAM_READWRITE);
/**
@@ -6656,20 +6046,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
CLUTTER_PARAM_READABLE);
/**
- * ClutterActor:clip:
- *
- * The visible region of the actor, in actor-relative coordinates
- *
- * Deprecated: 1.12: Use #ClutterActor:clip-rect instead.
- */
- obj_props[PROP_CLIP] = /* XXX:2.0 - remove */
- g_param_spec_boxed ("clip",
- P_("Clip"),
- P_("The clip region for the actor"),
- CLUTTER_TYPE_GEOMETRY,
- CLUTTER_PARAM_READWRITE);
-
- /**
* ClutterActor:clip-rect:
*
* The visible region of the actor, in actor-relative coordinates,
@@ -6806,63 +6182,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
CLUTTER_PARAM_ANIMATABLE);
/**
- * ClutterActor:scale-center-x:
- *
- * The horizontal center point for scaling
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_SCALE_CENTER_X] = /* XXX:2.0 - remove */
- g_param_spec_float ("scale-center-x",
- P_("Scale Center X"),
- P_("Horizontal scale center"),
- -G_MAXFLOAT, G_MAXFLOAT,
- 0.0,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:scale-center-y:
- *
- * The vertical center point for scaling
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_SCALE_CENTER_Y] = /* XXX:2.0 - remove */
- g_param_spec_float ("scale-center-y",
- P_("Scale Center Y"),
- P_("Vertical scale center"),
- -G_MAXFLOAT, G_MAXFLOAT,
- 0.0,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:scale-gravity:
- *
- * The center point for scaling expressed as a #ClutterGravity
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_SCALE_GRAVITY] = /* XXX:2.0 - remove */
- g_param_spec_enum ("scale-gravity",
- P_("Scale Gravity"),
- P_("The center of scaling"),
- CLUTTER_TYPE_GRAVITY,
- CLUTTER_GRAVITY_NONE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
* ClutterActor:rotation-angle-x:
*
* The rotation angle on the X axis.
@@ -6920,165 +6239,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
CLUTTER_PARAM_ANIMATABLE);
/**
- * ClutterActor:rotation-center-x:
- *
- * The rotation center on the X axis.
- *
- * Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_ROTATION_CENTER_X] = /* XXX:2.0 - remove */
- g_param_spec_boxed ("rotation-center-x",
- P_("Rotation Center X"),
- P_("The rotation center on the X axis"),
- CLUTTER_TYPE_VERTEX,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:rotation-center-y:
- *
- * The rotation center on the Y axis.
- *
- * Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_ROTATION_CENTER_Y] = /* XXX:2.0 - remove */
- g_param_spec_boxed ("rotation-center-y",
- P_("Rotation Center Y"),
- P_("The rotation center on the Y axis"),
- CLUTTER_TYPE_VERTEX,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:rotation-center-z:
- *
- * The rotation center on the Z axis.
- *
- * Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_ROTATION_CENTER_Z] = /* XXX:2.0 - remove */
- g_param_spec_boxed ("rotation-center-z",
- P_("Rotation Center Z"),
- P_("The rotation center on the Z axis"),
- CLUTTER_TYPE_VERTEX,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:rotation-center-z-gravity:
- *
- * The rotation center on the Z axis expressed as a #ClutterGravity.
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_ROTATION_CENTER_Z_GRAVITY] = /* XXX:2.0 - remove */
- g_param_spec_enum ("rotation-center-z-gravity",
- P_("Rotation Center Z Gravity"),
- P_("Center point for rotation around the Z axis"),
- CLUTTER_TYPE_GRAVITY,
- CLUTTER_GRAVITY_NONE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:anchor-x:
- *
- * The X coordinate of an actor's anchor point, relative to
- * the actor coordinate space, in pixels.
- *
- * <warning>It is highly recommended not to use #ClutterActor:anchor-x,
- * #ClutterActor:anchor-y, and #ClutterActor:anchor-gravity in newly
- * written code; the anchor point adds an additional translation that
- * will affect the actor's relative position with regards to its
- * parent, as well as the position of its children. This change needs
- * to always be taken into account when positioning the actor. It is
- * recommended to use the #ClutterActor:pivot-point property instead,
- * as it will affect only the transformations.</warning>
- *
- * Since: 0.8
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_ANCHOR_X] = /* XXX:2.0 - remove */
- g_param_spec_float ("anchor-x",
- P_("Anchor X"),
- P_("X coordinate of the anchor point"),
- -G_MAXFLOAT, G_MAXFLOAT,
- 0,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:anchor-y:
- *
- * The Y coordinate of an actor's anchor point, relative to
- * the actor coordinate space, in pixels
- *
- * <warning>It is highly recommended not to use #ClutterActor:anchor-x,
- * #ClutterActor:anchor-y, and #ClutterActor:anchor-gravity in newly
- * written code; the anchor point adds an additional translation that
- * will affect the actor's relative position with regards to its
- * parent, as well as the position of its children. This change needs
- * to always be taken into account when positioning the actor. It is
- * recommended to use the #ClutterActor:pivot-point property instead,
- * as it will affect only the transformations.</warning>
- *
- * Since: 0.8
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_ANCHOR_Y] = /* XXX:2.0 - remove */
- g_param_spec_float ("anchor-y",
- P_("Anchor Y"),
- P_("Y coordinate of the anchor point"),
- -G_MAXFLOAT, G_MAXFLOAT,
- 0,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
- * ClutterActor:anchor-gravity:
- *
- * The anchor point expressed as a #ClutterGravity
- *
- * <warning>It is highly recommended not to use #ClutterActor:anchor-x,
- * #ClutterActor:anchor-y, and #ClutterActor:anchor-gravity in newly
- * written code; the anchor point adds an additional translation that
- * will affect the actor's relative position with regards to its
- * parent, as well as the position of its children. This change needs
- * to always be taken into account when positioning the actor. It is
- * recommended to use the #ClutterActor:pivot-point property instead,
- * as it will affect only the transformations.</warning>
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
- obj_props[PROP_ANCHOR_GRAVITY] = /* XXX:2.0 - remove */
- g_param_spec_enum ("anchor-gravity",
- P_("Anchor Gravity"),
- P_("The anchor point as a ClutterGravity"),
- CLUTTER_TYPE_GRAVITY,
- CLUTTER_GRAVITY_NONE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_DEPRECATED);
-
- /**
* ClutterActor:translation-x:
*
* An additional translation applied along the X axis, relative
@@ -7216,23 +6376,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
G_PARAM_STATIC_STRINGS);
/**
- * ClutterActor:show-on-set-parent:
- *
- * If %TRUE, the actor is automatically shown when parented.
- *
- * Calling clutter_actor_hide() on an actor which has not been
- * parented will set this property to %FALSE as a side effect.
- *
- * Since: 0.8
- */
- obj_props[PROP_SHOW_ON_SET_PARENT] = /* XXX:2.0 - remove */
- g_param_spec_boolean ("show-on-set-parent",
- P_("Show on set parent"),
- P_("Whether the actor is shown when parented"),
- TRUE,
- CLUTTER_PARAM_READWRITE);
-
- /**
* ClutterActor:clip-to-allocation:
*
* Whether the clip region should track the allocated area
@@ -8280,8 +7423,9 @@ clutter_actor_init (ClutterActor *self)
priv->id = _clutter_context_acquire_id (self);
priv->pick_id = -1;
- priv->opacity = 0xff;
- priv->show_on_set_parent = TRUE;
+ priv->opacity = 255;
+
+ CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_VISIBLE);
priv->needs_width_request = TRUE;
priv->needs_height_request = TRUE;
@@ -9144,9 +8288,6 @@ _clutter_actor_get_cached_size_request (gfloat for_size,
* An actor may not get its request - depending on the layout
* manager that's in effect.
*
- * A request should not incorporate the actor's scale or anchor point;
- * those transformations do not affect layout, only rendering.
- *
* Since: 0.8
*/
void
@@ -9281,9 +8422,6 @@ clutter_actor_get_preferred_width (ClutterActor *self,
* An actor may not get its request - depending on the layout
* manager that's in effect.
*
- * A request should not incorporate the actor's scale or anchor point;
- * those transformations do not affect layout, only rendering.
- *
* Since: 0.8
*/
void
@@ -9410,9 +8548,6 @@ clutter_actor_get_preferred_height (ClutterActor *self,
* only be assumed valid inside a paint() method; anywhere else, it
* may be out-of-date.
*
- * An allocation does not incorporate the actor's scale or anchor point;
- * those transformations do not affect layout, only rendering.
- *
* <note>Do not call any of the clutter_actor_get_allocation_*() family
* of functions inside the implementation of the get_preferred_width()
* or get_preferred_height() virtual functions.</note>
@@ -9950,13 +9085,8 @@ clutter_actor_set_fixed_position_set (ClutterActor *self,
* @dx: Distance to move Actor on X axis.
* @dy: Distance to move Actor on Y axis.
*
- * Moves an actor by the specified distance relative to its current
- * position in pixels.
- *
- * This function modifies the fixed position of an actor and thus removes
- * it from any layout management. Another way to move an actor is with an
- * anchor point, see clutter_actor_set_anchor_point(), or with an additional
- * translation, using clutter_actor_set_translation().
+ * Changes the fixed position of an actor by @dx on the horizontal
+ * axis, and by @dy on the vertical axis.
*
* Since: 0.2
*/
@@ -11053,84 +10183,6 @@ clutter_actor_set_scale_z (ClutterActor *self,
}
/**
- * clutter_actor_set_scale_full:
- * @self: A #ClutterActor
- * @scale_x: double factor to scale actor by horizontally.
- * @scale_y: double factor to scale actor by vertically.
- * @center_x: X coordinate of the center of the scaling
- * @center_y: Y coordinate of the center of the scaling
- *
- * Scales an actor with the given factors around the given center
- * point. The center point is specified in pixels relative to the
- * anchor point (usually the top left corner of the actor).
- *
- * The #ClutterActor:scale-x and #ClutterActor:scale-y properties
- * are animatable.
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use clutter_actor_set_pivot_point() to control
- * the scale center
- */
-void
-clutter_actor_set_scale_full (ClutterActor *self,
- gdouble scale_x,
- gdouble scale_y,
- gfloat center_x,
- gfloat center_y)
-{
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- g_object_freeze_notify (G_OBJECT (self));
-
- clutter_actor_set_scale_factor (self, CLUTTER_X_AXIS, scale_x);
- clutter_actor_set_scale_factor (self, CLUTTER_Y_AXIS, scale_y);
- clutter_actor_set_scale_center (self, CLUTTER_X_AXIS, center_x);
- clutter_actor_set_scale_center (self, CLUTTER_Y_AXIS, center_y);
-
- g_object_thaw_notify (G_OBJECT (self));
-}
-
-/**
- * clutter_actor_set_scale_with_gravity:
- * @self: A #ClutterActor
- * @scale_x: double factor to scale actor by horizontally.
- * @scale_y: double factor to scale actor by vertically.
- * @gravity: the location of the scale center expressed as a compass
- * direction.
- *
- * Scales an actor with the given factors around the given
- * center point. The center point is specified as one of the compass
- * directions in #ClutterGravity. For example, setting it to north
- * will cause the top of the actor to remain unchanged and the rest of
- * the actor to expand left, right and downwards.
- *
- * The #ClutterActor:scale-x and #ClutterActor:scale-y properties are
- * animatable.
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use clutter_actor_set_pivot_point() to set the
- * scale center using normalized coordinates instead.
- */
-void
-clutter_actor_set_scale_with_gravity (ClutterActor *self,
- gdouble scale_x,
- gdouble scale_y,
- ClutterGravity gravity)
-{
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- g_object_freeze_notify (G_OBJECT (self));
-
- clutter_actor_set_scale_factor (self, CLUTTER_X_AXIS, scale_x);
- clutter_actor_set_scale_factor (self, CLUTTER_Y_AXIS, scale_y);
- clutter_actor_set_scale_gravity (self, gravity);
-
- g_object_thaw_notify (G_OBJECT (self));
-}
-
-/**
* clutter_actor_get_scale:
* @self: A #ClutterActor
* @scale_x: (out) (allow-none): Location to store horizonal
@@ -11179,66 +10231,6 @@ clutter_actor_get_scale_z (ClutterActor *self)
return _clutter_actor_get_transform_info_or_defaults (self)->scale_z;
}
-/**
- * clutter_actor_get_scale_center:
- * @self: A #ClutterActor
- * @center_x: (out) (allow-none): Location to store the X position
- * of the scale center, or %NULL.
- * @center_y: (out) (allow-none): Location to store the Y position
- * of the scale center, or %NULL.
- *
- * Retrieves the scale center coordinate in pixels relative to the top
- * left corner of the actor. If the scale center was specified using a
- * #ClutterGravity this will calculate the pixel offset using the
- * current size of the actor.
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use clutter_actor_get_pivot_point() instead.
- */
-void
-clutter_actor_get_scale_center (ClutterActor *self,
- gfloat *center_x,
- gfloat *center_y)
-{
- const ClutterTransformInfo *info;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- info = _clutter_actor_get_transform_info_or_defaults (self);
-
- clutter_anchor_coord_get_units (self, &info->scale_center,
- center_x,
- center_y,
- NULL);
-}
-
-/**
- * clutter_actor_get_scale_gravity:
- * @self: A #ClutterActor
- *
- * Retrieves the scale center as a compass direction. If the scale
- * center was specified in pixels or units this will return
- * %CLUTTER_GRAVITY_NONE.
- *
- * Return value: the scale gravity
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use clutter_actor_get_pivot_point() instead.
- */
-ClutterGravity
-clutter_actor_get_scale_gravity (ClutterActor *self)
-{
- const ClutterTransformInfo *info;
-
- g_return_val_if_fail (CLUTTER_IS_ACTOR (self), CLUTTER_GRAVITY_NONE);
-
- info = _clutter_actor_get_transform_info_or_defaults (self);
-
- return clutter_anchor_coord_get_gravity (&info->scale_center);
-}
-
static inline void
clutter_actor_set_opacity_internal (ClutterActor *self,
guint8 opacity)
@@ -11520,52 +10512,6 @@ clutter_actor_get_name (ClutterActor *self)
return self->priv->name;
}
-/**
- * clutter_actor_get_gid:
- * @self: A #ClutterActor
- *
- * Retrieves the unique id for @self.
- *
- * Return value: Globally unique value for this object instance.
- *
- * Since: 0.6
- *
- * Deprecated: 1.8: The id is not used any longer.
- */
-guint32
-clutter_actor_get_gid (ClutterActor *self)
-{
- g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
-
- return self->priv->id;
-}
-
-static inline void
-clutter_actor_set_depth_internal (ClutterActor *self,
- float depth)
-{
- ClutterTransformInfo *info;
-
- info = _clutter_actor_get_transform_info (self);
-
- if (info->z_position != depth)
- {
- /* Sets Z value - XXX 2.0: should we invert? */
- info->z_position = depth;
-
- self->priv->transform_valid = FALSE;
-
- /* FIXME - remove this crap; sadly, there are still containers
- * in Clutter that depend on this utter brain damage
- */
- clutter_container_sort_depth_order (CLUTTER_CONTAINER (self));
-
- clutter_actor_queue_redraw (self);
-
- g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_DEPTH]);
- }
-}
-
static inline void
clutter_actor_set_z_position_internal (ClutterActor *self,
float z_position)
@@ -11734,236 +10680,6 @@ clutter_actor_get_pivot_point_z (ClutterActor *self)
}
/**
- * clutter_actor_set_depth:
- * @self: a #ClutterActor
- * @depth: Z co-ord
- *
- * Sets the Z coordinate of @self to @depth.
- *
- * The unit used by @depth is dependant on the perspective setup. See
- * also clutter_stage_set_perspective().
- *
- * Deprecated: 1.12: Use clutter_actor_set_z_position() instead.
- */
-void
-clutter_actor_set_depth (ClutterActor *self,
- gfloat depth)
-{
- const ClutterTransformInfo *info;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- info = _clutter_actor_get_transform_info_or_defaults (self);
- _clutter_actor_create_transition (self, obj_props[PROP_DEPTH],
- info->z_position,
- depth);
-}
-
-/**
- * clutter_actor_get_depth:
- * @self: a #ClutterActor
- *
- * Retrieves the depth of @self.
- *
- * Return value: the depth of the actor
- *
- * Deprecated: 1.12: Use clutter_actor_get_z_position() instead.
- */
-gfloat
-clutter_actor_get_depth (ClutterActor *self)
-{
- g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0.0);
-
- return _clutter_actor_get_transform_info_or_defaults (self)->z_position;
-}
-
-/**
- * clutter_actor_set_rotation:
- * @self: a #ClutterActor
- * @axis: the axis of rotation
- * @angle: the angle of rotation
- * @x: X coordinate of the rotation center
- * @y: Y coordinate of the rotation center
- * @z: Z coordinate of the rotation center
- *
- * Sets the rotation angle of @self around the given axis.
- *
- * The rotation center coordinates used depend on the value of @axis:
- * <itemizedlist>
- * <listitem><para>%CLUTTER_X_AXIS requires @y and @z</para></listitem>
- * <listitem><para>%CLUTTER_Y_AXIS requires @x and @z</para></listitem>
- * <listitem><para>%CLUTTER_Z_AXIS requires @x and @y</para></listitem>
- * </itemizedlist>
- *
- * The rotation coordinates are relative to the anchor point of the
- * actor, set using clutter_actor_set_anchor_point(). If no anchor
- * point is set, the upper left corner is assumed as the origin.
- *
- * Since: 0.8
- *
- * Deprecated: 1.12: Use clutter_actor_set_rotation_angle() and
- * clutter_actor_set_pivot_point() instead.
- */
-void
-clutter_actor_set_rotation (ClutterActor *self,
- ClutterRotateAxis axis,
- gdouble angle,
- gfloat x,
- gfloat y,
- gfloat z)
-{
- ClutterVertex v;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- v.x = x;
- v.y = y;
- v.z = z;
-
- g_object_freeze_notify (G_OBJECT (self));
-
- clutter_actor_set_rotation_angle (self, axis, angle);
- clutter_actor_set_rotation_center_internal (self, axis, &v);
-
- g_object_thaw_notify (G_OBJECT (self));
-}
-
-/**
- * clutter_actor_set_z_rotation_from_gravity:
- * @self: a #ClutterActor
- * @angle: the angle of rotation
- * @gravity: the center point of the rotation
- *
- * Sets the rotation angle of @self around the Z axis using the center
- * point specified as a compass point. For example to rotate such that
- * the center of the actor remains static you can use
- * %CLUTTER_GRAVITY_CENTER. If the actor changes size the center point
- * will move accordingly.
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use clutter_actor_set_rotation_angle() and
- * clutter_actor_set_pivot_point() instead.
- */
-void
-clutter_actor_set_z_rotation_from_gravity (ClutterActor *self,
- gdouble angle,
- ClutterGravity gravity)
-{
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- if (gravity == CLUTTER_GRAVITY_NONE)
- clutter_actor_set_rotation (self, CLUTTER_Z_AXIS, angle, 0, 0, 0);
- else
- {
- GObject *obj = G_OBJECT (self);
- ClutterTransformInfo *info;
- GParamSpec *pspec;
-
- pspec = obj_props[PROP_ROTATION_ANGLE_Z];
- info = _clutter_actor_get_transform_info (self);
-
- g_object_freeze_notify (obj);
-
- clutter_actor_set_rotation_angle_internal (self, angle, pspec);
-
- clutter_anchor_coord_set_gravity (&info->rz_center, gravity);
- g_object_notify_by_pspec (obj, obj_props[PROP_ROTATION_CENTER_Z_GRAVITY]);
- g_object_notify_by_pspec (obj, obj_props[PROP_ROTATION_CENTER_Z]);
-
- g_object_thaw_notify (obj);
- }
-}
-
-/**
- * clutter_actor_get_rotation:
- * @self: a #ClutterActor
- * @axis: the axis of rotation
- * @x: (out): return value for the X coordinate of the center of rotation
- * @y: (out): return value for the Y coordinate of the center of rotation
- * @z: (out): return value for the Z coordinate of the center of rotation
- *
- * Retrieves the angle and center of rotation on the given axis,
- * set using clutter_actor_set_rotation().
- *
- * Return value: the angle of rotation
- *
- * Since: 0.8
- *
- * Deprecated: 1.12: Use clutter_actor_get_rotation_angle() and
- * clutter_actor_get_pivot_point() instead.
- */
-gdouble
-clutter_actor_get_rotation (ClutterActor *self,
- ClutterRotateAxis axis,
- gfloat *x,
- gfloat *y,
- gfloat *z)
-{
- const ClutterTransformInfo *info;
- const AnchorCoord *anchor_coord;
- gdouble retval = 0;
-
- g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
-
- info = _clutter_actor_get_transform_info_or_defaults (self);
-
- switch (axis)
- {
- case CLUTTER_X_AXIS:
- anchor_coord = &info->rx_center;
- retval = info->rx_angle;
- break;
-
- case CLUTTER_Y_AXIS:
- anchor_coord = &info->ry_center;
- retval = info->ry_angle;
- break;
-
- case CLUTTER_Z_AXIS:
- anchor_coord = &info->rz_center;
- retval = info->rz_angle;
- break;
-
- default:
- anchor_coord = NULL;
- retval = 0.0;
- break;
- }
-
- clutter_anchor_coord_get_units (self, anchor_coord, x, y, z);
-
- return retval;
-}
-
-/**
- * clutter_actor_get_z_rotation_gravity:
- * @self: A #ClutterActor
- *
- * Retrieves the center for the rotation around the Z axis as a
- * compass direction. If the center was specified in pixels or units
- * this will return %CLUTTER_GRAVITY_NONE.
- *
- * Return value: the Z rotation center
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use the #ClutterActor:pivot-point instead of
- * a #ClutterGravity
- */
-ClutterGravity
-clutter_actor_get_z_rotation_gravity (ClutterActor *self)
-{
- const ClutterTransformInfo *info;
-
- g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0.0);
-
- info = _clutter_actor_get_transform_info_or_defaults (self);
-
- return clutter_anchor_coord_get_gravity (&info->rz_center);
-}
-
-/**
* clutter_actor_set_clip:
* @self: A #ClutterActor
* @xoff: X offset of the clip rectangle
@@ -11972,8 +10688,7 @@ clutter_actor_get_z_rotation_gravity (ClutterActor *self)
* @height: Height of the clip rectangle
*
* Sets clip area for @self. The clip area is always computed from the
- * upper left corner of the actor, even if the anchor point is set
- * otherwise.
+ * upper left corner of the actor.
*
* Since: 0.6
*/
@@ -12009,7 +10724,6 @@ clutter_actor_set_clip (ClutterActor *self,
clutter_actor_queue_redraw (self);
- g_object_notify_by_pspec (obj, obj_props[PROP_CLIP]);
g_object_notify_by_pspec (obj, obj_props[PROP_CLIP_RECT]);
g_object_notify_by_pspec (obj, obj_props[PROP_HAS_CLIP]);
}
@@ -12365,12 +11079,6 @@ typedef enum {
ADD_CHILD_EMIT_ACTOR_ADDED |
ADD_CHILD_CHECK_STATE |
ADD_CHILD_NOTIFY_FIRST_LAST |
- ADD_CHILD_SHOW_ON_SET_PARENT,
-
- /* flags for legacy/deprecated API */
- ADD_CHILD_LEGACY_FLAGS = ADD_CHILD_EMIT_PARENT_SET |
- ADD_CHILD_CHECK_STATE |
- ADD_CHILD_NOTIFY_FIRST_LAST |
ADD_CHILD_SHOW_ON_SET_PARENT
} ClutterActorAddChildFlags;
@@ -12542,7 +11250,7 @@ clutter_actor_add_child_internal (ClutterActor *self,
clutter_actor_set_text_direction (child, text_dir);
}
- if (show_on_set_parent && child->priv->show_on_set_parent)
+ if (show_on_set_parent)
clutter_actor_show (child);
if (CLUTTER_ACTOR_IS_MAPPED (child))
@@ -12734,43 +11442,6 @@ clutter_actor_insert_child_below (ClutterActor *self,
}
/**
- * clutter_actor_set_parent:
- * @self: A #ClutterActor
- * @parent: A new #ClutterActor parent
- *
- * Sets the parent of @self to @parent.
- *
- * This function will result in @parent acquiring a reference on @self,
- * eventually by sinking its floating reference first. The reference
- * will be released by clutter_actor_unparent().
- *
- * This function should only be called by legacy #ClutterActor<!-- -->s
- * implementing the #ClutterContainer interface.
- *
- * Deprecated: 1.10: Use clutter_actor_add_child() instead.
- */
-void
-clutter_actor_set_parent (ClutterActor *self,
- ClutterActor *parent)
-{
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
- g_return_if_fail (CLUTTER_IS_ACTOR (parent));
- g_return_if_fail (self != parent);
- g_return_if_fail (self->priv->parent == NULL);
-
- /* as this function will be called inside ClutterContainer::add
- * implementations or when building up a composite actor, we have
- * to preserve the old behaviour, and not create child meta or
- * emit the ::actor-added signal, to avoid recursion or double
- * emissions
- */
- clutter_actor_add_child_internal (parent, self,
- ADD_CHILD_LEGACY_FLAGS,
- insert_child_at_depth,
- NULL);
-}
-
-/**
* clutter_actor_get_parent:
* @self: A #ClutterActor
*
@@ -13000,134 +11671,6 @@ clutter_actor_replace_child (ClutterActor *self,
}
/**
- * clutter_actor_unparent:
- * @self: a #ClutterActor
- *
- * Removes the parent of @self.
- *
- * This will cause the parent of @self to release the reference
- * acquired when calling clutter_actor_set_parent(), so if you
- * want to keep @self you will have to acquire a reference of
- * your own, through g_object_ref().
- *
- * This function should only be called by legacy #ClutterActor<!-- -->s
- * implementing the #ClutterContainer interface.
- *
- * Since: 0.1.1
- *
- * Deprecated: 1.10: Use clutter_actor_remove_child() instead.
- */
-void
-clutter_actor_unparent (ClutterActor *self)
-{
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- if (self->priv->parent == NULL)
- return;
-
- clutter_actor_remove_child_internal (self->priv->parent, self,
- REMOVE_CHILD_LEGACY_FLAGS);
-}
-
-/**
- * clutter_actor_reparent:
- * @self: a #ClutterActor
- * @new_parent: the new #ClutterActor parent
- *
- * Resets the parent actor of @self.
- *
- * This function is logically equivalent to calling clutter_actor_unparent()
- * and clutter_actor_set_parent(), but more efficiently implemented, as it
- * ensures the child is not finalized when unparented, and emits the
- * #ClutterActor::parent-set signal only once.
- *
- * In reality, calling this function is less useful than it sounds, as some
- * application code may rely on changes in the intermediate state between
- * removal and addition of the actor from its old parent to the @new_parent.
- * Thus, it is strongly encouraged to avoid using this function in application
- * code.
- *
- * Since: 0.2
- *
- * Deprecated: 1.10: Use clutter_actor_remove_child() and
- * clutter_actor_add_child() instead; remember to take a reference on
- * the actor being removed before calling clutter_actor_remove_child()
- * to avoid the reference count dropping to zero and the actor being
- * destroyed.
- */
-void
-clutter_actor_reparent (ClutterActor *self,
- ClutterActor *new_parent)
-{
- ClutterActorPrivate *priv;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
- g_return_if_fail (CLUTTER_IS_ACTOR (new_parent));
- g_return_if_fail (self != new_parent);
-
- if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
- {
- g_warning ("Cannot set a parent on a toplevel actor");
- return;
- }
-
- if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
- {
- g_warning ("Cannot set a parent currently being destroyed");
- return;
- }
-
- priv = self->priv;
-
- if (priv->parent != new_parent)
- {
- ClutterActor *old_parent;
-
- CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT);
-
- old_parent = priv->parent;
-
- g_object_ref (self);
-
- if (old_parent != NULL)
- {
- /* go through the Container implementation if this is a regular
- * child and not an internal one
- */
- if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
- {
- ClutterContainer *parent = CLUTTER_CONTAINER (old_parent);
-
- /* this will have to call unparent() */
- clutter_container_remove_actor (parent, self);
- }
- else
- clutter_actor_remove_child_internal (old_parent, self,
- REMOVE_CHILD_LEGACY_FLAGS);
- }
-
- /* Note, will call set_parent() */
- if (!CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
- clutter_container_add_actor (CLUTTER_CONTAINER (new_parent), self);
- else
- clutter_actor_add_child_internal (new_parent, self,
- ADD_CHILD_LEGACY_FLAGS,
- insert_child_at_depth,
- NULL);
-
- /* we emit the ::parent-set signal once */
- g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
-
- CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT);
-
- /* the IN_REPARENT flag suspends state updates */
- clutter_actor_update_map_state (self, MAP_STATE_CHECK);
-
- g_object_unref (self);
- }
-}
-
-/**
* clutter_actor_contains:
* @self: A #ClutterActor
* @descendant: A #ClutterActor, possibly contained in @self
@@ -13291,134 +11834,6 @@ clutter_actor_set_child_at_index (ClutterActor *self,
clutter_actor_queue_relayout (self);
}
-/**
- * clutter_actor_raise:
- * @self: A #ClutterActor
- * @below: (allow-none): A #ClutterActor to raise above.
- *
- * Puts @self above @below.
- *
- * Both actors must have the same parent, and the parent must implement
- * the #ClutterContainer interface
- *
- * This function calls clutter_container_raise_child() internally.
- *
- * Deprecated: 1.10: Use clutter_actor_set_child_above_sibling() instead.
- */
-void
-clutter_actor_raise (ClutterActor *self,
- ClutterActor *below)
-{
- ClutterActor *parent;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- parent = clutter_actor_get_parent (self);
- if (parent == NULL)
- {
- g_warning ("%s: Actor '%s' is not inside a container",
- G_STRFUNC,
- _clutter_actor_get_debug_name (self));
- return;
- }
-
- if (below != NULL)
- {
- if (parent != clutter_actor_get_parent (below))
- {
- g_warning ("%s Actor '%s' is not in the same container as "
- "actor '%s'",
- G_STRFUNC,
- _clutter_actor_get_debug_name (self),
- _clutter_actor_get_debug_name (below));
- return;
- }
- }
-
- clutter_container_raise_child (CLUTTER_CONTAINER (parent), self, below);
-}
-
-/**
- * clutter_actor_lower:
- * @self: A #ClutterActor
- * @above: (allow-none): A #ClutterActor to lower below
- *
- * Puts @self below @above.
- *
- * Both actors must have the same parent, and the parent must implement
- * the #ClutterContainer interface.
- *
- * This function calls clutter_container_lower_child() internally.
- *
- * Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() instead.
- */
-void
-clutter_actor_lower (ClutterActor *self,
- ClutterActor *above)
-{
- ClutterActor *parent;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- parent = clutter_actor_get_parent (self);
- if (parent == NULL)
- {
- g_warning ("%s: Actor of type %s is not inside a container",
- G_STRFUNC,
- _clutter_actor_get_debug_name (self));
- return;
- }
-
- if (above)
- {
- if (parent != clutter_actor_get_parent (above))
- {
- g_warning ("%s: Actor '%s' is not in the same container as "
- "actor '%s'",
- G_STRFUNC,
- _clutter_actor_get_debug_name (self),
- _clutter_actor_get_debug_name (above));
- return;
- }
- }
-
- clutter_container_lower_child (CLUTTER_CONTAINER (parent), self, above);
-}
-
-/**
- * clutter_actor_raise_top:
- * @self: A #ClutterActor
- *
- * Raises @self to the top.
- *
- * This function calls clutter_actor_raise() internally.
- *
- * Deprecated: 1.10: Use clutter_actor_set_child_above_sibling() with
- * a %NULL sibling, instead.
- */
-void
-clutter_actor_raise_top (ClutterActor *self)
-{
- clutter_actor_raise (self, NULL);
-}
-
-/**
- * clutter_actor_lower_bottom:
- * @self: A #ClutterActor
- *
- * Lowers @self to the bottom.
- *
- * This function calls clutter_actor_lower() internally.
- *
- * Deprecated: 1.10: Use clutter_actor_set_child_below_sibling() with
- * a %NULL sibling, instead.
- */
-void
-clutter_actor_lower_bottom (ClutterActor *self)
-{
- clutter_actor_lower (self, NULL);
-}
-
/*
* Event handling
*/
@@ -13485,340 +11900,80 @@ clutter_actor_event (ClutterActor *actor,
break;
case CLUTTER_MOTION:
signal_num = MOTION_EVENT;
- break;
- case CLUTTER_ENTER:
- signal_num = ENTER_EVENT;
- break;
- case CLUTTER_LEAVE:
- signal_num = LEAVE_EVENT;
- break;
- case CLUTTER_TOUCH_BEGIN:
- case CLUTTER_TOUCH_END:
- case CLUTTER_TOUCH_UPDATE:
- case CLUTTER_TOUCH_CANCEL:
- signal_num = TOUCH_EVENT;
- break;
- case CLUTTER_DELETE:
- case CLUTTER_DESTROY_NOTIFY:
- case CLUTTER_CLIENT_MESSAGE:
- default:
- signal_num = -1;
- break;
- }
-
- if (signal_num != -1)
- g_signal_emit (actor, actor_signals[signal_num], 0,
- event, &retval);
- }
-
-out:
- g_object_unref (actor);
-
- return retval;
-}
-
-/**
- * clutter_actor_set_reactive:
- * @actor: a #ClutterActor
- * @reactive: whether the actor should be reactive to events
- *
- * Sets @actor as reactive. Reactive actors will receive events.
- *
- * Since: 0.6
- */
-void
-clutter_actor_set_reactive (ClutterActor *actor,
- gboolean reactive)
-{
- g_return_if_fail (CLUTTER_IS_ACTOR (actor));
-
- if (reactive == CLUTTER_ACTOR_IS_REACTIVE (actor))
- return;
-
- if (reactive)
- CLUTTER_ACTOR_SET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE);
- else
- CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE);
-
- g_object_notify_by_pspec (G_OBJECT (actor), obj_props[PROP_REACTIVE]);
-}
-
-/**
- * clutter_actor_get_reactive:
- * @actor: a #ClutterActor
- *
- * Checks whether @actor is marked as reactive.
- *
- * Return value: %TRUE if the actor is reactive
- *
- * Since: 0.6
- */
-gboolean
-clutter_actor_get_reactive (ClutterActor *actor)
-{
- g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
-
- return CLUTTER_ACTOR_IS_REACTIVE (actor) ? TRUE : FALSE;
-}
-
-/**
- * clutter_actor_get_anchor_point:
- * @self: a #ClutterActor
- * @anchor_x: (out): return location for the X coordinate of the anchor point
- * @anchor_y: (out): return location for the Y coordinate of the anchor point
- *
- * Gets the current anchor point of the @actor in pixels.
- *
- * Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead
- */
-void
-clutter_actor_get_anchor_point (ClutterActor *self,
- gfloat *anchor_x,
- gfloat *anchor_y)
-{
- const ClutterTransformInfo *info;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- info = _clutter_actor_get_transform_info_or_defaults (self);
- clutter_anchor_coord_get_units (self, &info->anchor,
- anchor_x,
- anchor_y,
- NULL);
-}
-
-/**
- * clutter_actor_set_anchor_point:
- * @self: a #ClutterActor
- * @anchor_x: X coordinate of the anchor point
- * @anchor_y: Y coordinate of the anchor point
- *
- * Sets an anchor point for @self. The anchor point is a point in the
- * coordinate space of an actor to which the actor position within its
- * parent is relative; the default is (0, 0), i.e. the top-left corner
- * of the actor.
- *
- * Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead.
- */
-void
-clutter_actor_set_anchor_point (ClutterActor *self,
- gfloat anchor_x,
- gfloat anchor_y)
-{
- ClutterTransformInfo *info;
- ClutterActorPrivate *priv;
- gboolean changed = FALSE;
- gfloat old_anchor_x, old_anchor_y;
- GObject *obj;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- obj = G_OBJECT (self);
- priv = self->priv;
- info = _clutter_actor_get_transform_info (self);
-
- g_object_freeze_notify (obj);
-
- clutter_anchor_coord_get_units (self, &info->anchor,
- &old_anchor_x,
- &old_anchor_y,
- NULL);
-
- if (info->anchor.is_fractional)
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_GRAVITY]);
-
- if (old_anchor_x != anchor_x)
- {
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_X]);
- changed = TRUE;
- }
-
- if (old_anchor_y != anchor_y)
- {
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_Y]);
- changed = TRUE;
- }
-
- clutter_anchor_coord_set_units (&info->anchor, anchor_x, anchor_y, 0);
-
- if (changed)
- {
- priv->transform_valid = FALSE;
- clutter_actor_queue_redraw (self);
- }
-
- g_object_thaw_notify (obj);
-}
-
-/**
- * clutter_actor_get_anchor_point_gravity:
- * @self: a #ClutterActor
- *
- * Retrieves the anchor position expressed as a #ClutterGravity. If
- * the anchor point was specified using pixels or units this will
- * return %CLUTTER_GRAVITY_NONE.
- *
- * Return value: the #ClutterGravity used by the anchor point
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead.
- */
-ClutterGravity
-clutter_actor_get_anchor_point_gravity (ClutterActor *self)
-{
- const ClutterTransformInfo *info;
-
- g_return_val_if_fail (CLUTTER_IS_ACTOR (self), CLUTTER_GRAVITY_NONE);
-
- info = _clutter_actor_get_transform_info_or_defaults (self);
-
- return clutter_anchor_coord_get_gravity (&info->anchor);
-}
-
-/**
- * clutter_actor_move_anchor_point:
- * @self: a #ClutterActor
- * @anchor_x: X coordinate of the anchor point
- * @anchor_y: Y coordinate of the anchor point
- *
- * Sets an anchor point for the actor, and adjusts the actor postion so that
- * the relative position of the actor toward its parent remains the same.
- *
- * Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead.
- */
-void
-clutter_actor_move_anchor_point (ClutterActor *self,
- gfloat anchor_x,
- gfloat anchor_y)
-{
- gfloat old_anchor_x, old_anchor_y;
- const ClutterTransformInfo *info;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- info = _clutter_actor_get_transform_info (self);
- clutter_anchor_coord_get_units (self, &info->anchor,
- &old_anchor_x,
- &old_anchor_y,
- NULL);
-
- g_object_freeze_notify (G_OBJECT (self));
+ break;
+ case CLUTTER_ENTER:
+ signal_num = ENTER_EVENT;
+ break;
+ case CLUTTER_LEAVE:
+ signal_num = LEAVE_EVENT;
+ break;
+ case CLUTTER_TOUCH_BEGIN:
+ case CLUTTER_TOUCH_END:
+ case CLUTTER_TOUCH_UPDATE:
+ case CLUTTER_TOUCH_CANCEL:
+ signal_num = TOUCH_EVENT;
+ break;
+ case CLUTTER_DELETE:
+ case CLUTTER_DESTROY_NOTIFY:
+ case CLUTTER_CLIENT_MESSAGE:
+ default:
+ signal_num = -1;
+ break;
+ }
- clutter_actor_set_anchor_point (self, anchor_x, anchor_y);
+ if (signal_num != -1)
+ g_signal_emit (actor, actor_signals[signal_num], 0,
+ event, &retval);
+ }
- if (self->priv->position_set)
- clutter_actor_move_by (self,
- anchor_x - old_anchor_x,
- anchor_y - old_anchor_y);
+out:
+ g_object_unref (actor);
- g_object_thaw_notify (G_OBJECT (self));
+ return retval;
}
/**
- * clutter_actor_move_anchor_point_from_gravity:
- * @self: a #ClutterActor
- * @gravity: #ClutterGravity.
- *
- * Sets an anchor point on the actor based on the given gravity, adjusting the
- * actor postion so that its relative position within its parent remains
- * unchanged.
+ * clutter_actor_set_reactive:
+ * @actor: a #ClutterActor
+ * @reactive: whether the actor should be reactive to events
*
- * Since version 1.0 the anchor point will be stored as a gravity so
- * that if the actor changes size then the anchor point will move. For
- * example, if you set the anchor point to %CLUTTER_GRAVITY_SOUTH_EAST
- * and later double the size of the actor, the anchor point will move
- * to the bottom right.
+ * Sets @actor as reactive. Reactive actors will receive events.
*
* Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead.
*/
void
-clutter_actor_move_anchor_point_from_gravity (ClutterActor *self,
- ClutterGravity gravity)
+clutter_actor_set_reactive (ClutterActor *actor,
+ gboolean reactive)
{
- gfloat old_anchor_x, old_anchor_y, new_anchor_x, new_anchor_y;
- const ClutterTransformInfo *info;
- ClutterActorPrivate *priv;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- priv = self->priv;
- info = _clutter_actor_get_transform_info (self);
+ g_return_if_fail (CLUTTER_IS_ACTOR (actor));
- g_object_freeze_notify (G_OBJECT (self));
+ if (reactive == CLUTTER_ACTOR_IS_REACTIVE (actor))
+ return;
- clutter_anchor_coord_get_units (self, &info->anchor,
- &old_anchor_x,
- &old_anchor_y,
- NULL);
- clutter_actor_set_anchor_point_from_gravity (self, gravity);
- clutter_anchor_coord_get_units (self, &info->anchor,
- &new_anchor_x,
- &new_anchor_y,
- NULL);
-
- if (priv->position_set)
- clutter_actor_move_by (self,
- new_anchor_x - old_anchor_x,
- new_anchor_y - old_anchor_y);
+ if (reactive)
+ CLUTTER_ACTOR_SET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE);
+ else
+ CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REACTIVE);
- g_object_thaw_notify (G_OBJECT (self));
+ g_object_notify_by_pspec (G_OBJECT (actor), obj_props[PROP_REACTIVE]);
}
/**
- * clutter_actor_set_anchor_point_from_gravity:
- * @self: a #ClutterActor
- * @gravity: #ClutterGravity.
+ * clutter_actor_get_reactive:
+ * @actor: a #ClutterActor
*
- * Sets an anchor point on the actor, based on the given gravity (this is a
- * convenience function wrapping clutter_actor_set_anchor_point()).
+ * Checks whether @actor is marked as reactive.
*
- * Since version 1.0 the anchor point will be stored as a gravity so
- * that if the actor changes size then the anchor point will move. For
- * example, if you set the anchor point to %CLUTTER_GRAVITY_SOUTH_EAST
- * and later double the size of the actor, the anchor point will move
- * to the bottom right.
+ * Return value: %TRUE if the actor is reactive
*
* Since: 0.6
- *
- * Deprecated: 1.12: Use #ClutterActor:pivot-point instead.
*/
-void
-clutter_actor_set_anchor_point_from_gravity (ClutterActor *self,
- ClutterGravity gravity)
+gboolean
+clutter_actor_get_reactive (ClutterActor *actor)
{
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- if (gravity == CLUTTER_GRAVITY_NONE)
- clutter_actor_set_anchor_point (self, 0, 0);
- else
- {
- GObject *obj = G_OBJECT (self);
- ClutterTransformInfo *info;
-
- g_object_freeze_notify (obj);
-
- info = _clutter_actor_get_transform_info (self);
- clutter_anchor_coord_set_gravity (&info->anchor, gravity);
-
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_GRAVITY]);
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_X]);
- g_object_notify_by_pspec (obj, obj_props[PROP_ANCHOR_Y]);
-
- self->priv->transform_valid = FALSE;
-
- clutter_actor_queue_redraw (self);
+ g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
- g_object_thaw_notify (obj);
- }
+ return CLUTTER_ACTOR_IS_REACTIVE (actor) ? TRUE : FALSE;
}
static void
@@ -13898,8 +12053,8 @@ parse_units (ClutterActor *self,
else
{
g_warning ("Invalid value of type '%s': integers, strings of floating "
- "point values can be used for the x, y, width, height "
- "anchor-x and anchor-y properties.",
+ "point values can be used for the position and sizing "
+ "properties.",
g_type_name (G_VALUE_TYPE (&value)));
}
@@ -14099,40 +12254,6 @@ parse_actor_metas (ClutterScript *script,
return g_slist_reverse (retval);
}
-static GSList *
-parse_behaviours (ClutterScript *script,
- ClutterActor *actor,
- JsonNode *node)
-{
- GList *elements, *l;
- GSList *retval = NULL;
-
- if (!JSON_NODE_HOLDS_ARRAY (node))
- return NULL;
-
- elements = json_array_get_elements (json_node_get_array (node));
-
- for (l = elements; l != NULL; l = l->next)
- {
- JsonNode *element = l->data;
- const gchar *id_ = _clutter_script_get_id_from_node (element);
- GObject *behaviour;
-
- if (id_ == NULL || *id_ == '\0')
- continue;
-
- behaviour = clutter_script_get_object (script, id_);
- if (behaviour == NULL)
- continue;
-
- retval = g_slist_prepend (retval, behaviour);
- }
-
- g_list_free (elements);
-
- return g_slist_reverse (retval);
-}
-
static ClutterMargin *
parse_margin (ClutterActor *self,
JsonNode *node)
@@ -14203,9 +12324,7 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable,
if ((name[0] == 'x' && name[1] == '\0') ||
(name[0] == 'y' && name[1] == '\0') ||
(strcmp (name, "width") == 0) ||
- (strcmp (name, "height") == 0) ||
- (strcmp (name, "anchor_x") == 0) ||
- (strcmp (name, "anchor_y") == 0))
+ (strcmp (name, "height") == 0))
{
ParseDimension dimension;
gfloat units;
@@ -14218,10 +12337,6 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable,
dimension = PARSE_WIDTH;
else if (name[0] == 'h')
dimension = PARSE_HEIGHT;
- else if (name[0] == 'a' && name[7] == 'x')
- dimension = PARSE_ANCHOR_X;
- else if (name[0] == 'a' && name[7] == 'y')
- dimension = PARSE_ANCHOR_Y;
else
return FALSE;
@@ -14248,24 +12363,6 @@ clutter_actor_parse_custom_node (ClutterScriptable *scriptable,
else
g_slice_free (RotationInfo, info);
}
- else if (strcmp (name, "behaviours") == 0)
- {
- GSList *l;
-
-#ifdef CLUTTER_ENABLE_DEBUG
- if (G_UNLIKELY (_clutter_diagnostic_enabled ()))
- _clutter_diagnostic_message ("The 'behaviours' key is deprecated "
- "and it should not be used in newly "
- "written ClutterScript definitions.");
-#endif
-
- l = parse_behaviours (script, actor, node);
-
- g_value_init (value, G_TYPE_POINTER);
- g_value_set_pointer (value, l);
-
- retval = TRUE;
- }
else if (strcmp (name, "actions") == 0 ||
strcmp (name, "constraints") == 0 ||
strcmp (name, "effects") == 0)
@@ -14325,37 +12422,13 @@ clutter_actor_set_custom_property (ClutterScriptable *scriptable,
info = g_value_get_pointer (value);
- clutter_actor_set_rotation (actor,
- info->axis, info->angle,
- info->center_x,
- info->center_y,
- info->center_z);
+ clutter_actor_set_rotation_angle (actor, info->axis, info->angle);
g_slice_free (RotationInfo, info);
return;
}
- if (strcmp (name, "behaviours") == 0)
- {
- GSList *behaviours, *l;
-
- if (!G_VALUE_HOLDS (value, G_TYPE_POINTER))
- return;
-
- behaviours = g_value_get_pointer (value);
- for (l = behaviours; l != NULL; l = l->next)
- {
- ClutterBehaviour *behaviour = l->data;
-
- clutter_behaviour_apply (behaviour, actor);
- }
-
- g_slist_free (behaviours);
-
- return;
- }
-
if (strcmp (name, "actions") == 0 ||
strcmp (name, "constraints") == 0 ||
strcmp (name, "effects") == 0)
@@ -14568,10 +12641,6 @@ clutter_actor_set_animatable_property (ClutterActor *actor,
actor->priv->allocation_flags);
break;
- case PROP_DEPTH:
- clutter_actor_set_depth_internal (actor, g_value_get_float (value));
- break;
-
case PROP_Z_POSITION:
clutter_actor_set_z_position_internal (actor, g_value_get_float (value));
break;
@@ -15419,169 +13488,6 @@ _clutter_actor_set_enable_paint_unmapped (ClutterActor *self,
}
}
-static void
-clutter_anchor_coord_get_units (ClutterActor *self,
- const AnchorCoord *coord,
- gfloat *x,
- gfloat *y,
- gfloat *z)
-{
- if (coord->is_fractional)
- {
- gfloat actor_width, actor_height;
-
- clutter_actor_get_size (self, &actor_width, &actor_height);
-
- if (x)
- *x = actor_width * coord->v.fraction.x;
-
- if (y)
- *y = actor_height * coord->v.fraction.y;
-
- if (z)
- *z = 0;
- }
- else
- {
- if (x)
- *x = coord->v.units.x;
-
- if (y)
- *y = coord->v.units.y;
-
- if (z)
- *z = coord->v.units.z;
- }
-}
-
-static void
-clutter_anchor_coord_set_units (AnchorCoord *coord,
- gfloat x,
- gfloat y,
- gfloat z)
-{
- coord->is_fractional = FALSE;
- coord->v.units.x = x;
- coord->v.units.y = y;
- coord->v.units.z = z;
-}
-
-static ClutterGravity
-clutter_anchor_coord_get_gravity (const AnchorCoord *coord)
-{
- if (coord->is_fractional)
- {
- if (coord->v.fraction.x == 0.0)
- {
- if (coord->v.fraction.y == 0.0)
- return CLUTTER_GRAVITY_NORTH_WEST;
- else if (coord->v.fraction.y == 0.5)
- return CLUTTER_GRAVITY_WEST;
- else if (coord->v.fraction.y == 1.0)
- return CLUTTER_GRAVITY_SOUTH_WEST;
- else
- return CLUTTER_GRAVITY_NONE;
- }
- else if (coord->v.fraction.x == 0.5)
- {
- if (coord->v.fraction.y == 0.0)
- return CLUTTER_GRAVITY_NORTH;
- else if (coord->v.fraction.y == 0.5)
- return CLUTTER_GRAVITY_CENTER;
- else if (coord->v.fraction.y == 1.0)
- return CLUTTER_GRAVITY_SOUTH;
- else
- return CLUTTER_GRAVITY_NONE;
- }
- else if (coord->v.fraction.x == 1.0)
- {
- if (coord->v.fraction.y == 0.0)
- return CLUTTER_GRAVITY_NORTH_EAST;
- else if (coord->v.fraction.y == 0.5)
- return CLUTTER_GRAVITY_EAST;
- else if (coord->v.fraction.y == 1.0)
- return CLUTTER_GRAVITY_SOUTH_EAST;
- else
- return CLUTTER_GRAVITY_NONE;
- }
- else
- return CLUTTER_GRAVITY_NONE;
- }
- else
- return CLUTTER_GRAVITY_NONE;
-}
-
-static void
-clutter_anchor_coord_set_gravity (AnchorCoord *coord,
- ClutterGravity gravity)
-{
- switch (gravity)
- {
- case CLUTTER_GRAVITY_NORTH:
- coord->v.fraction.x = 0.5;
- coord->v.fraction.y = 0.0;
- break;
-
- case CLUTTER_GRAVITY_NORTH_EAST:
- coord->v.fraction.x = 1.0;
- coord->v.fraction.y = 0.0;
- break;
-
- case CLUTTER_GRAVITY_EAST:
- coord->v.fraction.x = 1.0;
- coord->v.fraction.y = 0.5;
- break;
-
- case CLUTTER_GRAVITY_SOUTH_EAST:
- coord->v.fraction.x = 1.0;
- coord->v.fraction.y = 1.0;
- break;
-
- case CLUTTER_GRAVITY_SOUTH:
- coord->v.fraction.x = 0.5;
- coord->v.fraction.y = 1.0;
- break;
-
- case CLUTTER_GRAVITY_SOUTH_WEST:
- coord->v.fraction.x = 0.0;
- coord->v.fraction.y = 1.0;
- break;
-
- case CLUTTER_GRAVITY_WEST:
- coord->v.fraction.x = 0.0;
- coord->v.fraction.y = 0.5;
- break;
-
- case CLUTTER_GRAVITY_NORTH_WEST:
- coord->v.fraction.x = 0.0;
- coord->v.fraction.y = 0.0;
- break;
-
- case CLUTTER_GRAVITY_CENTER:
- coord->v.fraction.x = 0.5;
- coord->v.fraction.y = 0.5;
- break;
-
- default:
- coord->v.fraction.x = 0.0;
- coord->v.fraction.y = 0.0;
- break;
- }
-
- coord->is_fractional = TRUE;
-}
-
-static gboolean
-clutter_anchor_coord_is_zero (const AnchorCoord *coord)
-{
- if (coord->is_fractional)
- return coord->v.fraction.x == 0.0 && coord->v.fraction.y == 0.0;
- else
- return (coord->v.units.x == 0.0
- && coord->v.units.y == 0.0
- && coord->v.units.z == 0.0);
-}
-
/**
* clutter_actor_get_flags:
* @self: a #ClutterActor
@@ -15721,25 +13627,6 @@ clutter_actor_unset_flags (ClutterActor *self,
}
/**
- * clutter_actor_get_transformation_matrix:
- * @self: a #ClutterActor
- * @matrix: (out caller-allocates): the return location for a #ClutterMatrix
- *
- * Retrieves the transformations applied to @self relative to its
- * parent.
- *
- * Since: 1.0
- *
- * Deprecated: 1.12: Use clutter_actor_get_transform() instead
- */
-void
-clutter_actor_get_transformation_matrix (ClutterActor *self,
- ClutterMatrix *matrix)
-{
- clutter_actor_get_transform (self, matrix);
-}
-
-/**
* clutter_actor_set_transform:
* @self: a #ClutterActor
* @transform: (allow-none): a #ClutterMatrix, or %NULL to
@@ -15937,102 +13824,6 @@ clutter_actor_get_text_direction (ClutterActor *self)
}
/**
- * clutter_actor_push_internal:
- * @self: a #ClutterActor
- *
- * Should be used by actors implementing the #ClutterContainer and with
- * internal children added through clutter_actor_set_parent(), for instance:
- *
- * |[
- * static void
- * my_actor_init (MyActor *self)
- * {
- * self->priv = SELF_ACTOR_GET_PRIVATE (self);
- *
- * clutter_actor_push_internal (CLUTTER_ACTOR (self));
- *
- * /* calling clutter_actor_set_parent() now will result in
- * * the internal flag being set on a child of MyActor
- * */
- *
- * /* internal child - a background texture */
- * self->priv->background_tex = clutter_texture_new ();
- * clutter_actor_set_parent (self->priv->background_tex,
- * CLUTTER_ACTOR (self));
- *
- * /* internal child - a label */
- * self->priv->label = clutter_text_new ();
- * clutter_actor_set_parent (self->priv->label,
- * CLUTTER_ACTOR (self));
- *
- * clutter_actor_pop_internal (CLUTTER_ACTOR (self));
- *
- * /* calling clutter_actor_set_parent() now will not result in
- * * the internal flag being set on a child of MyActor
- * */
- * }
- * ]|
- *
- * This function will be used by Clutter to toggle an "internal child"
- * flag whenever clutter_actor_set_parent() is called; internal children
- * are handled differently by Clutter, specifically when destroying their
- * parent.
- *
- * Call clutter_actor_pop_internal() when you finished adding internal
- * children.
- *
- * Nested calls to clutter_actor_push_internal() are allowed, but each
- * one must by followed by a clutter_actor_pop_internal() call.
- *
- * Since: 1.2
- *
- * Deprecated: 1.10: All children of an actor are accessible through
- * the #ClutterActor API, and #ClutterActor implements the
- * #ClutterContainer interface, so this function is only useful
- * for legacy containers overriding the default implementation.
- */
-void
-clutter_actor_push_internal (ClutterActor *self)
-{
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- self->priv->internal_child += 1;
-}
-
-/**
- * clutter_actor_pop_internal:
- * @self: a #ClutterActor
- *
- * Disables the effects of clutter_actor_push_internal().
- *
- * Since: 1.2
- *
- * Deprecated: 1.10: All children of an actor are accessible through
- * the #ClutterActor API. This function is only useful for legacy
- * containers overriding the default implementation of the
- * #ClutterContainer interface.
- */
-void
-clutter_actor_pop_internal (ClutterActor *self)
-{
- ClutterActorPrivate *priv;
-
- g_return_if_fail (CLUTTER_IS_ACTOR (self));
-
- priv = self->priv;
-
- if (priv->internal_child == 0)
- {
- g_warning ("Mismatched %s: you need to call "
- "clutter_actor_push_composite() at least once before "
- "calling this function", G_STRFUNC);
- return;
- }
-
- priv->internal_child -= 1;
-}
-
-/**
* clutter_actor_has_pointer:
* @self: a #ClutterActor
*
diff --git a/clutter/clutter-animatable.c b/clutter/clutter-animatable.c
index 85a835d..178706c 100644
--- a/clutter/clutter-animatable.c
+++ b/clutter/clutter-animatable.c
@@ -68,80 +68,6 @@ clutter_animatable_default_init (ClutterAnimatableInterface *iface)
}
/**
- * clutter_animatable_animate_property:
- * @animatable: a #ClutterAnimatable
- * @animation: a #ClutterAnimation
- * @property_name: the name of the animated property
- * @initial_value: the initial value of the animation interval
- * @final_value: the final value of the animation interval
- * @progress: the progress factor
- * @value: return location for the animation value
- *
- * Calls the animate_property() virtual function for @animatable.
- *
- * The @initial_value and @final_value #GValue<!-- -->s must contain
- * the same type; @value must have been initialized to the same
- * type of @initial_value and @final_value.
- *
- * All implementation of the #ClutterAnimatable interface must
- * implement this function.
- *
- * Return value: %TRUE if the value has been validated and can
- * be applied to the #ClutterAnimatable, and %FALSE otherwise
- *
- * Since: 1.0
- *
- * Deprecated: 1.8: Use clutter_animatable_interpolate_value()
- * instead
- */
-gboolean
-clutter_animatable_animate_property (ClutterAnimatable *animatable,
- ClutterAnimation *animation,
- const gchar *property_name,
- const GValue *initial_value,
- const GValue *final_value,
- gdouble progress,
- GValue *value)
-{
- ClutterAnimatableIface *iface;
- gboolean res;
-
- g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
- g_return_val_if_fail (CLUTTER_IS_ANIMATION (animation), FALSE);
- g_return_val_if_fail (property_name != NULL, FALSE);
- g_return_val_if_fail (initial_value != NULL && final_value != NULL, FALSE);
- g_return_val_if_fail (G_VALUE_TYPE (initial_value) != G_TYPE_INVALID, FALSE);
- g_return_val_if_fail (G_VALUE_TYPE (final_value) != G_TYPE_INVALID, FALSE);
- g_return_val_if_fail (value != NULL, FALSE);
- g_return_val_if_fail (G_VALUE_TYPE (value) == G_VALUE_TYPE (initial_value) &&
- G_VALUE_TYPE (value) == G_VALUE_TYPE (final_value),
- FALSE);
-
- iface = CLUTTER_ANIMATABLE_GET_IFACE (animatable);
- if (iface->animate_property == NULL)
- {
- ClutterInterval *interval;
-
- interval = clutter_animation_get_interval (animation, property_name);
- if (interval == NULL)
- return FALSE;
-
- res = clutter_animatable_interpolate_value (animatable, property_name,
- interval,
- progress,
- value);
- }
- else
- res = iface->animate_property (animatable, animation,
- property_name,
- initial_value, final_value,
- progress,
- value);
-
- return res;
-}
-
-/**
* clutter_animatable_find_property:
* @animatable: a #ClutterAnimatable
* @property_name: the name of the animatable property to find
diff --git a/clutter/clutter-interval.c b/clutter/clutter-interval.c
index 13649ad..8370c33 100644
--- a/clutter/clutter-interval.c
+++ b/clutter/clutter-interval.c
@@ -103,21 +103,6 @@ clutter_interval_real_validate (ClutterInterval *interval,
{
GType pspec_gtype = G_PARAM_SPEC_VALUE_TYPE (pspec);
- /* check the GTypes we provide first */
- if (pspec_gtype == COGL_TYPE_FIXED)
- {
- ClutterParamSpecFixed *pspec_fixed = CLUTTER_PARAM_SPEC_FIXED (pspec);
- CoglFixed a, b;
-
- a = b = 0;
- clutter_interval_get_interval (interval, &a, &b);
- if ((a >= pspec_fixed->minimum && a <= pspec_fixed->maximum) &&
- (b >= pspec_fixed->minimum && b <= pspec_fixed->maximum))
- return TRUE;
- else
- return FALSE;
- }
-
/* then check the fundamental types */
switch (G_TYPE_FUNDAMENTAL (pspec_gtype))
{
diff --git a/clutter/clutter-layout-manager.c b/clutter/clutter-layout-manager.c
index 9f3ef56..7710778 100644
--- a/clutter/clutter-layout-manager.c
+++ b/clutter/clutter-layout-manager.c
@@ -79,173 +79,6 @@
* function whenever one of these properties changes.</para>
* </refsect2>
*
- * <refsect2 id="ClutterLayoutManager-animation">
- * <title>Animating a ClutterLayoutManager</title>
- * <para>A layout manager is used to let a #ClutterContainer take complete
- * ownership over the layout (that is: the position and sizing) of its
- * children; this means that using the Clutter animation API, like
- * clutter_actor_animate(), to animate the position and sizing of a child of
- * a layout manager it is not going to work properly, as the animation will
- * automatically override any setting done by the layout manager
- * itself.</para>
- * <para>It is possible for a #ClutterLayoutManager sub-class to animate its
- * children layout by using the base class animation support. The
- * #ClutterLayoutManager animation support consists of three virtual
- * functions: #ClutterLayoutManagerClass.begin_animation(),
- * #ClutterLayoutManagerClass.get_animation_progress(), and
- * #ClutterLayoutManagerClass.end_animation().</para>
- * <variablelist>
- * <varlistentry>
- * <term><function>begin_animation (duration, easing)</function></term>
- * <listitem><para>This virtual function is invoked when the layout
- * manager should begin an animation. The implementation should set up
- * the state for the animation and create the ancillary objects for
- * animating the layout. The default implementation creates a
- * #ClutterTimeline for the given duration and a #ClutterAlpha binding
- * the timeline to the given easing mode. This function returns a
- * #ClutterAlpha which should be used to control the animation from
- * the caller perspective.</para></listitem>
- * </varlistentry>
- * <varlistentry>
- * <term><function>get_animation_progress()</function></term>
- * <listitem><para>This virtual function should be invoked when animating
- * a layout manager. It returns the progress of the animation, using the
- * same semantics as the #ClutterAlpha:alpha value.</para></listitem>
- * </varlistentry>
- * <varlistentry>
- * <term><function>end_animation()</function></term>
- * <listitem><para>This virtual function is invoked when the animation of
- * a layout manager ends, and it is meant to be used for bookkeeping the
- * objects created in the <function>begin_animation()</function>
- * function. The default implementation will call it implicitly when the
- * timeline is complete.</para></listitem>
- * </varlistentry>
- * </variablelist>
- * <para>The simplest way to animate a layout is to create a #ClutterTimeline
- * inside the <function>begin_animation()</function> virtual function, along
- * with a #ClutterAlpha, and for each #ClutterTimeline::new-frame signal
- * emission call clutter_layout_manager_layout_changed(), which will cause a
- * relayout. The #ClutterTimeline::completed signal emission should cause
- * clutter_layout_manager_end_animation() to be called. The default
- * implementation provided internally by #ClutterLayoutManager does exactly
- * this, so most sub-classes should either not override any animation-related
- * virtual function or simply override #ClutterLayoutManagerClass.begin_animation()
- * and #ClutterLayoutManagerClass.end_animation() to set up ad hoc state, and then
- * chain up to the parent's implementation.</para>
- * <example id="example-ClutterLayoutManager-animation">
- * <title>Animation of a Layout Manager</title>
- * <para>The code below shows how a #ClutterLayoutManager sub-class should
- * provide animating the allocation of its children from within the
- * #ClutterLayoutManagerClass.allocate() virtual function implementation. The
- * animation is computed between the last stable allocation performed
- * before the animation started and the desired final allocation.</para>
- * <para>The <varname>is_animating</varname> variable is stored inside the
- * #ClutterLayoutManager sub-class and it is updated by overriding the
- * #ClutterLayoutManagerClass.begin_animation() and the
- * #ClutterLayoutManagerClass.end_animation() virtual functions and chaining up
- * to the base class implementation.</para>
- * <para>The last stable allocation is stored within a #ClutterLayoutMeta
- * sub-class used by the implementation.</para>
- * <programlisting>
- * static void
- * my_layout_manager_allocate (ClutterLayoutManager *manager,
- * ClutterContainer *container,
- * const ClutterActorBox *allocation,
- * ClutterAllocationFlags flags)
- * {
- * MyLayoutManager *self = MY_LAYOUT_MANAGER (manager);
- * ClutterActor *child;
- *
- * for (child = clutter_actor_get_first_child (CLUTTER_ACTOR (container));
- * child != NULL;
- * child = clutter_actor_get_next_sibling (child))
- * {
- * ClutterLayoutMeta *meta;
- * MyLayoutMeta *my_meta;
- *
- * /* retrieve the layout meta-object */
- * meta = clutter_layout_manager_get_child_meta (manager,
- * container,
- * child);
- * my_meta = MY_LAYOUT_META (meta);
- *
- * /* compute the desired allocation for the child */
- * compute_allocation (self, my_meta, child,
- * allocation, flags,
- * &child_box);
- *
- * /* this is the additional code that deals with the animation
- * * of the layout manager
- * */
- * if (!self->is_animating)
- * {
- * /* store the last stable allocation for later use */
- * my_meta->last_alloc = clutter_actor_box_copy (&child_box);
- * }
- * else
- * {
- * ClutterActorBox end = { 0, };
- * gdouble p;
- *
- * /* get the progress of the animation */
- * p = clutter_layout_manager_get_animation_progress (manager);
- *
- * if (my_meta->last_alloc != NULL)
- * {
- * /* copy the desired allocation as the final state */
- * end = child_box;
- *
- * /* then interpolate the initial and final state
- * * depending on the progress of the animation,
- * * and put the result inside the box we will use
- * * to allocate the child
- * */
- * clutter_actor_box_interpolate (my_meta->last_alloc,
- * &end,
- * p,
- * &child_box);
- * }
- * else
- * {
- * /* if there is no stable allocation then the child was
- * * added while animating; one possible course of action
- * * is to just bail out and fall through to the allocation
- * * to position the child directly at its final state
- * */
- * my_meta->last_alloc =
- * clutter_actor_box_copy (&child_box);
- * }
- * }
- *
- * /* allocate the child */
- * clutter_actor_allocate (child, &child_box, flags);
- * }
- * }
- * </programlisting>
- * </example>
- * <para>Sub-classes of #ClutterLayoutManager that support animations of the
- * layout changes should call clutter_layout_manager_begin_animation()
- * whenever a layout property changes value, e.g.:</para>
- * <informalexample>
- * <programlisting>
- * if (self->orientation != new_orientation)
- * {
- * ClutterLayoutManager *manager;
- *
- * self->orientation = new_orientation;
- *
- * manager = CLUTTER_LAYOUT_MANAGER (self);
- * clutter_layout_manager_layout_changed (manager);
- * clutter_layout_manager_begin_animation (manager, 500, CLUTTER_LINEAR);
- *
- * g_object_notify (G_OBJECT (self), "orientation");
- * }
- * </programlisting>
- * </informalexample>
- * <para>The code above will animate a change in the
- * <varname>orientation</varname> layout property of a layout manager.</para>
- * </refsect2>
- *
* <refsect2 id="clutter-layout-properties">
* <title>Layout Properties</title>
* <para>If a layout manager has layout properties, that is properties that
@@ -362,7 +195,6 @@ G_DEFINE_ABSTRACT_TYPE (ClutterLayoutManager,
G_TYPE_INITIALLY_UNOWNED);
static GQuark quark_layout_meta = 0;
-static GQuark quark_layout_alpha = 0;
static guint manager_signals[LAST_SIGNAL] = { 0, };
@@ -375,15 +207,15 @@ layout_manager_freeze_layout_change (ClutterLayoutManager *manager)
G_OBJECT_TYPE_NAME (manager),
manager);
- is_frozen = g_object_get_data (G_OBJECT (manager), "freeze-change");
+ is_frozen = g_object_get_data (G_OBJECT (manager), "-clutter-layout-manager-freeze-change");
if (is_frozen == NULL)
- g_object_set_data (G_OBJECT (manager), "freeze-change",
+ g_object_set_data (G_OBJECT (manager), "-clutter-layout-manager-freeze-change",
GUINT_TO_POINTER (1));
else
{
guint level = GPOINTER_TO_UINT (is_frozen) + 1;
- g_object_set_data (G_OBJECT (manager), "freeze-change",
+ g_object_set_data (G_OBJECT (manager), "-clutter-layout-manager-freeze-change",
GUINT_TO_POINTER (level));
}
}
@@ -393,7 +225,7 @@ layout_manager_thaw_layout_change (ClutterLayoutManager *manager)
{
gpointer is_frozen;
- is_frozen = g_object_get_data (G_OBJECT (manager), "freeze-change");
+ is_frozen = g_object_get_data (G_OBJECT (manager), "-clutter-layout-manager-freeze-change");
if (is_frozen == NULL)
g_critical (G_STRLOC ": Mismatched thaw; you have to call "
"clutter_layout_manager_freeze_layout_change() prior to "
@@ -410,9 +242,9 @@ layout_manager_thaw_layout_change (ClutterLayoutManager *manager)
level -= 1;
if (level == 0)
- g_object_set_data (G_OBJECT (manager), "freeze-change", NULL);
+ g_object_set_data (G_OBJECT (manager), "-clutter-layout-manager-freeze-change", NULL);
else
- g_object_set_data (G_OBJECT (manager), "freeze-change",
+ g_object_set_data (G_OBJECT (manager), "-clutter-layout-manager-freeze-change",
GUINT_TO_POINTER (level));
}
@@ -464,7 +296,7 @@ layout_manager_real_set_container (ClutterLayoutManager *manager,
ClutterContainer *container)
{
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);
}
static ClutterLayoutMeta *
@@ -499,101 +331,11 @@ layout_manager_real_get_child_meta_type (ClutterLayoutManager *manager)
return G_TYPE_INVALID;
}
-/* XXX:2.0 - Remove */
-static ClutterAlpha *
-layout_manager_real_begin_animation (ClutterLayoutManager *manager,
- guint duration,
- gulong mode)
-{
- ClutterTimeline *timeline;
- ClutterAlpha *alpha;
-
- alpha = g_object_get_qdata (G_OBJECT (manager), quark_layout_alpha);
- if (alpha != NULL)
- {
- clutter_alpha_set_mode (alpha, mode);
-
- timeline = clutter_alpha_get_timeline (alpha);
- clutter_timeline_set_duration (timeline, duration);
- clutter_timeline_rewind (timeline);
-
- return alpha;
- };
-
- timeline = clutter_timeline_new (duration);
-
- alpha = clutter_alpha_new_full (timeline, mode);
-
- /* let the alpha take ownership of the timeline */
- g_object_unref (timeline);
-
- g_signal_connect_swapped (timeline, "completed",
- G_CALLBACK (clutter_layout_manager_end_animation),
- manager);
- g_signal_connect_swapped (timeline, "new-frame",
- G_CALLBACK (clutter_layout_manager_layout_changed),
- manager);
-
- g_object_set_qdata_full (G_OBJECT (manager),
- quark_layout_alpha, alpha,
- (GDestroyNotify) g_object_unref);
-
- clutter_timeline_start (timeline);
-
- return alpha;
-}
-
-/* XXX:2.0 - Remove */
-static gdouble
-layout_manager_real_get_animation_progress (ClutterLayoutManager *manager)
-{
- ClutterAlpha *alpha;
-
- alpha = g_object_get_qdata (G_OBJECT (manager), quark_layout_alpha);
- if (alpha == NULL)
- return 1.0;
-
- return clutter_alpha_get_alpha (alpha);
-}
-
-/* XXX:2.0 - Remove */
-static void
-layout_manager_real_end_animation (ClutterLayoutManager *manager)
-{
- ClutterTimeline *timeline;
- ClutterAlpha *alpha;
-
- alpha = g_object_get_qdata (G_OBJECT (manager), quark_layout_alpha);
- if (alpha == NULL)
- return;
-
- timeline = clutter_alpha_get_timeline (alpha);
- g_assert (timeline != NULL);
-
- if (clutter_timeline_is_playing (timeline))
- clutter_timeline_stop (timeline);
-
- g_signal_handlers_disconnect_by_func (timeline,
- G_CALLBACK (clutter_layout_manager_end_animation),
- manager);
- g_signal_handlers_disconnect_by_func (timeline,
- G_CALLBACK (clutter_layout_manager_layout_changed),
- manager);
-
- g_object_set_qdata (G_OBJECT (manager), quark_layout_alpha, NULL);
-
- clutter_layout_manager_layout_changed (manager);
-}
-
static void
clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
{
quark_layout_meta =
- g_quark_from_static_string ("clutter-layout-manager-child-meta");
-
- /* XXX:2.0 - Remove */
- quark_layout_alpha =
- g_quark_from_static_string ("clutter-layout-manager-alpha");
+ g_quark_from_static_string ("-clutter-layout-manager-child-meta");
g_type_class_add_private (klass, sizeof (ClutterLayoutManagerPrivate));
@@ -602,11 +344,6 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
klass->allocate = layout_manager_real_allocate;
klass->create_child_meta = layout_manager_real_create_child_meta;
klass->get_child_meta_type = layout_manager_real_get_child_meta_type;
-
- /* XXX:2.0 - Remove */
- klass->begin_animation = layout_manager_real_begin_animation;
- klass->get_animation_progress = layout_manager_real_get_animation_progress;
- klass->end_animation = layout_manager_real_end_animation;
klass->set_container = layout_manager_real_set_container;
/**
@@ -775,7 +512,7 @@ clutter_layout_manager_layout_changed (ClutterLayoutManager *manager)
g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager));
- is_frozen = g_object_get_data (G_OBJECT (manager), "freeze-change");
+ is_frozen = g_object_get_data (G_OBJECT (manager), "-clutter-layout-manager-freeze-change");
if (is_frozen == NULL)
g_signal_emit (manager, manager_signals[LAYOUT_CHANGED], 0);
else
diff --git a/clutter/clutter-layout-manager.h b/clutter/clutter-layout-manager.h
index d19d563..8c40f1d 100644
--- a/clutter/clutter-layout-manager.h
+++ b/clutter/clutter-layout-manager.h
@@ -79,17 +79,6 @@ struct _ClutterLayoutManager
* @create_child_meta: virtual function; override to create a
* #ClutterLayoutMeta instance associated to a #ClutterContainer and a
* child #ClutterActor, used to maintain layout manager specific properties
- * @begin_animation: virtual function; override to control the animation
- * of a #ClutterLayoutManager with the given duration and easing mode.
- * This virtual function is deprecated, and it should not be overridden
- * in newly written code.
- * @end_animation: virtual function; override to end an animation started
- * by clutter_layout_manager_begin_animation(). This virtual function is
- * deprecated, and it should not be overriden in newly written code.
- * @get_animation_progress: virtual function; override to control the
- * progress of the animation of a #ClutterLayoutManager. This virtual
- * function is deprecated, and it should not be overridden in newly written
- * code.
* @layout_changed: class handler for the #ClutterLayoutManager::layout-changed
* signal
*
@@ -127,15 +116,6 @@ struct _ClutterLayoutManagerClass
ClutterContainer *container,
ClutterActor *actor);
- /* deprecated */
- ClutterAlpha * (* begin_animation) (ClutterLayoutManager *manager,
- guint duration,
- gulong mode);
- /* deprecated */
- gdouble (* get_animation_progress) (ClutterLayoutManager *manager);
- /* deprecated */
- void (* end_animation) (ClutterLayoutManager *manager);
-
void (* layout_changed) (ClutterLayoutManager *manager);
/*< private >*/
diff --git a/clutter/clutter-script-parser.c b/clutter/clutter-script-parser.c
index 6eb6b2b..c1d7342 100644
--- a/clutter/clutter-script-parser.c
+++ b/clutter/clutter-script-parser.c
@@ -34,22 +34,16 @@
#include <glib.h>
#include <gmodule.h>
-#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
-#include "deprecated/clutter-container.h"
-#include "deprecated/clutter-alpha.h"
-
#include "clutter-actor.h"
+#include "clutter-container.h"
#include "clutter-debug.h"
#include "clutter-enum-types.h"
-
+#include "clutter-private.h"
#include "clutter-script.h"
#include "clutter-script-private.h"
#include "clutter-scriptable.h"
-
#include "clutter-stage-manager.h"
-#include "clutter-private.h"
-
static void clutter_script_parser_object_end (JsonParser *parser,
JsonObject *object);
static void clutter_script_parser_parse_end (JsonParser *parser);
@@ -707,42 +701,8 @@ parse_signals (ClutterScript *script,
}
}
- /* mandatory: "target-state" or "handler" */
- if (json_object_has_member (object, "target-state"))
- {
- const gchar *state = NULL;
- const gchar *target = NULL;
- gboolean warp_to = FALSE;
-
- target = json_object_get_string_member (object, "target-state");
- if (target == NULL)
- {
- _clutter_script_warn_invalid_value (script,
- "target-state", "string",
- val);
- continue;
- }
-
- if (json_object_has_member (object, "states"))
- state = json_object_get_string_member (object, "states");
-
- if (json_object_has_member (object, "warp"))
- warp_to = json_object_get_boolean_member (object, "warp");
-
- CLUTTER_NOTE (SCRIPT,
- "Added signal '%s' (states:%s, target-state:%s, warp:%s)",
- name,
- state != NULL ? state : "<default>", target,
- warp_to ? "true" : "false");
-
- sinfo = g_slice_new0 (SignalInfo);
- sinfo->is_handler = FALSE;
- sinfo->name = g_strdup (name);
- sinfo->state = g_strdup (state);
- sinfo->target = g_strdup (target);
- sinfo->warp_to = warp_to;
- }
- else if (json_object_has_member (object, "handler"))
+ /* mandatory: "handler" */
+ if (json_object_has_member (object, "handler"))
{
const gchar *handler;
const gchar *connect;
@@ -792,7 +752,7 @@ parse_signals (ClutterScript *script,
else
_clutter_script_warn_missing_attribute (script,
NULL,
- "handler or state");
+ "handler");
if (sinfo != NULL)
retval = g_list_prepend (retval, sinfo);
}
@@ -800,98 +760,10 @@ parse_signals (ClutterScript *script,
return retval;
}
-static ClutterTimeline *
-construct_timeline (ClutterScript *script,
- JsonObject *object)
-{
- ClutterTimeline *retval = NULL;
- ObjectInfo *oinfo;
- GList *members, *l;
-
- /* we fake an ObjectInfo so we can reuse clutter_script_construct_object()
- * here; we do not save it inside the hash table, because if this had
- * been a named object then we wouldn't have ended up here in the first
- * place
- */
- oinfo = g_slice_new0 (ObjectInfo);
- oinfo->gtype = CLUTTER_TYPE_TIMELINE;
- oinfo->id = g_strdup ("dummy");
-
- members = json_object_get_members (object);
- for (l = members; l != NULL; l = l->next)
- {
- const gchar *name = l->data;
- JsonNode *node = json_object_get_member (object, name);
- PropertyInfo *pinfo = g_slice_new0 (PropertyInfo);
-
- pinfo->name = g_strdelimit (g_strdup (name), G_STR_DELIMITERS, '-');
- pinfo->node = json_node_copy (node);
-
- oinfo->properties = g_list_prepend (oinfo->properties, pinfo);
- }
-
- g_list_free (members);
-
- _clutter_script_construct_object (script, oinfo);
- _clutter_script_apply_properties (script, oinfo);
- retval = CLUTTER_TIMELINE (oinfo->object);
-
- /* we transfer ownership to the alpha function, so we ref before
- * destroying the ObjectInfo to avoid the timeline going away
- */
- g_object_ref (retval);
- object_info_free (oinfo);
-
- return retval;
-}
-
-/* define the names of the animation modes to match the ones
- * that developers might be more accustomed to
- */
-static const struct
-{
- const gchar *name;
- ClutterAnimationMode mode;
-} animation_modes[] = {
- { "linear", CLUTTER_LINEAR },
- { "easeInQuad", CLUTTER_EASE_IN_QUAD },
- { "easeOutQuad", CLUTTER_EASE_OUT_QUAD },
- { "easeInOutQuad", CLUTTER_EASE_IN_OUT_QUAD },
- { "easeInCubic", CLUTTER_EASE_IN_CUBIC },
- { "easeOutCubic", CLUTTER_EASE_OUT_CUBIC },
- { "easeInOutCubic", CLUTTER_EASE_IN_OUT_CUBIC },
- { "easeInQuart", CLUTTER_EASE_IN_QUART },
- { "easeOutQuart", CLUTTER_EASE_OUT_QUART },
- { "easeInOutQuart", CLUTTER_EASE_IN_OUT_QUART },
- { "easeInQuint", CLUTTER_EASE_IN_QUINT },
- { "easeOutQuint", CLUTTER_EASE_OUT_QUINT },
- { "easeInOutQuint", CLUTTER_EASE_IN_OUT_QUINT },
- { "easeInSine", CLUTTER_EASE_IN_SINE },
- { "easeOutSine", CLUTTER_EASE_OUT_SINE },
- { "easeInOutSine", CLUTTER_EASE_IN_OUT_SINE },
- { "easeInExpo", CLUTTER_EASE_IN_EXPO },
- { "easeOutExpo", CLUTTER_EASE_OUT_EXPO },
- { "easeInOutExpo", CLUTTER_EASE_IN_OUT_EXPO },
- { "easeInCirc", CLUTTER_EASE_IN_CIRC },
- { "easeOutCirc", CLUTTER_EASE_OUT_CIRC },
- { "easeInOutCirc", CLUTTER_EASE_IN_OUT_CIRC },
- { "easeInElastic", CLUTTER_EASE_IN_ELASTIC },
- { "easeOutElastic", CLUTTER_EASE_OUT_ELASTIC },
- { "easeInOutElastic", CLUTTER_EASE_IN_OUT_ELASTIC },
- { "easeInBack", CLUTTER_EASE_IN_BACK },
- { "easeOutBack", CLUTTER_EASE_OUT_BACK },
- { "easeInOutBack", CLUTTER_EASE_IN_OUT_BACK },
- { "easeInBounce", CLUTTER_EASE_IN_BOUNCE },
- { "easeOutBounce", CLUTTER_EASE_OUT_BOUNCE },
- { "easeInOutBounce", CLUTTER_EASE_IN_OUT_BOUNCE },
-};
-
-static const gint n_animation_modes = G_N_ELEMENTS (animation_modes);
-
gulong
_clutter_script_resolve_animation_mode (JsonNode *node)
{
- gint i, res = CLUTTER_CUSTOM_MODE;
+ gint res = CLUTTER_CUSTOM_MODE;
if (JSON_NODE_TYPE (node) != JSON_NODE_VALUE)
return CLUTTER_CUSTOM_MODE;
@@ -903,18 +775,6 @@ _clutter_script_resolve_animation_mode (JsonNode *node)
{
const gchar *name = json_node_get_string (node);
- /* XXX - we might be able to optimize by changing the ordering
- * of the animation_modes array, e.g.
- * - special casing linear
- * - tokenizing ('ease', 'In', 'Sine') and matching on token
- * - binary searching?
- */
- for (i = 0; i < n_animation_modes; i++)
- {
- if (strcmp (animation_modes[i].name, name) == 0)
- return animation_modes[i].mode;
- }
-
if (_clutter_script_enum_from_string (CLUTTER_TYPE_ANIMATION_MODE,
name,
&res))
@@ -926,106 +786,6 @@ _clutter_script_resolve_animation_mode (JsonNode *node)
return CLUTTER_CUSTOM_MODE;
}
-static ClutterAlphaFunc
-resolve_alpha_func (const gchar *name)
-{
- static GModule *module = NULL;
- ClutterAlphaFunc func;
-
- CLUTTER_NOTE (SCRIPT, "Looking up '%s' alpha function", name);
-
- if (G_UNLIKELY (!module))
- module = g_module_open (NULL, 0);
-
- if (g_module_symbol (module, name, (gpointer) &func))
- {
- CLUTTER_NOTE (SCRIPT, "Found '%s' alpha function in the symbols table",
- name);
- return func;
- }
-
- return NULL;
-}
-
-GObject *
-_clutter_script_parse_alpha (ClutterScript *script,
- JsonNode *node)
-{
- GObject *retval = NULL;
- JsonObject *object;
- ClutterTimeline *timeline = NULL;
- ClutterAlphaFunc alpha_func = NULL;
- ClutterAnimationMode mode = CLUTTER_CUSTOM_MODE;
- JsonNode *val;
- gboolean unref_timeline = FALSE;
-
- if (JSON_NODE_TYPE (node) != JSON_NODE_OBJECT)
- return NULL;
-
- object = json_node_get_object (node);
-
- val = json_object_get_member (object, "timeline");
- if (val)
- {
- if (JSON_NODE_TYPE (val) == JSON_NODE_VALUE &&
- json_node_get_string (val) != NULL)
- {
- const gchar *id_ = json_node_get_string (val);
-
- timeline =
- CLUTTER_TIMELINE (clutter_script_get_object (script, id_));
- }
- else if (JSON_NODE_TYPE (val) == JSON_NODE_OBJECT)
- {
- timeline = construct_timeline (script, json_node_get_object (val));
- unref_timeline = TRUE;
- }
- }
-
- val = json_object_get_member (object, "mode");
- if (val != NULL)
- mode = _clutter_script_resolve_animation_mode (val);
-
- if (mode == CLUTTER_CUSTOM_MODE)
- {
- val = json_object_get_member (object, "function");
- if (val && json_node_get_string (val) != NULL)
- {
- alpha_func = resolve_alpha_func (json_node_get_string (val));
- if (!alpha_func)
- {
- g_warning ("Unable to find the function '%s' in the "
- "Clutter alpha functions or the symbols table",
- json_node_get_string (val));
- }
- }
- }
-
- CLUTTER_NOTE (SCRIPT, "Parsed alpha: %s timeline (%p) (mode:%d, func:%p)",
- unref_timeline ? "implicit" : "explicit",
- timeline ? timeline : 0x0,
- mode != CLUTTER_CUSTOM_MODE ? mode : 0,
- alpha_func ? alpha_func : 0x0);
-
- retval = g_object_new (CLUTTER_TYPE_ALPHA, NULL);
-
- if (mode != CLUTTER_CUSTOM_MODE)
- clutter_alpha_set_mode (CLUTTER_ALPHA (retval), mode);
-
- if (alpha_func != NULL)
- clutter_alpha_set_func (CLUTTER_ALPHA (retval), alpha_func, NULL, NULL);
-
- clutter_alpha_set_timeline (CLUTTER_ALPHA (retval), timeline);
-
- /* if we created an implicit timeline, the Alpha has full ownership
- * of it now, since it won't be accessible from ClutterScript
- */
- if (unref_timeline)
- g_object_unref (timeline);
-
- return retval;
-}
-
static void
clutter_script_parser_object_end (JsonParser *json_parser,
JsonObject *object)
@@ -1787,7 +1547,8 @@ apply_layout_properties (ClutterScript *script,
ClutterLayoutManager *manager;
GType meta_type;
- manager = g_object_get_data (G_OBJECT (container), "clutter-layout-manager");
+ /* XXX:2.0 remove; only ClutterActor should have a layout manager */
+ manager = g_object_get_data (G_OBJECT (container), "-clutter-layout-manager");
if (manager == NULL)
return;
@@ -1984,7 +1745,7 @@ static void
add_children (ClutterScript *script,
ObjectInfo *oinfo)
{
- ClutterContainer *container = CLUTTER_CONTAINER (oinfo->object);
+ ClutterActor *container = CLUTTER_ACTOR (oinfo->object);
GList *l, *unresolved;
unresolved = NULL;
@@ -2023,7 +1784,7 @@ add_children (ClutterScript *script,
name,
g_type_name (G_OBJECT_TYPE (container)));
- clutter_container_add_actor (container, CLUTTER_ACTOR (object));
+ clutter_actor_add_child (container, CLUTTER_ACTOR (object));
}
g_list_foreach (oinfo->children, (GFunc) g_free, NULL);
diff --git a/clutter/clutter-script-private.h b/clutter/clutter-script-private.h
index 52a67bc..b32ded1 100644
--- a/clutter/clutter-script-private.h
+++ b/clutter/clutter-script-private.h
@@ -88,13 +88,10 @@ typedef struct {
gchar *name;
gchar *handler;
gchar *object;
- gchar *state;
- gchar *target;
GConnectFlags flags;
guint is_handler : 1;
- guint warp_to : 1;
} SignalInfo;
void property_info_free (gpointer data);
@@ -128,8 +125,6 @@ gboolean _clutter_script_parse_geometry (ClutterScript *script,
gboolean _clutter_script_parse_color (ClutterScript *script,
JsonNode *node,
ClutterColor *color);
-GObject *_clutter_script_parse_alpha (ClutterScript *script,
- JsonNode *node);
gboolean _clutter_script_parse_point (ClutterScript *script,
JsonNode *node,
ClutterPoint *point);
diff --git a/clutter/clutter-script.c b/clutter/clutter-script.c
index 6d0b607..f341310 100644
--- a/clutter/clutter-script.c
+++ b/clutter/clutter-script.c
@@ -75,66 +75,6 @@
* packing rules of Clutter still apply, and an actor cannot be packed
* in multiple containers without unparenting it in between).
*
- * Behaviours and timelines can also be defined inside a UI definition
- * buffer:
- *
- * <informalexample><programlisting><![CDATA[
- * {
- * "id" : "rotate-behaviour",
- * "type" : "ClutterBehaviourRotate",
- * "angle-start" : 0.0,
- * "angle-end" : 360.0,
- * "axis" : "z-axis",
- * "alpha" : {
- * "timeline" : { "duration" : 4000, "loop" : true },
- * "mode" : "easeInSine"
- * }
- * }
- * ]]></programlisting></informalexample>
- *
- * And then to apply a defined behaviour to an actor defined inside the
- * definition of an actor, the "behaviour" member can be used:
- *
- * <informalexample><programlisting><![CDATA[
- * {
- * "id" : "my-rotating-actor",
- * "type" : "ClutterTexture",
- * ...
- * "behaviours" : [ "rotate-behaviour" ]
- * }
- * ]]></programlisting></informalexample>
- *
- * A #ClutterAlpha belonging to a #ClutterBehaviour can only be defined
- * implicitly like in the example above, or explicitly by setting the
- * "alpha" property to point to a previously defined #ClutterAlpha, e.g.:
- *
- * <informalexample><programlisting><![CDATA[
- * {
- * "id" : "rotate-behaviour",
- * "type" : "ClutterBehaviourRotate",
- * "angle-start" : 0.0,
- * "angle-end" : 360.0,
- * "axis" : "z-axis",
- * "alpha" : {
- * "id" : "rotate-alpha",
- * "type" : "ClutterAlpha",
- * "timeline" : {
- * "id" : "rotate-timeline",
- * "type : "ClutterTimeline",
- * "duration" : 4000,
- * "loop" : true
- * },
- * "function" : "custom_sine_alpha"
- * }
- * }
- * ]]></programlisting></informalexample>
- *
- * Implicitely defined #ClutterAlpha<!-- -->s and #ClutterTimeline<!-- -->s
- * can omit the <varname>id</varname> member, as well as the
- * <varname>type</varname> member, but will not be available using
- * clutter_script_get_object() (they can, however, be extracted using the
- * #ClutterBehaviour and #ClutterAlpha API respectively).
- *
* Signal handlers can be defined inside a Clutter UI definition file and
* then autoconnected to their respective signals using the
* clutter_script_connect_signals() function:
@@ -158,49 +98,6 @@
* respectively) and the "object" string member for calling
* g_signal_connect_object() instead of g_signal_connect().
*
- * Signals can also be directly attached to a specific state defined
- * inside a #ClutterState instance, for instance:
- *
- * |[
- * ...
- * "signals" : [
- * {
- * "name" : "enter-event",
- * "states" : "button-states",
- * "target-state" : "hover"
- * },
- * {
- * "name" : "leave-event",
- * "states" : "button-states",
- * "target-state" : "base"
- * },
- * {
- * "name" : "button-press-event",
- * "states" : "button-states",
- * "target-state" : "active",
- * },
- * {
- * "name" : "key-press-event",
- * "states" : "button-states",
- * "target-state" : "key-focus",
- * "warp" : true
- * }
- * ],
- * ...
- * ]|
- *
- * The "states" key defines the #ClutterState instance to be used to
- * resolve the "target-state" key; it can be either a script id for a
- * #ClutterState built by the same #ClutterScript instance, or to a
- * #ClutterState built in code and associated to the #ClutterScript
- * instance through the clutter_script_add_states() function. If no
- * "states" key is present, then the default #ClutterState associated to
- * the #ClutterScript instance will be used; the default #ClutterState
- * can be set using clutter_script_add_states() using a %NULL name. The
- * "warp" key can be used to warp to a specific state instead of
- * animating to it. State changes on signal emission will not affect
- * the signal emission chain.
- *
* Clutter reserves the following names, so classes defining properties
* through the usual GObject registration process should avoid using these
* names to avoid collisions:
@@ -248,11 +145,6 @@
#include "clutter-private.h"
#include "clutter-debug.h"
-#include "deprecated/clutter-alpha.h"
-#include "deprecated/clutter-behaviour.h"
-#include "deprecated/clutter-container.h"
-#include "deprecated/clutter-state.h"
-
enum
{
PROP_0,
@@ -277,8 +169,6 @@ struct _ClutterScriptPrivate
ClutterScriptParser *parser;
- GHashTable *states;
-
gchar **search_paths;
gchar *translation_domain;
@@ -331,8 +221,6 @@ signal_info_free (gpointer data)
g_free (sinfo->name);
g_free (sinfo->handler);
g_free (sinfo->object);
- g_free (sinfo->state);
- g_free (sinfo->target);
g_slice_free (SignalInfo, sinfo);
}
@@ -389,7 +277,6 @@ clutter_script_finalize (GObject *gobject)
g_hash_table_destroy (priv->objects);
g_strfreev (priv->search_paths);
g_free (priv->filename);
- g_hash_table_destroy (priv->states);
g_free (priv->translation_domain);
G_OBJECT_CLASS (clutter_script_parent_class)->finalize (gobject);
@@ -526,9 +413,6 @@ clutter_script_init (ClutterScript *script)
priv->objects = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL,
object_info_free);
- priv->states = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free,
- (GDestroyNotify) g_object_unref);
}
/**
@@ -1049,65 +933,12 @@ clutter_script_connect_signals (ClutterScript *script,
}
typedef struct {
- ClutterState *state;
- GObject *emitter;
- gchar *target;
- gulong signal_id;
- gulong hook_id;
- gboolean warp_to;
-} HookData;
-
-typedef struct {
ClutterScript *script;
ClutterScriptConnectFunc func;
gpointer user_data;
} SignalConnectData;
static void
-hook_data_free (gpointer data)
-{
- if (G_LIKELY (data != NULL))
- {
- HookData *hook_data = data;
-
- g_free (hook_data->target);
- g_slice_free (HookData, hook_data);
- }
-}
-
-static gboolean
-clutter_script_state_change_hook (GSignalInvocationHint *ihint,
- guint n_params,
- const GValue *params,
- gpointer user_data)
-{
- HookData *hook_data = user_data;
- GObject *emitter;
-
- emitter = g_value_get_object (¶ms[0]);
-
- if (emitter == hook_data->emitter)
- {
- if (hook_data->warp_to)
- clutter_state_warp_to_state (hook_data->state, hook_data->target);
- else
- clutter_state_set_state (hook_data->state, hook_data->target);
- }
-
- return TRUE;
-}
-
-static void
-clutter_script_remove_state_change_hook (gpointer user_data,
- GObject *object_p)
-{
- HookData *hook_data = user_data;
-
- g_signal_remove_emission_hook (hook_data->signal_id,
- hook_data->hook_id);
-}
-
-static void
connect_each_object (gpointer key,
gpointer value,
gpointer data)
@@ -1144,67 +975,6 @@ connect_each_object (gpointer key,
connect_data->user_data);
}
}
- else
- {
- GObject *state_object = NULL;
- const gchar *signal_name, *signal_detail;
- gchar **components;
- GQuark signal_quark;
- guint signal_id;
- HookData *hook_data;
-
- if (sinfo->state == NULL)
- state_object = (GObject *) clutter_script_get_states (script, NULL);
- else
- {
- state_object = clutter_script_get_object (script, sinfo->state);
- if (state_object == NULL)
- state_object = (GObject *) clutter_script_get_states (script, sinfo->state);
- }
-
- if (state_object == NULL)
- continue;
-
- components = g_strsplit (sinfo->name, "::", 2);
- if (g_strv_length (components) == 2)
- {
- signal_name = components[0];
- signal_detail = components[1];
- }
- else
- {
- signal_name = components[0];
- signal_detail = NULL;
- }
-
- signal_id = g_signal_lookup (signal_name, G_OBJECT_TYPE (object));
- if (signal_id == 0)
- {
- g_strfreev (components);
- continue;
- }
-
- if (signal_detail != NULL)
- signal_quark = g_quark_from_string (signal_detail);
- else
- signal_quark = 0;
-
- hook_data = g_slice_new (HookData);
- hook_data->emitter = object;
- hook_data->state = CLUTTER_STATE (state_object);
- hook_data->target = g_strdup (sinfo->target);
- hook_data->warp_to = sinfo->warp_to;
- hook_data->signal_id = signal_id;
- hook_data->hook_id =
- g_signal_add_emission_hook (signal_id, signal_quark,
- clutter_script_state_change_hook,
- hook_data,
- hook_data_free);
-
- g_object_weak_ref (hook_data->emitter,
- clutter_script_remove_state_change_hook,
- hook_data);
- }
signal_info_free (sinfo);
}
@@ -1429,72 +1199,6 @@ clutter_script_list_objects (ClutterScript *script)
}
/**
- * clutter_script_add_states:
- * @script: a #ClutterScript
- * @name: (allow-none): a name for the @state, or %NULL to
- * set the default #ClutterState
- * @state: a #ClutterState
- *
- * Associates a #ClutterState to the #ClutterScript instance using the given
- * name.
- *
- * The #ClutterScript instance will use @state to resolve target states when
- * connecting signal handlers.
- *
- * The #ClutterScript instance will take a reference on the #ClutterState
- * passed to this function.
- *
- * Since: 1.8
- *
- * Deprecated: 1.12
- */
-void
-clutter_script_add_states (ClutterScript *script,
- const gchar *name,
- ClutterState *state)
-{
- g_return_if_fail (CLUTTER_IS_SCRIPT (script));
- g_return_if_fail (CLUTTER_IS_STATE (state));
-
- if (name == NULL || *name == '\0')
- name = "__clutter_script_default_state";
-
- g_hash_table_replace (script->priv->states,
- g_strdup (name),
- g_object_ref (state));
-}
-
-/**
- * clutter_script_get_states:
- * @script: a #ClutterScript
- * @name: (allow-none): the name of the #ClutterState, or %NULL
- *
- * Retrieves the #ClutterState for the given @state_name.
- *
- * If @name is %NULL, this function will return the default
- * #ClutterState instance.
- *
- * Return value: (transfer none): a pointer to the #ClutterState for the
- * given name. The #ClutterState is owned by the #ClutterScript instance
- * and it should not be unreferenced
- *
- * Since: 1.8
- *
- * Deprecated: 1.12
- */
-ClutterState *
-clutter_script_get_states (ClutterScript *script,
- const gchar *name)
-{
- g_return_val_if_fail (CLUTTER_IS_SCRIPT (script), NULL);
-
- if (name == NULL || *name == '\0')
- name = "__clutter_script_default_state";
-
- return g_hash_table_lookup (script->priv->states, name);
-}
-
-/**
* clutter_script_set_translation_domain:
* @script: a #ClutterScript
* @domain: (allow-none): the translation domain, or %NULL
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index d237fa9..c35e7b1 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -80,7 +80,7 @@
static void clutter_container_iface_init (ClutterContainerIface *iface);
-G_DEFINE_TYPE_WITH_CODE (ClutterStage, clutter_stage, CLUTTER_TYPE_GROUP,
+G_DEFINE_TYPE_WITH_CODE (ClutterStage, clutter_stage, CLUTTER_TYPE_ACTOR,
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
clutter_container_iface_init))
@@ -2215,6 +2215,8 @@ clutter_stage_init (ClutterStage *self)
ClutterBackend *backend;
GError *error;
+ CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_VISIBLE);
+
/* a stage is a top-level object */
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IS_TOPLEVEL);
diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h
index e3c1d7e..9669a2f 100644
--- a/clutter/clutter-stage.h
+++ b/clutter/clutter-stage.h
@@ -55,7 +55,7 @@ typedef struct _ClutterStagePrivate ClutterStagePrivate;
struct _ClutterStage
{
/*< private >*/
- ClutterGroup parent_instance;
+ ClutterActor parent_instance;
ClutterStagePrivate *priv;
};
@@ -75,7 +75,7 @@ struct _ClutterStage
struct _ClutterStageClass
{
/*< private >*/
- ClutterGroupClass parent_class;
+ ClutterActorClass parent_class;
/*< public >*/
/* signals */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]