1
0
Fork 0
mutter-performance-source/clutter/tests/interactive/test-animation.c

127 lines
3.6 KiB
C
Raw Normal View History

2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
#include <stdlib.h>
#include <gmodule.h>
#include <clutter/clutter.h>
static gboolean is_expanded = FALSE;
static void
on_rect_transitions_completed (ClutterActor *actor)
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
{
is_expanded = !is_expanded;
g_print ("Animation complete\n");
clutter_actor_set_reactive (actor, TRUE);
}
static void
on_clicked (ClutterClickAction *action,
ClutterActor *actor,
gpointer dummy G_GNUC_UNUSED)
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
{
ClutterAnimation *animation;
Remove Units from the public API With the recent change to internal floating point values, ClutterUnit has become a redundant type, defined to be a float. All integer entry points are being internally converted to floating point values to be passed to the GL pipeline with the least amount of conversion. ClutterUnit is thus exposed as just a "pixel with fractionary bits", and not -- as users might think -- as generic, resolution and device independent units. not that it was the case, but a definitive amount of people was convinced it did provide this "feature", and was flummoxed about the mere existence of this type. So, having ClutterUnit exposed in the public API doubles the entry points and has the following disadvantages: - we have to maintain twice the amount of entry points in ClutterActor - we still do an integer-to-float implicit conversion - we introduce a weird impedance between pixels and "pixels with fractionary bits" - language bindings will have to choose what to bind, and resort to manually overriding the API + *except* for language bindings based on GObject-Introspection, as they cannot do manual overrides, thus will replicate the entire set of entry points For these reason, we should coalesces every Actor entry point for pixels and for ClutterUnit into a single entry point taking a float, like: void clutter_actor_set_x (ClutterActor *self, gfloat x); void clutter_actor_get_size (ClutterActor *self, gfloat *width, gfloat *height); gfloat clutter_actor_get_height (ClutterActor *self); etc. The issues I have identified are: - we'll have a two cases of compiler warnings: - printf() format of the return values from %d to %f - clutter_actor_get_size() taking floats instead of unsigned ints - we'll have a problem with varargs when passing an integer instead of a floating point value, except on 64bit platforms where the size of a float is the same as the size of an int To be clear: the *intent* of the API should not change -- we still use pixels everywhere -- but: - we remove ambiguity in the API with regard to pixels and units - we remove entry points we get to maintain for the whole 1.0 version of the API - we make things simpler to bind for both manual language bindings and automatic (gobject-introspection based) ones - we have the simplest API possible while still exposing the capabilities of the underlying GL implementation
2009-05-06 15:44:47 +00:00
gfloat old_x, old_y, new_x, new_y;
gfloat old_width, old_height, new_width, new_height;
gdouble new_angle;
const ClutterColor *new_color;
guint8 new_opacity;
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
clutter_actor_get_position (actor, &old_x, &old_y);
clutter_actor_get_size (actor, &old_width, &old_height);
/* determine the final state of the animation depending on
* the state of the actor
*/
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
if (!is_expanded)
{
new_x = old_x - 100;
new_y = old_y - 100;
new_width = old_width + 200;
new_height = old_height + 200;
new_angle = 360.0;
new_color = CLUTTER_COLOR_DarkScarletRed;
new_opacity = 255;
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
}
else
{
new_x = old_x + 100;
new_y = old_y + 100;
new_width = old_width - 200;
new_height = old_height - 200;
new_angle = 0.0;
new_color = CLUTTER_COLOR_LightOrange;
new_opacity = 128;
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
}
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_mode (actor, CLUTTER_EASE_IN_EXPO);
clutter_actor_set_easing_duration (actor, 2000);
clutter_actor_set_position (actor, new_x, new_y);
clutter_actor_set_size (actor, new_width, new_height);
clutter_actor_set_background_color (actor, new_color);
clutter_actor_set_rotation_angle (actor, CLUTTER_Z_AXIS, new_angle);
clutter_actor_set_reactive (actor, FALSE);
/* animate the opacity halfway through, with a different pacing */
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
clutter_actor_set_easing_delay (actor, 1000);
clutter_actor_set_easing_duration (actor, 1000);
clutter_actor_set_opacity (actor, new_opacity);
clutter_actor_restore_easing_state (actor);
clutter_actor_restore_easing_state (actor);
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
}
G_MODULE_EXPORT int
test_animation_main (int argc, char *argv[])
{
ClutterActor *stage, *rect;
ClutterColor rect_color = { 0x44, 0xdd, 0x44, 0xff };
ClutterAction *action;
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
stage = clutter_stage_new ();
clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue);
clutter_stage_set_title (CLUTTER_STAGE (stage), "Animation");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
rect = clutter_actor_new ();
clutter_actor_set_background_color (rect, CLUTTER_COLOR_LightOrange);
clutter_actor_add_child (stage, rect);
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
clutter_actor_set_size (rect, 50, 50);
clutter_actor_set_pivot_point (rect, .5f, .5f);
clutter_actor_set_translation (rect, -25, -25, 0);
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
clutter_actor_set_position (rect,
clutter_actor_get_width (stage) / 2,
clutter_actor_get_height (stage) / 2);
clutter_actor_set_opacity (rect, 128);
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
clutter_actor_set_reactive (rect, TRUE);
g_signal_connect (rect, "transitions-completed",
G_CALLBACK (on_rect_transitions_completed),
NULL);
action = clutter_click_action_new ();
g_signal_connect (action, "clicked", G_CALLBACK (on_clicked), NULL);
clutter_actor_add_action_with_name (rect, "click", action);
2008-11-17 Emmanuele Bassi <ebassi@linux.intel.com> Bug 1014 - Clutter Animation API Improvements * clutter/Makefile.am: * clutter/clutter.h: Update the build * clutter/clutter-types.h: Add AnimationMode, an enumeration for easing functions. * clutter/clutter-alpha.[ch]: Add the :mode property to control the function bound to an Alpha instance using an enumeration value. Also add six new alpha functions: - ease-in, ease-out, ease-in-out - sine-in, sine-out, sine-in-out * clutter/clutter-deprecated.h: Deprecate the #defines for the alpha functions. They will be replaced by entries in the ClutterAnimationMode. * clutter/clutter-interval.[ch]: Add ClutterInterval, an object for defining, validating and computing an interval between two values. * clutter/clutter-animation.[ch]: Add ClutterAnimation, an object responsible for animation the properties of a single actor along an interval of values. ClutterAnimation memory management is automatic. A simple wrapper method for ClutterActor is provided: clutter_actor_animate() which will create, or update, an animation for the passed actor. * clutter/clutter-debug.h: * clutter/clutter-main.c: Add a new 'animation' debug note. * clutter/clutter-script.c: Clean up the alpha functions whitelist, and add the new functions. * doc/reference/clutter/Makefile.am: * doc/reference/clutter/clutter-sections.txt: Update the API reference. * doc/reference/clutter/clutter-animation.xml: Renamed to doc/reference/clutter/clutter-animation-tutorial.xml to avoid clashes with the ClutterAnimation section. * doc/reference/clutter/clutter-docs.sgml: Renamed to doc/reference/clutter/clutter-docs.xml, as it was an XML file and not a SGML file. * tests/Makefile.am: * tests/interactive/Makefile.am: * tests/interactive/test-animation.c: * tests/interactive/test-easing.c: Add two tests for the new simple animation API and the easing functions. * tests/interactive/test-actors.c: * tests/interactive/test-behave.c: * tests/interactive/test-depth.c: * tests/interactive/test-effects.c: * tests/interactive/test-layout.c: * tests/interactive/test-multistage.c: * tests/interactive/test-paint-wrapper.c: * tests/interactive/test-rotate.c: * tests/interactive/test-scale.c: * tests/interactive/test-texture-quality.c: * tests/interactive/test-threads.c: * tests/interactive/test-viewport.c: Update interactive tests to the deprecations and new alpha API.
2008-11-18 09:50:03 +00:00
clutter_actor_show (stage);
clutter_main ();
return EXIT_SUCCESS;
}
G_MODULE_EXPORT const char *
test_animation_describe (void)
{
return "Simple animation demo";
}