mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
removed ClutterSmoothstep type; renamed clutter_smoothstep_func to clutter_smoothstep_inc_func; added clutter_smoothstep_dec_func
This commit is contained in:
parent
6e39efb9aa
commit
5b0e0dbcbe
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2007-05-30 Tomas Frydrych <tf@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/clutter-alpha.h:
|
||||||
|
* clutter/clutter-alpha.c:
|
||||||
|
Removed ClutterSmoothstep struct
|
||||||
|
(clutter_smoothstep_inc_func):
|
||||||
|
Renamed to clutter_smoothstep_func.
|
||||||
|
(clutter_smoothstep_added_func):
|
||||||
|
Added.
|
||||||
|
|
||||||
2007-05-29 Tomas Frydrych <tf@openedhand.com>
|
2007-05-29 Tomas Frydrych <tf@openedhand.com>
|
||||||
|
|
||||||
* clutter/clutter-fixed.h:
|
* clutter/clutter-fixed.h:
|
||||||
|
@ -728,67 +728,11 @@ clutter_square_func (ClutterAlpha *alpha,
|
|||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_smoothstep_copy:
|
|
||||||
* @smoothstep: a #ClutterSmoothstep
|
|
||||||
*
|
|
||||||
* Makes an allocated copy of a smoothstep.
|
|
||||||
*
|
|
||||||
* Return value: the copied smoothstep.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*/
|
|
||||||
ClutterSmoothstep *
|
|
||||||
clutter_smoothstep_copy (const ClutterSmoothstep *smoothstep)
|
|
||||||
{
|
|
||||||
ClutterSmoothstep *copy;
|
|
||||||
|
|
||||||
copy = g_slice_new0 (ClutterSmoothstep);
|
|
||||||
|
|
||||||
*copy = *smoothstep;
|
|
||||||
|
|
||||||
return copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_smoothstep_free:
|
* clutter_smoothstep_inc_func:
|
||||||
* @smoothstep: a #ClutterSmoothstep
|
|
||||||
*
|
|
||||||
* Frees the memory of an allocated smoothstep.
|
|
||||||
*
|
|
||||||
* Since: 0.4
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_smoothstep_free (ClutterSmoothstep *smoothstep)
|
|
||||||
{
|
|
||||||
if (G_LIKELY (smoothstep))
|
|
||||||
{
|
|
||||||
g_slice_free (ClutterSmoothstep, smoothstep);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GType
|
|
||||||
clutter_smoothstep_get_type (void)
|
|
||||||
{
|
|
||||||
static GType our_type = 0;
|
|
||||||
|
|
||||||
if (G_UNLIKELY (!our_type))
|
|
||||||
{
|
|
||||||
our_type =
|
|
||||||
g_boxed_type_register_static ("ClutterSmoothstep",
|
|
||||||
(GBoxedCopyFunc) clutter_smoothstep_copy,
|
|
||||||
(GBoxedFreeFunc) clutter_smoothstep_free);
|
|
||||||
}
|
|
||||||
|
|
||||||
return our_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_smoothstep_func:
|
|
||||||
* @alpha: a #ClutterAlpha
|
* @alpha: a #ClutterAlpha
|
||||||
* @data: pointer to a #ClutterSmoothstep defining the minimum and
|
* @dummy: unused
|
||||||
* maximum thresholds for the smoothstep as supplied to
|
|
||||||
* clutter_alpha_set_func().
|
|
||||||
*
|
*
|
||||||
* Convenience alpha function for a smoothstep curve. You can use this
|
* Convenience alpha function for a smoothstep curve. You can use this
|
||||||
* function as the alpha function for clutter_alpha_set_func().
|
* function as the alpha function for clutter_alpha_set_func().
|
||||||
@ -798,10 +742,9 @@ clutter_smoothstep_get_type (void)
|
|||||||
* Since: 0.4
|
* Since: 0.4
|
||||||
*/
|
*/
|
||||||
guint32
|
guint32
|
||||||
clutter_smoothstep_func (ClutterAlpha *alpha,
|
clutter_smoothstep_inc_func (ClutterAlpha *alpha,
|
||||||
gpointer *data)
|
gpointer *dummy)
|
||||||
{
|
{
|
||||||
ClutterSmoothstep *smoothstep = (ClutterSmoothstep*)data;
|
|
||||||
ClutterTimeline *timeline;
|
ClutterTimeline *timeline;
|
||||||
gint frame;
|
gint frame;
|
||||||
gint n_frames;
|
gint n_frames;
|
||||||
@ -814,28 +757,14 @@ clutter_smoothstep_func (ClutterAlpha *alpha,
|
|||||||
* The earlier operations involve division, which we cannot do in 8.24 for
|
* The earlier operations involve division, which we cannot do in 8.24 for
|
||||||
* numbers in <0,1> we use ClutterFixed.
|
* numbers in <0,1> we use ClutterFixed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
g_return_val_if_fail (data, 0);
|
|
||||||
|
|
||||||
timeline = clutter_alpha_get_timeline (alpha);
|
timeline = clutter_alpha_get_timeline (alpha);
|
||||||
frame = clutter_timeline_get_current_frame (timeline);
|
frame = clutter_timeline_get_current_frame (timeline);
|
||||||
n_frames = clutter_timeline_get_n_frames (timeline);
|
n_frames = clutter_timeline_get_n_frames (timeline);
|
||||||
|
|
||||||
r = CFX_DIV (frame, n_frames);
|
|
||||||
|
|
||||||
if (r <= smoothstep->min)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (r >= smoothstep->max)
|
|
||||||
return CLUTTER_ALPHA_MAX_ALPHA;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Normalize x for the smoothstep polynomal.
|
* Convert x to 8.24 for next step.
|
||||||
*
|
|
||||||
* Convert result to 8.24 for next step.
|
|
||||||
*/
|
*/
|
||||||
x = CFX_DIV ((r - smoothstep->min), (smoothstep->max - smoothstep->min))
|
x = CFX_DIV (frame, n_frames) << 8;
|
||||||
<< 8;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* f(x) = -2x^3 + 3x^2
|
* f(x) = -2x^3 + 3x^2
|
||||||
@ -852,6 +781,25 @@ clutter_smoothstep_func (ClutterAlpha *alpha,
|
|||||||
return CFX_INT (r * CLUTTER_ALPHA_MAX_ALPHA);
|
return CFX_INT (r * CLUTTER_ALPHA_MAX_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_smoothstep_dec_func:
|
||||||
|
* @alpha: a #ClutterAlpha
|
||||||
|
* @dummy: unused
|
||||||
|
*
|
||||||
|
* Convenience alpha function for a downward smoothstep curve. You can use
|
||||||
|
* this function as the alpha function for clutter_alpha_set_func().
|
||||||
|
*
|
||||||
|
* Return value: an alpha value
|
||||||
|
*
|
||||||
|
* Since: 0.4
|
||||||
|
*/
|
||||||
|
guint32
|
||||||
|
clutter_smoothstep_dec_func (ClutterAlpha *alpha,
|
||||||
|
gpointer *dummy)
|
||||||
|
{
|
||||||
|
return CLUTTER_ALPHA_MAX_ALPHA - clutter_smoothstep_inc_func (alpha, dummy);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_exp_inc_func:
|
* clutter_exp_inc_func:
|
||||||
* @alpha: a #ClutterAlpha
|
* @alpha: a #ClutterAlpha
|
||||||
|
@ -102,54 +102,45 @@ void clutter_alpha_set_timeline (ClutterAlpha *alpha,
|
|||||||
ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha);
|
ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha);
|
||||||
|
|
||||||
/* convenience functions */
|
/* convenience functions */
|
||||||
#define CLUTTER_ALPHA_RAMP_INC clutter_ramp_inc_func
|
#define CLUTTER_ALPHA_RAMP_INC clutter_ramp_inc_func
|
||||||
#define CLUTTER_ALPHA_RAMP_DEC clutter_ramp_dec_func
|
#define CLUTTER_ALPHA_RAMP_DEC clutter_ramp_dec_func
|
||||||
#define CLUTTER_ALPHA_RAMP clutter_ramp_func
|
#define CLUTTER_ALPHA_RAMP clutter_ramp_func
|
||||||
#define CLUTTER_ALPHA_SINE clutter_sine_func
|
#define CLUTTER_ALPHA_SINE clutter_sine_func
|
||||||
#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func
|
#define CLUTTER_ALPHA_SINE_INC clutter_sine_inc_func
|
||||||
#define CLUTTER_ALPHA_SINE_DEC clutter_sine_dec_func
|
#define CLUTTER_ALPHA_SINE_DEC clutter_sine_dec_func
|
||||||
#define CLUTTER_ALPHA_SINE_HALF clutter_sine_half_func
|
#define CLUTTER_ALPHA_SINE_HALF clutter_sine_half_func
|
||||||
#define CLUTTER_ALPHA_SQUARE clutter_square_func
|
#define CLUTTER_ALPHA_SQUARE clutter_square_func
|
||||||
#define CLUTTER_ALPHA_SMOOTHSTEP clutter_smoothstep_func
|
#define CLUTTER_ALPHA_SMOOTHSTEP_INC clutter_smoothstep_inc_func
|
||||||
#define CLUTTER_ALPHA_EXP_INC clutter_exp_inc_func
|
#define CLUTTER_ALPHA_SMOOTHSTEP_DEC clutter_smoothstep_dec_func
|
||||||
#define CLUTTER_ALPHA_EXP_DEC clutter_exp_dec_func
|
#define CLUTTER_ALPHA_EXP_INC clutter_exp_inc_func
|
||||||
|
#define CLUTTER_ALPHA_EXP_DEC clutter_exp_dec_func
|
||||||
|
|
||||||
#define CLUTTER_TYPE_SMOOTHSTEP (clutter_smoothstep_get_type ())
|
#define CLUTTER_TYPE_SMOOTHSTEP (clutter_smoothstep_get_type ())
|
||||||
|
|
||||||
typedef struct _ClutterSmoothstep ClutterSmoothstep;
|
guint32 clutter_ramp_inc_func (ClutterAlpha *alpha,
|
||||||
|
gpointer dummy);
|
||||||
struct _ClutterSmoothstep
|
guint32 clutter_ramp_dec_func (ClutterAlpha *alpha,
|
||||||
{
|
gpointer dummy);
|
||||||
ClutterFixed min;
|
guint32 clutter_ramp_func (ClutterAlpha *alpha,
|
||||||
ClutterFixed max;
|
gpointer dummy);
|
||||||
};
|
guint32 clutter_sine_func (ClutterAlpha *alpha,
|
||||||
|
gpointer dummy);
|
||||||
ClutterSmoothstep * clutter_smoothstep_copy (const ClutterSmoothstep *smoothstep);
|
guint32 clutter_sine_inc_func (ClutterAlpha *alpha,
|
||||||
|
gpointer dummy);
|
||||||
void clutter_smoothstep_free (ClutterSmoothstep *smoothstep);
|
guint32 clutter_sine_dec_func (ClutterAlpha *alpha,
|
||||||
|
gpointer dummy);
|
||||||
guint32 clutter_ramp_inc_func (ClutterAlpha *alpha,
|
guint32 clutter_sine_half_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer dummy);
|
||||||
guint32 clutter_ramp_dec_func (ClutterAlpha *alpha,
|
guint32 clutter_square_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer dummy);
|
||||||
guint32 clutter_ramp_func (ClutterAlpha *alpha,
|
guint32 clutter_smoothstep_inc_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer *data);
|
||||||
guint32 clutter_sine_func (ClutterAlpha *alpha,
|
guint32 clutter_smoothstep_dec_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer *data);
|
||||||
guint32 clutter_sine_inc_func (ClutterAlpha *alpha,
|
guint32 clutter_exp_inc_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer dummy);
|
||||||
guint32 clutter_sine_dec_func (ClutterAlpha *alpha,
|
guint32 clutter_exp_dec_func (ClutterAlpha *alpha,
|
||||||
gpointer dummy);
|
gpointer dummy);
|
||||||
guint32 clutter_sine_half_func (ClutterAlpha *alpha,
|
|
||||||
gpointer dummy);
|
|
||||||
guint32 clutter_square_func (ClutterAlpha *alpha,
|
|
||||||
gpointer dummy);
|
|
||||||
guint32 clutter_smoothstep_func (ClutterAlpha *alpha,
|
|
||||||
gpointer *data);
|
|
||||||
guint32 clutter_exp_inc_func (ClutterAlpha *alpha,
|
|
||||||
gpointer dummy);
|
|
||||||
guint32 clutter_exp_dec_func (ClutterAlpha *alpha,
|
|
||||||
gpointer dummy);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2007-05-30 Tomas Frydrych <tf@openedhand.com>
|
||||||
|
|
||||||
|
* clutter.types:
|
||||||
|
removed clutter_smoothstep_get_type.
|
||||||
|
|
||||||
|
* tmpl/clutter-alpha.sgml:
|
||||||
|
* tmpl/clutter-actor.sgml:
|
||||||
|
* tmpl/clutter-media.sgml:
|
||||||
|
Updated templates.
|
||||||
|
|
||||||
2007-05-22 Tomas Frydrych <tf@openedhand.com>
|
2007-05-22 Tomas Frydrych <tf@openedhand.com>
|
||||||
|
|
||||||
* clutter-sections.txt:
|
* clutter-sections.txt:
|
||||||
|
@ -11,7 +11,6 @@ clutter_timeline_get_type
|
|||||||
clutter_media_get_type
|
clutter_media_get_type
|
||||||
clutter_behaviour_get_type
|
clutter_behaviour_get_type
|
||||||
clutter_alpha_get_type
|
clutter_alpha_get_type
|
||||||
clutter_smoothstep_get_type
|
|
||||||
clutter_behaviour_bspline_get_type
|
clutter_behaviour_bspline_get_type
|
||||||
clutter_behaviour_ellipse_get_type
|
clutter_behaviour_ellipse_get_type
|
||||||
clutter_behaviour_opacity_get_type
|
clutter_behaviour_opacity_get_type
|
||||||
|
@ -208,7 +208,7 @@ Base class for #ClutterActor
|
|||||||
@get_depth:
|
@get_depth:
|
||||||
@parent_set:
|
@parent_set:
|
||||||
@destroy:
|
@destroy:
|
||||||
@queue_redraw:
|
@pick:
|
||||||
@_clutter_actor_1:
|
@_clutter_actor_1:
|
||||||
@_clutter_actor_2:
|
@_clutter_actor_2:
|
||||||
@_clutter_actor_3:
|
@_clutter_actor_3:
|
||||||
|
@ -123,34 +123,6 @@ transforming the current position in the timeline.
|
|||||||
@Returns:
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### STRUCT ClutterSmoothstep ##### -->
|
|
||||||
<para>
|
|
||||||
Represents minimum and maximum thresholds for the smoothstep function. The
|
|
||||||
thresholds are values from <0,1> relative to the frame-length of the behaviour,
|
|
||||||
i.e., if the behaviour consists of 60 frames, threshold of 0.25 corresponds to
|
|
||||||
frame 15, and threshold of 1.0 to frame 60.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@min: lower threshold; a #ClutterFixed value from <0,1>
|
|
||||||
@max: upper threshold; a #ClutterFixed value from <0,1>
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION clutter_smoothstep_copy ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@smoothstep:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION clutter_smoothstep_free ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@smoothstep:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### MACRO CLUTTER_ALPHA_RAMP_INC ##### -->
|
<!-- ##### MACRO CLUTTER_ALPHA_RAMP_INC ##### -->
|
||||||
<para>
|
<para>
|
||||||
Symbolic name for passing clutter_ramp_inc_func().
|
Symbolic name for passing clutter_ramp_inc_func().
|
||||||
@ -287,23 +259,6 @@ Symbolic name for passing clutter_sine_func().
|
|||||||
@Returns:
|
@Returns:
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### MACRO CLUTTER_ALPHA_SMOOTHSTEP ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION clutter_smoothstep_func ##### -->
|
|
||||||
<para>
|
|
||||||
|
|
||||||
</para>
|
|
||||||
|
|
||||||
@alpha:
|
|
||||||
@data:
|
|
||||||
@Returns:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### MACRO CLUTTER_ALPHA_EXP_INC ##### -->
|
<!-- ##### MACRO CLUTTER_ALPHA_EXP_INC ##### -->
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
|
@ -23,6 +23,21 @@ clutter-media
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ##### SIGNAL ClutterMedia::eos ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@cluttermedia: the object which received the signal.
|
||||||
|
|
||||||
|
<!-- ##### SIGNAL ClutterMedia::error ##### -->
|
||||||
|
<para>
|
||||||
|
|
||||||
|
</para>
|
||||||
|
|
||||||
|
@cluttermedia: the object which received the signal.
|
||||||
|
@arg1:
|
||||||
|
|
||||||
<!-- ##### ARG ClutterMedia:buffer-percent ##### -->
|
<!-- ##### ARG ClutterMedia:buffer-percent ##### -->
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user