| Clutter Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | Known Implementations | ||||
ClutterAnimatable; struct ClutterAnimatableIface; gboolean clutter_animatable_animate_property (ClutterAnimatable *animatable,ClutterAnimation *animation,const gchar *property_name,const GValue *initial_value,const GValue *final_value,gdouble progress,GValue *value); GParamSpec * clutter_animatable_find_property (ClutterAnimatable *animatable,const gchar *property_name); void clutter_animatable_get_initial_state (ClutterAnimatable *animatable,const gchar *property_name,GValue *value); void clutter_animatable_set_final_state (ClutterAnimatable *animatable,const gchar *property_name,const GValue *value); gboolean clutter_animatable_interpolate_value (ClutterAnimatable *animatable,const gchar *property_name,ClutterInterval *interval,gdouble progress,GValue *value);
ClutterAnimatable is implemented by ClutterActor, ClutterBox, ClutterCairoTexture, ClutterClone, ClutterGroup, ClutterRectangle, ClutterStage, ClutterText and ClutterTexture.
ClutterAnimatable is an interface that allows a GObject class to control how a ClutterAnimation will animate a property.
Each ClutterAnimatable should implement the
animate_property virtual function of the interface
to compute the animation state between two values of an interval depending
on a progress factor, expressed as a floating point value.
If a ClutterAnimatable is animated by a ClutterAnimation
instance, the ClutterAnimation will call
clutter_animatable_animate_property() passing the name of the
currently animated property; the initial and final values of
the animation interval; the progress factor. The ClutterAnimatable
implementation should return the computed value for the animated
property.
ClutterAnimatable is available since Clutter 1.0
typedef struct _ClutterAnimatable ClutterAnimatable;
ClutterAnimatable is an opaque structure whose members cannot be directly accessed
Since 1.0
struct ClutterAnimatableIface {
gboolean (* animate_property) (ClutterAnimatable *animatable,
ClutterAnimation *animation,
const gchar *property_name,
const GValue *initial_value,
const GValue *final_value,
gdouble progress,
GValue *value);
GParamSpec *(* find_property) (ClutterAnimatable *animatable,
const gchar *property_name);
void (* get_initial_state) (ClutterAnimatable *animatable,
const gchar *property_name,
GValue *value);
void (* set_final_state) (ClutterAnimatable *animatable,
const gchar *property_name,
const GValue *value);
gboolean (* interpolate_value) (ClutterAnimatable *animatable,
const gchar *property_name,
ClutterInterval *interval,
gdouble progress,
GValue *value);
};
Base interface for GObjects that can be animated by a a ClutterAnimation.
| virtual function for custom interpolation of a property. This virtual function is deprecated | |
| virtual function for retrieving the GParamSpec of an animatable property | |
| virtual function for retrieving the initial state of an animatable property | |
| virtual function for setting the state of an animatable property | |
| virtual function for interpolating the progress of a property |
Since 1.0
gboolean clutter_animatable_animate_property (ClutterAnimatable *animatable,ClutterAnimation *animation,const gchar *property_name,const GValue *initial_value,const GValue *final_value,gdouble progress,GValue *value);
clutter_animatable_animate_property has been deprecated since version 1.8 and should not be used in newly-written code. Use clutter_animatable_interpolate_value()
instead
Calls the animate_property() virtual function for animatable.
The initial_value and final_value GValues must contain
the same type; value must have been initialized to the same
type of initial_value and final_value.
All implementation of the ClutterAnimatable interface must implement this function.
|
a ClutterAnimatable |
|
a ClutterAnimation |
|
the name of the animated property |
|
the initial value of the animation interval |
|
the final value of the animation interval |
|
the progress factor |
|
return location for the animation value |
Returns : |
TRUE if the value has been validated and can
be applied to the ClutterAnimatable, and FALSE otherwise |
Since 1.0
GParamSpec * clutter_animatable_find_property (ClutterAnimatable *animatable,const gchar *property_name);
Finds the GParamSpec for property_name
|
a ClutterAnimatable |
|
the name of the animatable property to find |
Returns : |
The GParamSpec for the given property
or NULL. [transfer none]
|
Since 1.4
void clutter_animatable_get_initial_state (ClutterAnimatable *animatable,const gchar *property_name,GValue *value);
Retrieves the current state of property_name and sets value with it
|
a ClutterAnimatable |
|
the name of the animatable property to retrieve |
|
a GValue initialized to the type of the property to retrieve |
Since 1.4
void clutter_animatable_set_final_state (ClutterAnimatable *animatable,const gchar *property_name,const GValue *value);
Sets the current state of property_name to value
|
a ClutterAnimatable |
|
the name of the animatable property to set |
|
the value of the animatable property to set |
Since 1.4
gboolean clutter_animatable_interpolate_value (ClutterAnimatable *animatable,const gchar *property_name,ClutterInterval *interval,gdouble progress,GValue *value);
Asks a ClutterAnimatable implementation to interpolate a
a named property between the initial and final values of
a ClutterInterval, using progress as the interpolation
value, and store the result inside value.
This function should be used for every property animation involving ClutterAnimatables.
This function replaces clutter_animatable_animate_property().
|
a ClutterAnimatable |
|
the name of the property to interpolate |
|
a ClutterInterval with the animation range |
|
the progress to use to interpolate between the
initial and final values of the interval
|
|
return location for an initialized GValue
using the same type of the interval. [out]
|
Returns : |
TRUE if the interpolation was successful,
and FALSE otherwise |
Since 1.8