Add clutter_effect_depth(), simple wrapper around the depth behaviour

This patch adds a new effect function, wrapping ClutterBehaviourDepth into
clutter_effect_depth().
This commit is contained in:
Emmanuele Bassi 2007-08-15 19:50:16 +00:00
parent 635b84971d
commit 294ec333b7
3 changed files with 82 additions and 30 deletions

View File

@ -48,6 +48,7 @@
#include "clutter-private.h" #include "clutter-private.h"
#include "clutter-debug.h" #include "clutter-debug.h"
#include "clutter-behaviour-bspline.h" #include "clutter-behaviour-bspline.h"
#include "clutter-behaviour-depth.h"
#include "clutter-behaviour-ellipse.h" #include "clutter-behaviour-ellipse.h"
#include "clutter-behaviour-opacity.h" #include "clutter-behaviour-opacity.h"
#include "clutter-behaviour-path.h" #include "clutter-behaviour-path.h"
@ -439,6 +440,49 @@ clutter_effect_fade (ClutterEffectTemplate *template_,
return c->timeline; return c->timeline;
} }
/**
* clutter_effect_depth:
* @template_: A #ClutterEffectTemplate
* @actor: A #ClutterActor to apply the effect to.
* @start_depth: Initial depth value to apply to actor
* @end_depth: Final depth value to apply to actor
* @completed_func: A #ClutterEffectCompleteFunc to call on effect
* completion or %NULL
* @completed_data: Data to pass to supplied #ClutterEffectCompleteFunc
* or %NULL
*
* Simple effect for changing the depth of a single #ClutterActor.
*
* Return value: a #ClutterTimeline for the effect. Will be unrefed by
* the effect when completed.
*
* Since: 0.5
*/
ClutterTimeline *
clutter_effect_depth (ClutterEffectTemplate *template_,
ClutterActor *actor,
gint start_depth,
gint end_depth,
ClutterEffectCompleteFunc completed_func,
gpointer completed_data)
{
ClutterEffectClosure *c;
c = clutter_effect_closure_new (template_,
actor,
G_CALLBACK (on_effect_complete));
c->completed_func = completed_func;
c->completed_data = completed_data;
c->behave = clutter_behaviour_depth_new (c->alpha, start_depth, end_depth);
clutter_behaviour_apply (c->behave, actor);
clutter_timeline_start (c->timeline);
return c->timeline;
}
/** /**
* clutter_effect_move: * clutter_effect_move:
* @template_: A #ClutterEffectTemplate * @template_: A #ClutterEffectTemplate

View File

@ -111,6 +111,12 @@ ClutterTimeline *clutter_effect_fade (ClutterEffectTemplate *template_,
guint8 end_opacity, guint8 end_opacity,
ClutterEffectCompleteFunc completed_func, ClutterEffectCompleteFunc completed_func,
gpointer completed_data); gpointer completed_data);
ClutterTimeline *clutter_effect_depth (ClutterEffectTemplate *template_,
ClutterActor *actor,
gint start_depth,
gint end_depth,
ClutterEffectCompleteFunc completed_func,
gpointer completed_data);
ClutterTimeline *clutter_effect_move (ClutterEffectTemplate *template_, ClutterTimeline *clutter_effect_move (ClutterEffectTemplate *template_,
ClutterActor *actor, ClutterActor *actor,
const ClutterKnot *knots, const ClutterKnot *knots,
@ -154,7 +160,6 @@ ClutterTimeline * clutter_effect_rotate_z (ClutterEffectTemplate *template_,
ClutterEffectCompleteFunc completed_func, ClutterEffectCompleteFunc completed_func,
gpointer completed_data); gpointer completed_data);
G_END_DECLS G_END_DECLS
#endif /* _CLUTTER_EFFECT */ #endif /* _CLUTTER_EFFECT */

View File

@ -413,11 +413,12 @@ clutter_texture_get_type
<SECTION> <SECTION>
<FILE>clutter-stage</FILE> <FILE>clutter-stage</FILE>
<TITLE>ClutterStage</TITLE> <TITLE>ClutterStage</TITLE>
CLUTTER_STAGE_WIDTH
CLUTTER_STAGE_HEIGHT
ClutterPerspective ClutterPerspective
clutter_perspective_copy clutter_perspective_copy
clutter_perspective_free clutter_perspective_free
<SUBSECTION>
CLUTTER_STAGE_WIDTH
CLUTTER_STAGE_HEIGHT
clutter_stage_get_default clutter_stage_get_default
clutter_stage_set_color clutter_stage_set_color
clutter_stage_get_color clutter_stage_get_color
@ -971,10 +972,12 @@ clutter_padding_get_type
<TITLE>Clutter Effects</TITLE> <TITLE>Clutter Effects</TITLE>
clutter_effect_template_new clutter_effect_template_new
clutter_effect_template_new_full clutter_effect_template_new_full
<SUBSECTION>
ClutterEffectCompleteFunc ClutterEffectCompleteFunc
clutter_effect_fade clutter_effect_fade
clutter_effect_move clutter_effect_move
clutter_effect_scale clutter_effect_scale
clutter_effect_depth
clutter_effect_rotate_x clutter_effect_rotate_x
clutter_effect_rotate_y clutter_effect_rotate_y
clutter_effect_rotate_z clutter_effect_rotate_z