Clutter 0.8.2 Reference Manual | ||||
---|---|---|---|---|
ClutterAlpha; ClutterAlphaClass; ClutterAlpha* clutter_alpha_new (void); ClutterAlpha* clutter_alpha_new_full (ClutterTimeline *timeline, ClutterAlphaFunc func, gpointer data, GDestroyNotify destroy); guint32 clutter_alpha_get_alpha (ClutterAlpha *alpha); #define CLUTTER_ALPHA_MAX_ALPHA guint32 (*ClutterAlphaFunc) (ClutterAlpha *alpha, gpointer user_data); void clutter_alpha_set_func (ClutterAlpha *alpha, ClutterAlphaFunc func, gpointer data, GDestroyNotify destroy); void clutter_alpha_set_closure (ClutterAlpha *alpha, GClosure *closure); void clutter_alpha_set_timeline (ClutterAlpha *alpha, ClutterTimeline *timeline); ClutterTimeline* clutter_alpha_get_timeline (ClutterAlpha *alpha); #define CLUTTER_ALPHA_RAMP_INC guint32 clutter_ramp_inc_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_RAMP_DEC guint32 clutter_ramp_dec_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_RAMP guint32 clutter_ramp_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_SINE guint32 clutter_sine_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_SINE_INC guint32 clutter_sine_inc_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_SINE_DEC guint32 clutter_sine_dec_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_SINE_HALF guint32 clutter_sine_half_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_SQUARE guint32 clutter_square_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_SMOOTHSTEP_INC guint32 clutter_smoothstep_inc_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_SMOOTHSTEP_DEC guint32 clutter_smoothstep_dec_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_EXP_INC guint32 clutter_exp_inc_func (ClutterAlpha *alpha, gpointer dummy); #define CLUTTER_ALPHA_EXP_DEC guint32 clutter_exp_dec_func (ClutterAlpha *alpha, gpointer dummy);
ClutterAlpha is a class for calculating an integer value between
0 and CLUTTER_ALPHA_MAX_ALPHA
as a function of time. You should
provide a ClutterTimeline and bind it to the ClutterAlpha object;
you should also provide a function returning the alpha value depending
on the position inside the timeline; this function will be executed
each time a new frame in the ClutterTimeline is reached. Since the
alpha function is controlled by the timeline instance, you can pause
or stop the ClutterAlpha from calling the alpha function by controlling
the ClutterTimeline object.
ClutterAlpha is used to "drive" a ClutterBehaviour instance.
typedef struct _ClutterAlpha ClutterAlpha;
ClutterAlpha combines a ClutterTimeline and a function. The contents of the ClutterAlpha structure are private and should only be accessed using the provided API.
Since 0.2
ClutterAlpha* clutter_alpha_new (void);
Creates a new ClutterAlpha instance. You must set a function
to compute the alpha value using clutter_alpha_set_func()
and
bind a ClutterTimeline object to the ClutterAlpha instance
using clutter_alpha_set_timeline()
.
You should use the newly created ClutterAlpha instance inside a ClutterBehaviour object.
Returns : |
the newly created empty ClutterAlpha instance. |
Since 0.2
ClutterAlpha* clutter_alpha_new_full (ClutterTimeline *timeline, ClutterAlphaFunc func, gpointer data, GDestroyNotify destroy);
Creates a new ClutterAlpha instance and sets the timeline and alpha function.
|
ClutterTimeline timeline |
|
ClutterAlphaFunc alpha function |
|
data to be passed to the alpha function |
|
notify to be called when removing the alpha function |
Returns : |
the newly created ClutterAlpha |
Since 0.2
guint32 clutter_alpha_get_alpha (ClutterAlpha *alpha);
Query the current alpha value.
|
A ClutterAlpha |
Returns : |
The current alpha value for the alpha |
Since 0.2
#define CLUTTER_ALPHA_MAX_ALPHA 0xffff
Maximum value returned by ClutterAlphaFunc
Since 0.2
guint32 (*ClutterAlphaFunc) (ClutterAlpha *alpha, gpointer user_data);
A function of time, which returns a value between 0 and
CLUTTER_ALPHA_MAX_ALPHA
.
|
a ClutterAlpha |
|
user data passed to the function |
Returns : |
an unsigned integer value, between 0 and
CLUTTER_ALPHA_MAX_ALPHA .
|
Since 0.2
void clutter_alpha_set_func (ClutterAlpha *alpha, ClutterAlphaFunc func, gpointer data, GDestroyNotify destroy);
Sets the ClutterAlphaFunc function used to compute
the alpha value at each frame of the ClutterTimeline
bound to alpha
.
|
A ClutterAlpha |
|
A ClutterAlphaAlphaFunc |
|
user data to be passed to the alpha function, or NULL
|
|
notify function used when disposing the alpha function |
Since 0.2
void clutter_alpha_set_closure (ClutterAlpha *alpha, GClosure *closure);
Sets the GClosure used to compute
the alpha value at each frame of the ClutterTimeline
bound to alpha
.
|
A ClutterAlpha |
|
A GClosure |
Since 0.8
void clutter_alpha_set_timeline (ClutterAlpha *alpha, ClutterTimeline *timeline);
Binds alpha
to timeline
.
|
A ClutterAlpha |
|
A ClutterTimeline |
Since 0.2
ClutterTimeline* clutter_alpha_get_timeline (ClutterAlpha *alpha);
Gets the ClutterTimeline bound to alpha
.
|
A ClutterAlpha |
Returns : |
a ClutterTimeline instance |
Since 0.2
#define CLUTTER_ALPHA_RAMP_INC clutter_ramp_inc_func
Convenience symbol for clutter_ramp_inc_func()
.
Since 0.2
guint32 clutter_ramp_inc_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a monotonic increasing ramp. You
can use this function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_RAMP_DEC clutter_ramp_dec_func
Convenience symbol for clutter_ramp_dec_func()
.
Since 0.2
guint32 clutter_ramp_dec_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a monotonic decreasing ramp. You
can use this function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_RAMP clutter_ramp_func
Convenience symbol for clutter_ramp_func()
.
Since 0.2
guint32 clutter_ramp_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a full ramp function (increase for
half the time, decrease for the remaining half). You can use this
function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_SINE clutter_sine_func
Convenience symbol for clutter_sine_func()
.
Since 0.2
guint32 clutter_sine_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a sine wave. You can use this
function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func
Convenience symbol for clutter_sine_inc_func()
.
Since 0.2
guint32 clutter_sine_inc_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a sine wave over interval [0, pi / 2].
You can use this function as the alpha function for
clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_SINE_DEC clutter_sine_dec_func
Convenience symbol for clutter_sine_dec_func()
.
Since 0.2
guint32 clutter_sine_dec_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a sine wave over interval [pi / 2, pi].
You can use this function as the alpha function for
clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.4
#define CLUTTER_ALPHA_SINE_HALF clutter_sine_half_func
Convenience symbol for clutter_sine_half_func()
.
Since 0.4
guint32 clutter_sine_half_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a sine wave over interval [0, pi].
You can use this function as the alpha function for
clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.4
#define CLUTTER_ALPHA_SQUARE clutter_square_func
Convenience symbol for clutter_square_func()
.
Since 0.4
guint32 clutter_square_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a square wave. You can use this
function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value |
Since 0.4
#define CLUTTER_ALPHA_SMOOTHSTEP_INC clutter_smoothstep_inc_func
Convenience symbol for clutter_smoothstep_inc_func()
.
Since 0.4
guint32 clutter_smoothstep_inc_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a smoothstep curve. You can use this
function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused |
Returns : |
an alpha value |
Since 0.4
#define CLUTTER_ALPHA_SMOOTHSTEP_DEC clutter_smoothstep_dec_func
Convenience symbol for clutter_smoothstep_dec_func()
.
Since 0.4
guint32 clutter_smoothstep_dec_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a downward smoothstep curve. You can use
this function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused |
Returns : |
an alpha value |
Since 0.4
#define CLUTTER_ALPHA_EXP_INC clutter_exp_inc_func
Convenience symbol for clutter_exp_inc_func()
Since 0.4
guint32 clutter_exp_inc_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a 2^x curve. You can use this function as the
alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.4
#define CLUTTER_ALPHA_EXP_DEC clutter_exp_dec_func
Convenience symbold for clutter_exp_dec_func()
.
Since 0.4
guint32 clutter_exp_dec_func (ClutterAlpha *alpha, gpointer dummy);
Convenience alpha function for a decreasing 2^x curve. You can use this
function as the alpha function for clutter_alpha_set_func()
.
|
a ClutterAlpha |
|
unused argument |
Returns : |
an alpha value. |
Since 0.4
"alpha"
property"alpha" guint : Read
The alpha value as computed by the alpha function.
Allowed values: <= 65535
Default value: 0
Since 0.2
"timeline"
property"timeline" ClutterTimeline* : Read / Write
A ClutterTimeline instance used to drive the alpha function.
Since 0.2