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>
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* all the easing modes provided by Clutter */
|
|
|
|
static const struct {
|
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
|
|
|
const gchar *name;
|
|
|
|
ClutterAnimationMode mode;
|
|
|
|
} easing_modes[] = {
|
|
|
|
{ "linear", CLUTTER_LINEAR },
|
2009-01-20 17:57:30 +00:00
|
|
|
{ "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 },
|
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
|
|
|
};
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
#define HELP_TEXT "Easing mode: %s (%d of %d)\n" \
|
|
|
|
"Left click to tween\n" \
|
|
|
|
"Right click to change the easing mode"
|
|
|
|
|
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
|
|
|
static const gint n_easing_modes = G_N_ELEMENTS (easing_modes);
|
|
|
|
static gint current_mode = 0;
|
|
|
|
|
2009-06-15 09:53:43 +00:00
|
|
|
static gint duration = 1;
|
|
|
|
static gboolean recenter = FALSE;
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
static ClutterActor *main_stage = 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
|
|
|
static ClutterActor *easing_mode_label = NULL;
|
|
|
|
|
2010-01-22 21:44:28 +00:00
|
|
|
static ClutterAnimation *last_animation = NULL;
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* recenter_bouncer:
|
|
|
|
*
|
|
|
|
* repositions (through an animation) the bouncer at the center of the stage
|
|
|
|
*/
|
2009-06-15 09:53:43 +00:00
|
|
|
static void
|
2011-09-05 14:26:27 +00:00
|
|
|
recenter_bouncer (ClutterAnimation *animation,
|
|
|
|
ClutterActor *rectangle)
|
2009-06-15 09:53:43 +00:00
|
|
|
{
|
|
|
|
gfloat base_x, base_y;
|
|
|
|
gint cur_mode;
|
|
|
|
|
|
|
|
base_x = clutter_actor_get_width (main_stage) / 2;
|
|
|
|
base_y = clutter_actor_get_height (main_stage) / 2;
|
|
|
|
|
|
|
|
cur_mode = easing_modes[current_mode].mode;
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
clutter_actor_animate (rectangle, cur_mode, 250,
|
2009-06-15 09:53:43 +00:00
|
|
|
"x", base_x,
|
|
|
|
"y", base_y,
|
|
|
|
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
|
|
|
static gboolean
|
|
|
|
on_button_press (ClutterActor *actor,
|
|
|
|
ClutterButtonEvent *event,
|
|
|
|
ClutterActor *rectangle)
|
|
|
|
{
|
2012-01-27 09:47:25 +00:00
|
|
|
if (event->button == CLUTTER_BUTTON_SECONDARY)
|
2009-01-20 17:57:30 +00:00
|
|
|
{
|
|
|
|
gchar *text;
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* cycle through the various easing modes */
|
|
|
|
current_mode = (current_mode + 1 < n_easing_modes)
|
|
|
|
? current_mode + 1
|
|
|
|
: 0;
|
2009-01-20 17:57:30 +00:00
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* update the text of the label */
|
|
|
|
text = g_strdup_printf (HELP_TEXT,
|
2009-01-20 17:57:30 +00:00
|
|
|
easing_modes[current_mode].name,
|
|
|
|
current_mode + 1,
|
|
|
|
n_easing_modes);
|
|
|
|
|
|
|
|
clutter_text_set_text (CLUTTER_TEXT (easing_mode_label), text);
|
|
|
|
g_free (text);
|
|
|
|
}
|
2012-01-27 09:47:25 +00:00
|
|
|
else if (event->button == CLUTTER_BUTTON_PRIMARY)
|
2009-01-20 17:57:30 +00:00
|
|
|
{
|
|
|
|
ClutterAnimation *animation;
|
|
|
|
ClutterAnimationMode cur_mode;
|
|
|
|
|
|
|
|
cur_mode = easing_modes[current_mode].mode;
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* tween the actor using the current easing mode */
|
2009-01-20 17:57:30 +00:00
|
|
|
animation =
|
2009-06-15 09:53:43 +00:00
|
|
|
clutter_actor_animate (rectangle, cur_mode, duration * 1000,
|
2009-05-31 14:15:46 +00:00
|
|
|
"x", event->x,
|
|
|
|
"y", event->y,
|
2009-01-20 17:57:30 +00:00
|
|
|
NULL);
|
2009-06-15 09:53:43 +00:00
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* if we were asked to, recenter the bouncer at the end of the
|
|
|
|
* animation. we keep track of the animation to avoid connecting
|
|
|
|
* the signal handler to the same Animation twice.
|
|
|
|
*/
|
2010-01-22 21:44:28 +00:00
|
|
|
if (recenter && last_animation != animation)
|
2009-06-15 09:53:43 +00:00
|
|
|
g_signal_connect_after (animation, "completed",
|
2011-09-05 14:26:27 +00:00
|
|
|
G_CALLBACK (recenter_bouncer),
|
2009-06-15 09:53:43 +00:00
|
|
|
rectangle);
|
2010-01-22 21:44:28 +00:00
|
|
|
|
|
|
|
last_animation = animation;
|
2009-01-20 17:57:30 +00:00
|
|
|
}
|
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
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2011-07-26 11:53:22 +00:00
|
|
|
static gboolean
|
|
|
|
draw_bouncer (ClutterCairoTexture *texture,
|
|
|
|
cairo_t *cr)
|
2009-06-15 14:08:59 +00:00
|
|
|
{
|
2011-09-05 14:26:27 +00:00
|
|
|
const ClutterColor *bouncer_color;
|
|
|
|
cairo_pattern_t *pattern;
|
2011-07-26 11:53:22 +00:00
|
|
|
guint width, height;
|
|
|
|
float radius;
|
2009-06-15 14:08:59 +00:00
|
|
|
|
2011-07-26 11:53:22 +00:00
|
|
|
clutter_cairo_texture_get_surface_size (texture, &width, &height);
|
2009-06-15 14:08:59 +00:00
|
|
|
|
2011-07-26 11:53:22 +00:00
|
|
|
radius = MAX (width, height);
|
2009-06-15 14:08:59 +00:00
|
|
|
|
2011-07-26 11:53:22 +00:00
|
|
|
clutter_cairo_texture_clear (texture);
|
2009-06-15 14:08:59 +00:00
|
|
|
|
|
|
|
cairo_arc (cr, radius / 2, radius / 2, radius / 2, 0.0, 2.0 * G_PI);
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
bouncer_color = CLUTTER_COLOR_DarkScarletRed;
|
|
|
|
|
2009-06-15 14:08:59 +00:00
|
|
|
pattern = cairo_pattern_create_radial (radius / 2, radius / 2, 0,
|
|
|
|
radius, radius, radius);
|
|
|
|
cairo_pattern_add_color_stop_rgba (pattern,
|
|
|
|
0,
|
2011-09-05 14:26:27 +00:00
|
|
|
bouncer_color->red / 255.0,
|
|
|
|
bouncer_color->green / 255.0,
|
|
|
|
bouncer_color->blue / 255.0,
|
|
|
|
bouncer_color->alpha / 255.0);
|
2009-06-15 14:08:59 +00:00
|
|
|
cairo_pattern_add_color_stop_rgba (pattern,
|
2011-09-05 14:26:27 +00:00
|
|
|
0.85,
|
|
|
|
bouncer_color->red / 255.0,
|
|
|
|
bouncer_color->green / 255.0,
|
|
|
|
bouncer_color->blue / 255.0,
|
|
|
|
0.25);
|
2009-06-15 14:08:59 +00:00
|
|
|
|
|
|
|
cairo_set_source (cr, pattern);
|
|
|
|
cairo_fill_preserve (cr);
|
|
|
|
|
|
|
|
cairo_pattern_destroy (pattern);
|
2011-07-26 11:53:22 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ClutterActor *
|
|
|
|
make_bouncer (gfloat width,
|
|
|
|
gfloat height)
|
|
|
|
{
|
|
|
|
ClutterActor *retval;
|
|
|
|
|
|
|
|
retval = clutter_cairo_texture_new (width, height);
|
|
|
|
g_signal_connect (retval, "draw", G_CALLBACK (draw_bouncer), NULL);
|
2009-06-15 14:08:59 +00:00
|
|
|
|
|
|
|
clutter_actor_set_name (retval, "bouncer");
|
|
|
|
clutter_actor_set_size (retval, width, height);
|
|
|
|
clutter_actor_set_anchor_point (retval, width / 2, height / 2);
|
|
|
|
clutter_actor_set_reactive (retval, TRUE);
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* make sure we draw the bouncer immediately */
|
2011-07-26 11:53:22 +00:00
|
|
|
clutter_cairo_texture_invalidate (CLUTTER_CAIRO_TEXTURE (retval));
|
|
|
|
|
2009-06-15 14:08:59 +00:00
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2009-06-15 09:53:43 +00:00
|
|
|
static GOptionEntry test_easing_entries[] = {
|
|
|
|
{
|
|
|
|
"re-center", 'r',
|
|
|
|
0,
|
|
|
|
G_OPTION_ARG_NONE, &recenter,
|
|
|
|
"Re-center the actor when the animation ends",
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"duration", 'd',
|
|
|
|
0,
|
|
|
|
G_OPTION_ARG_INT, &duration,
|
|
|
|
"Duration of the animation",
|
|
|
|
"SECONDS"
|
|
|
|
},
|
|
|
|
|
|
|
|
{ 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
|
|
|
G_MODULE_EXPORT int
|
|
|
|
test_easing_main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
ClutterActor *stage, *rect, *label;
|
|
|
|
gchar *text;
|
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 stage_width, stage_height;
|
2011-02-22 00:19:35 +00:00
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
if (clutter_init_with_args (&argc, &argv,
|
|
|
|
NULL,
|
|
|
|
test_easing_entries,
|
|
|
|
NULL,
|
|
|
|
&error) != 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
|
|
|
|
2011-07-26 11:53:22 +00:00
|
|
|
stage = clutter_stage_new ();
|
|
|
|
clutter_stage_set_title (CLUTTER_STAGE (stage), "Easing Modes");
|
2011-09-05 14:26:27 +00:00
|
|
|
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue);
|
2011-07-26 11:53:22 +00:00
|
|
|
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
|
|
|
main_stage = stage;
|
|
|
|
|
|
|
|
clutter_actor_get_size (stage, &stage_width, &stage_height);
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
/* create the actor that we want to tween */
|
2011-07-26 11:53:22 +00:00
|
|
|
rect = make_bouncer (50, 50);
|
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_container_add_actor (CLUTTER_CONTAINER (stage), rect);
|
|
|
|
clutter_actor_set_position (rect, stage_width / 2, stage_height / 2);
|
|
|
|
|
2011-09-05 14:26:27 +00:00
|
|
|
text = g_strdup_printf (HELP_TEXT,
|
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
|
|
|
easing_modes[current_mode].name,
|
|
|
|
current_mode + 1,
|
|
|
|
n_easing_modes);
|
|
|
|
|
2008-12-11 13:48:01 +00:00
|
|
|
label = clutter_text_new ();
|
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_container_add_actor (CLUTTER_CONTAINER (stage), label);
|
2008-12-11 13:48:01 +00:00
|
|
|
clutter_text_set_text (CLUTTER_TEXT (label), text);
|
2011-09-05 14:26:27 +00:00
|
|
|
clutter_actor_add_constraint (label, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.95));
|
|
|
|
clutter_actor_add_constraint (label, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.95));
|
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
|
|
|
easing_mode_label = label;
|
|
|
|
|
|
|
|
g_free (text);
|
|
|
|
|
2009-06-15 14:08:59 +00:00
|
|
|
g_signal_connect (stage,
|
|
|
|
"button-press-event", G_CALLBACK (on_button_press),
|
|
|
|
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_show (stage);
|
|
|
|
|
|
|
|
clutter_main ();
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
2011-09-28 12:32:57 +00:00
|
|
|
|
|
|
|
G_MODULE_EXPORT const char *
|
|
|
|
test_easing_describe (void)
|
|
|
|
{
|
|
|
|
return "Visualize all easing modes provided by Clutter";
|
|
|
|
}
|