[mutter] clutter: Remove behaviours
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter: Remove behaviours
- Date: Tue, 22 Oct 2019 19:10:02 +0000 (UTC)
commit a60457c2d8733cbcccfef69c7493a6f6e853cce1
Author: Adam Jackson <ajax redhat com>
Date: Tue Oct 22 12:20:31 2019 -0400
clutter: Remove behaviours
https://gitlab.gnome.org/GNOME/mutter/merge_requests/879
clutter/clutter/clutter-actor.c | 73 ---
clutter/clutter/clutter-deprecated.h | 1 -
clutter/clutter/clutter-path.c | 9 +-
clutter/clutter/clutter-script.c | 74 +--
clutter/clutter/clutter-stage.c | 2 -
clutter/clutter/clutter-types.h | 1 -
clutter/clutter/deprecated/clutter-alpha.c | 14 +-
clutter/clutter/deprecated/clutter-animation.c | 7 -
clutter/clutter/deprecated/clutter-behaviour.c | 657 -------------------------
clutter/clutter/deprecated/clutter-behaviour.h | 170 -------
clutter/clutter/meson.build | 2 -
src/tests/clutter/interactive/test-script.json | 6 +-
12 files changed, 10 insertions(+), 1006 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 101f4bf0f..ac2e54afd 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -656,7 +656,6 @@
#include "clutter-units.h"
#include "deprecated/clutter-actor.h"
-#include "deprecated/clutter-behaviour.h"
#include "deprecated/clutter-container.h"
/* Internal enum used to control mapped state update. This is a hint
@@ -14716,40 +14715,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)
@@ -14865,24 +14830,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)
@@ -14953,26 +14900,6 @@ clutter_actor_set_custom_property (ClutterScriptable *scriptable,
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)
diff --git a/clutter/clutter/clutter-deprecated.h b/clutter/clutter/clutter-deprecated.h
index f13d0cf28..96ea52db8 100644
--- a/clutter/clutter/clutter-deprecated.h
+++ b/clutter/clutter/clutter-deprecated.h
@@ -7,7 +7,6 @@
#include "deprecated/clutter-alpha.h"
#include "deprecated/clutter-animatable.h"
#include "deprecated/clutter-animation.h"
-#include "deprecated/clutter-behaviour.h"
#include "deprecated/clutter-bin-layout.h"
#include "deprecated/clutter-box.h"
#include "deprecated/clutter-cairo-texture.h"
diff --git a/clutter/clutter/clutter-path.c b/clutter/clutter/clutter-path.c
index d80ddbeb6..facb7b07a 100644
--- a/clutter/clutter/clutter-path.c
+++ b/clutter/clutter/clutter-path.c
@@ -27,8 +27,7 @@
* and bezier curves.
*
* A #ClutterPath contains a description of a path consisting of
- * straight lines and bezier curves. This can be used in a
- * #ClutterBehaviourPath to animate an actor moving along the path.
+ * straight lines and bezier curves.
*
* The path consists of a series of nodes. Each node is one of the
* following four types:
@@ -244,9 +243,6 @@ clutter_path_finalize (GObject *object)
*
* Creates a new #ClutterPath instance with no nodes.
*
- * The object has a floating reference so if you add it to a
- * #ClutterBehaviourPath then you do not need to unref it.
- *
* Return value: the newly created #ClutterPath
*
* Since: 1.0
@@ -267,9 +263,6 @@ clutter_path_new (void)
* @desc. See clutter_path_add_string() for details of the format of
* the string.
*
- * The object has a floating reference so if you add it to a
- * #ClutterBehaviourPath then you do not need to unref it.
- *
* Return value: the newly created #ClutterPath
*
* Since: 1.0
diff --git a/clutter/clutter/clutter-script.c b/clutter/clutter/clutter-script.c
index 5914545d6..d8305d0c0 100644
--- a/clutter/clutter/clutter-script.c
+++ b/clutter/clutter/clutter-script.c
@@ -75,65 +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 `id`, as well as the `type` members, 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:
@@ -210,7 +151,6 @@
* function
* "type_func" := the GType function name, for non-standard classes
* "children" := an array of names or objects to add as children
- * "behaviours" := an array of names or objects to apply to an actor
* "signals" := an array of signal definitions to connect to an object
* "is-default" := a boolean flag used when defining the #ClutterStage;
* if set to "true" the default stage will be used instead
@@ -246,7 +186,6 @@
#include "clutter-debug.h"
#include "deprecated/clutter-alpha.h"
-#include "deprecated/clutter-behaviour.h"
#include "deprecated/clutter-container.h"
#include "deprecated/clutter-state.h"
@@ -524,11 +463,10 @@ clutter_script_init (ClutterScript *script)
/**
* clutter_script_new:
*
- * Creates a new #ClutterScript instance. #ClutterScript can be used
- * to load objects definitions for scenegraph elements, like actors,
- * or behavioural elements, like behaviours and timelines. The
- * definitions must be encoded using the JavaScript Object Notation (JSON)
- * language.
+ * Creates a new #ClutterScript instance. #ClutterScript can be used to load
+ * objects definitions for scenegraph elements, like actors, or behavioural
+ * elements, like timelines. The definitions must be encoded using the
+ * JavaScript Object Notation (JSON) language.
*
* Return value: the newly created #ClutterScript instance. Use
* g_object_unref() when done.
@@ -863,9 +801,7 @@ construct_each_objects (gpointer key,
if (oinfo->object == NULL)
_clutter_script_construct_object (script, oinfo);
- /* this will take care of setting up properties,
- * adding children and applying behaviours
- */
+ /* this will take care of setting up properties and adding children */
_clutter_script_apply_properties (script, oinfo);
}
}
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 94a005772..bf260e1ca 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -86,8 +86,6 @@
* fully opaque actors covering the whole visible area of the stage,
* i.e. when no blending with the stage color happens over the whole
* stage viewport
- *
- * A series of hints that enable or disable behaviours on the stage
*/
typedef enum /*< prefix=CLUTTER_STAGE >*/
{
diff --git a/clutter/clutter/clutter-types.h b/clutter/clutter/clutter-types.h
index d047b05d1..05c51b603 100644
--- a/clutter/clutter/clutter-types.h
+++ b/clutter/clutter/clutter-types.h
@@ -104,7 +104,6 @@ typedef union _ClutterEvent ClutterEvent;
*/
typedef struct _ClutterEventSequence ClutterEventSequence;
-typedef struct _ClutterBehaviour ClutterBehaviour; /* deprecated */
typedef struct _ClutterShader ClutterShader; /* deprecated */
/**
diff --git a/clutter/clutter/deprecated/clutter-alpha.c b/clutter/clutter/deprecated/clutter-alpha.c
index 8eabc9588..4a2374969 100644
--- a/clutter/clutter/deprecated/clutter-alpha.c
+++ b/clutter/clutter/deprecated/clutter-alpha.c
@@ -39,9 +39,7 @@
* be available any more in the next major version of Clutter.
*
* A #ClutterAlpha binds a #ClutterTimeline to a progress function which
- * translates the time T into an adimensional factor alpha. The factor can
- * then be used to drive a #ClutterBehaviour, which will translate the
- * alpha value into something meaningful for a #ClutterActor.
+ * translates the time T into an adimensional factor alpha.
*
* You should provide a #ClutterTimeline and bind it to the #ClutterAlpha
* instance using clutter_alpha_set_timeline(). You should also set an
@@ -59,9 +57,6 @@
* pause, stop or resume the #ClutterAlpha from calling the alpha function by
* using the appropriate functions of the #ClutterTimeline object.
*
- * #ClutterAlpha is used to "drive" a #ClutterBehaviour instance, and it
- * is internally used by the #ClutterAnimation API.
- *
* #ClutterAlpha is available since Clutter 0.2.
*
* #ClutterAlpha is deprecated since Clutter 1.12. #ClutterTimeline and
@@ -78,9 +73,7 @@
*
* The following JSON fragment defines a #ClutterAlpha
* using a #ClutterTimeline with id "sine-timeline" and an alpha
- * function called `my_sine_alpha`. The defined #ClutterAlpha
- * instance can be reused in multiple #ClutterBehaviour
- * definitions or for #ClutterAnimation definitions.
+ * function called `my_sine_alpha`.
*
* |[
* {
@@ -645,9 +638,6 @@ clutter_alpha_get_timeline (ClutterAlpha *alpha)
* bind a #ClutterTimeline object to the #ClutterAlpha instance
* using clutter_alpha_set_timeline().
*
- * You should use the newly created #ClutterAlpha instance inside
- * a #ClutterBehaviour object.
- *
* Return value: the newly created empty #ClutterAlpha instance.
*
* Since: 0.2
diff --git a/clutter/clutter/deprecated/clutter-animation.c b/clutter/clutter/deprecated/clutter-animation.c
index bb8c8a7a3..e182d984c 100644
--- a/clutter/clutter/deprecated/clutter-animation.c
+++ b/clutter/clutter/deprecated/clutter-animation.c
@@ -57,13 +57,6 @@
* #ClutterAnimatable interface it is possible for that instance to
* control the way the initial and final states are interpolated.
*
- * #ClutterAnimations are distinguished from #ClutterBehaviours
- * because the former can only control #GObject properties of a single
- * #GObject instance, while the latter can control multiple properties
- * using accessor functions inside the #ClutterBehaviour
- * `alpha_notify` virtual function, and can control multiple #ClutterActors
- * as well.
- *
* For convenience, it is possible to use the clutter_actor_animate()
* function call which will take care of setting up and tearing down
* a #ClutterAnimation instance and animate an actor between its current
diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build
index 08a3b6082..8a1f3b2bc 100644
--- a/clutter/clutter/meson.build
+++ b/clutter/clutter/meson.build
@@ -222,7 +222,6 @@ clutter_deprecated_headers = [
'deprecated/clutter-alpha.h',
'deprecated/clutter-animatable.h',
'deprecated/clutter-animation.h',
- 'deprecated/clutter-behaviour.h',
'deprecated/clutter-bin-layout.h',
'deprecated/clutter-box.h',
'deprecated/clutter-cairo-texture.h',
@@ -241,7 +240,6 @@ clutter_deprecated_headers = [
clutter_deprecated_sources = [
'deprecated/clutter-alpha.c',
'deprecated/clutter-animation.c',
- 'deprecated/clutter-behaviour.c',
'deprecated/clutter-box.c',
'deprecated/clutter-cairo-texture.c',
'deprecated/clutter-group.c',
diff --git a/src/tests/clutter/interactive/test-script.json b/src/tests/clutter/interactive/test-script.json
index 54d4fb457..2132c72d8 100644
--- a/src/tests/clutter/interactive/test-script.json
+++ b/src/tests/clutter/interactive/test-script.json
@@ -17,8 +17,7 @@
"reactive" : true,
"rotation" : [
{ "z-axis" : [ 45.0, [ 75, 75 ] ] }
- ],
- "behaviours" : [ "fade-behaviour", "path-behaviour" ]
+ ]
},
{
"id" : "green-button",
@@ -43,8 +42,7 @@
"keep-aspect-ratio" : true,
"anchor-x" : "5 em",
"anchor-y" : "5 pt",
- "opacity" : 100,
- "behaviours" : [ "rotate-behaviour", "fade-behaviour" ]
+ "opacity" : 100
},
{
"id" : "red-hand-clone",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]