![]() |
![]() |
![]() |
Clutter 0.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_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);
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;
The ClutterAlpha structure contains only private data and should not be accessed directly.
typedef struct { GInitiallyUnownedClass parent_class; void (*_clutter_alpha_1) (void); void (*_clutter_alpha_2) (void); void (*_clutter_alpha_3) (void); void (*_clutter_alpha_4) (void); void (*_clutter_alpha_5) (void); } ClutterAlphaClass;
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.
timeline : |
ClutterTimeline timeline |
func : |
ClutterAlphaFunc alpha function |
data : |
data to be passed to the alpha function |
destroy : |
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.
alpha : |
A ClutterAlpha |
Returns : | The current alpha value for the alpha |
Since 0.2
#define CLUTTER_ALPHA_MAX_ALPHA 0xffff
Maximum value of the alpha function. You should use this value to scale the computed alpha value.
guint32 (*ClutterAlphaFunc) (ClutterAlpha *alpha, gpointer user_data);
The alpha function is a function of time. You should provide a function transforming the current position in the timeline.
alpha : |
a ClutterAlpha |
user_data : |
optional user defined data passed to the function |
Returns : | a value between 0 and CLUTTER_ALPHA_MAX_ALPHA |
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
.
alpha : |
A ClutterAlpha |
func : |
A ClutterAlphaAlphaFunc |
data : |
user data to be passed to the alpha function, or NULL
|
destroy : |
notify function used when disposing the alpha function |
Since 0.2
void clutter_alpha_set_timeline (ClutterAlpha *alpha, ClutterTimeline *timeline);
Binds alpha
to timeline
.
alpha : |
A ClutterAlpha |
timeline : |
A ClutterTimeline |
Since 0.2
ClutterTimeline* clutter_alpha_get_timeline (ClutterAlpha *alpha);
Gets the ClutterTimeline bound to alpha
.
alpha : |
A ClutterAlpha |
Returns : | a ClutterTimeline instance |
Since 0.2
#define CLUTTER_ALPHA_RAMP_INC clutter_ramp_inc_func
Symbolic name for passing clutter_ramp_inc_func()
.
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()
.
alpha : |
a ClutterAlpha |
dummy : |
unused argument |
Returns : | an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_RAMP_DEC clutter_ramp_dec_func
Symbolic name for passing clutter_ramp_dec_func()
.
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()
.
alpha : |
a ClutterAlpha |
dummy : |
unused argument |
Returns : | an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_RAMP clutter_ramp_func
Symbolic name for passing clutter_ramp_func()
.
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()
.
alpha : |
a ClutterAlpha |
dummy : |
unused argument |
Returns : | an alpha value. |
Since 0.2
#define CLUTTER_ALPHA_SINE clutter_sine_func
Symbolic name for passing clutter_sine_func()
.
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()
.
alpha : |
a ClutterAlpha |
dummy : |
unused argument |
Returns : | an alpha value. |
Since 0.2
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