ClutterFixed as a type is going away, superceded by CoglFixed. The
fixed point entry points in the API should be ported to the
CoglFixed type so that they are useful again.
This sets the center point from which the scaling will occur. This can
be used insetad of the anchor point to avoid moving the actor. Like
the anchor point, it can be specified as either a coordinate in units
or a gravity enum.
To set the center you can use two new variants of set_scale:
clutter_actor_set_scale_full (ClutterActor *self,
gdouble scale_x,
gdouble scale_y,
int center_x,
int center_y);
or
clutter_actor_set_scale_with_gravity (ClutterActor *self,
gdouble scale_x,
gdouble scale_y,
ClutterGravity gravity);
The ClutterFixed variants of the set_scale functions have been removed
and the scale value is now always stored as a double.
* float-alpha-value:
[script] Parse easing modes by name
[docs] Update the easing modes documentation
[animation] Implement new easing functions
[animation] Move the alpha value to floating point
The current Alpha value is an unsigned integer that can be used
implicitly as a fixed point value. This makes writing an alpha
function overshooting below and above the current range basically
impossible without complicating an already complex code, and
creating weird corner cases.
For this reason, the Alpha value should be defined as a floating
point normalized value, spanning a range between 0.0 and 1.0; in
order to allow overshooting, the valid range is extended one unit
below and one unit above, thus making it -1.0 .. 2.0.
This commit updates the various users of the ClutterAlpha API
and the tests cases.
This commit also removes all the current alpha functions exposed
in the public API.
This is the result of running a number of sed and perl scripts over the code to
do 90% of the work in converting from 16.16 fixed to single precision floating
point.
Note: A pristine cogl-fixed.c has been maintained as a standalone utility API
so that applications may still take advantage of fixed point if they
desire for certain optimisations where lower precision may be acceptable.
Note: no API changes were made in Clutter, only in Cogl.
Overview of changes:
- Within clutter/* all usage of the COGL_FIXED_ macros have been changed to use
the CLUTTER_FIXED_ macros.
- Within cogl/* all usage of the COGL_FIXED_ macros have been completly stripped
and expanded into code that works with single precision floats instead.
- Uses of cogl_fixed_* have been replaced with single precision math.h
alternatives.
- Uses of COGL_ANGLE_* and cogl_angle_* have been replaced so we use a float for
angles and math.h replacements.
Bug 1209 - Move fixed point API in COGL
* clutter/cogl/cogl-fixed.h:
* clutter/cogl/cogl.h.in:
* clutter/cogl/common/Makefile.am:
* clutter/cogl/common/cogl-fixed.c: Add fixed point API, modelled
after the ClutterFixed. The CoglFixed API supercedes the ClutterFixed
one and avoids the dependency of COGL on Clutter's own API.
* clutter/cogl/common/cogl-clip-stack.c:
* clutter/cogl/common/cogl-primitives.c:
* clutter/cogl/common/cogl-primitives.h: Update internal usage of
ClutterFixed to CoglFixed.
* clutter/cogl/gl/Makefile.am:
* clutter/cogl/gl/cogl-primitives.c:
* clutter/cogl/gl/cogl-texture.c:
* clutter/cogl/gl/cogl.c: Ditto, in the GL implementation of the
COGL API.
* clutter/cogl/gles/Makefile.am:
* clutter/cogl/gles/cogl-fbo.c:
* clutter/cogl/gles/cogl-gles2-wrapper.c:
* clutter/cogl/gles/cogl-primitives.c:
* clutter/cogl/gles/cogl-texture.c:
* clutter/cogl/gles/cogl.c: Ditto, in the GLES implementation of
the COGL API.
* clutter/pango/pangoclutter-glyph-cache.c:
* clutter/pango/pangoclutter-glyph-cache.h: Ditto, in the Pango
renderer glyphs cache.
* clutter/clutter-fixed.c:
* clutter/clutter-fixed.h: ClutterFixed and related API becomes
a simple transition API for bindings and public Clutter API.
* clutter/clutter-actor.c:
* clutter/clutter-alpha.c:
* clutter/clutter-backend.c:
* clutter/clutter-behaviour-depth.c:
* clutter/clutter-behaviour-ellipse.c:
* clutter/clutter-behaviour-path.c:
* clutter/clutter-behaviour-rotate.c:
* clutter/clutter-behaviour-scale.c:
* clutter/clutter-clone-texture.c:
* clutter/clutter-color.c:
* clutter/clutter-entry.c:
* clutter/clutter-stage.c:
* clutter/clutter-texture.c:
* clutter/clutter-timeline.c:
* clutter/clutter-units.h: Move from the internal usage of
ClutterFixed to CoglFixed.
* doc/reference/clutter/clutter-sections.txt:
* doc/reference/cogl/cogl-docs.sgml:
* doc/reference/cogl/cogl-sections.txt: Update the documentation.
* tests/test-cogl-tex-tile.c:
* tests/test-project.c: Fix tests after the API change
* README: Add release notes.
* clutter/clutter-actor.c:
Minor documentation tweak to class description.
* clutter/clutter-behaviour-scale.c:
'Force' start + end vals of scale behaviour
(#779, Havoc Pennington)
* clutter/clutter-behaviour-scale.c: Use separate variables for
storing the scale boundaries; apparently, using arrays broke
the python bindings. (#720)
* clutter.symbols: Add new ClutterBehaviourScale setters.
* clutter/clutter-behaviour-scale.[ch]: Split the scaling factors
on both axis. Add setters for all the behaviour properties.
* clutter/clutter-effect.h:
* clutter/clutter-effect.c (clutter_effect_scale): Split the
final scale factor to match the ClutterBehaviourScale changes. (#709)
* tests/test-actors.c:
* tests/test-effects.c:
* tests/test-rotate.c:
* tests/test-scale.c: Update after API change.
* clutter/NEWS:
Started 0.6.0 section with comment on actor anchor point.
* clutter/clutter/clutter-actor.c:
* clutter/clutter/clutter-actor.h:
* clutter/clutter/clutter-behaviour-scale.c:
* clutter/clutter/clutter-deprecated.h:
(clutter_actor_set_anchor_point):
(clutter_actor_set_anchor_pointu):
(clutter_actor_get_anchor_point):
(clutter_actor_get_anchor_pointu):
(clutter_actor_set_anchor_point_from_gravity):
New anchor point API deprecating old gravity scaling, added
comments on modelview matrix construction to ClutterActor
documentation.
(clutter_actor_set_scale_with_gravity):
(clutter_actor_set_scale_with_gravityx):
Deprecated; use clutter_actor_set_anchor_point_from_gravity() instead.
* clutter/clutter-actor.c:
* clutter/clutter-actor.h:
Add new set_width/height API calls.
Tweak scaling by reseting matrix.
Make set_opactiy() take parent opacity into account.
Fix clipping.
* clutter/clutter-alpha.c:
Add more sine functionality.
* clutter/clutter-behaviour-opacity.c:
Dont make a copy of all applied actors but use a foreach()
* clutter/clutter-behaviour-scale.c:
Give correct limits to propertys.
Tweak gravity a little more.
Update docs.
:
* clutter/clutter-behaviour.c: (clutter_behaviour_remove):
Minor warning text change.
* clutter/clutter-feature.c: (clutter_feature_wait_for_vblank):
Minor dri ioctl tweak.
* clutter/clutter-label.c:
* clutter/clutter-label.h:
Add new label_full api call.
Rework part of the show/hide machinery. Allow groups sub-classes
and composite actors to override show_all/hide_all in order to
decide which children they wish to show/hide. This means that
if an actor overrides the default show/hide virtual methods, it'll
have to chain up to the parent class show/hide. While we're at it,
provide the fully recursive clutter_actor_show_all() and
clutter_actor_hide_all() methods.
* clutter/clutter-behaviour-path.c: Add apidoc for the ClutterKnot
functions; add pathological equality case for clutter_knot_equal().
* clutter/clutter-event.h:
* clutter/clutter-feature.h:
* clutter/clutter-behaviour.c:
* clutter/clutter-behaviour-scale.c:Fix parameters name so that
gtk-doc doesn't complain.
* clutter/clutter-actor.c:
* clutter/clutter-event.c: Add apidoc
* clutter/clutter-actor.h:
* clutter/clutter-actor.c: Add a clutter_actor_show_all() and a
clutter_actor_hide_all() functions; provide a mechanism for
groups and composited actors to programmatically select what to
show/hide when clutter_actor_show_all() and clutter_actor_hide_all()
are called. If you are overriding the ClutterActor::show or
the ClutterActor::hide virtual methods you should chain up with
the parent class.
* clutter/clutter-group.c: Override show_all and hide_all and
recursively show/hide every child inside the group;
clutter_group_show_all() and clutter_group_hide_all() remain as non
recursive versions of clutter_actor_show_all() and
clutter_actor_hide_all() (maybe we should rename them in order
to avoid name clashes with the bindings).
* clutter/clutter-stage.c:
* clutter/clutter-texture.c: Chain up with parent class show
and hide vfuncs.
* clutter/clutter-clone-texture.h:
* clutter/clutter-clone-texture.c: Provide API for changing the
parent texture of a clone texture actor.
* examples/behave.c:
* examples/super-oh.c:
* examples/test.c: Use clutter_actor_show_all() instead of
clutter_group_show_all().
* clutter/clutter-behaviour.h: Add a function prototype
for the foreach function: we need something more specific
than GFunc; add clutter_behaviour_get_actors(), used to
get a list of the actors.
* clutter/clutter-behaviour.c: Add debugging notes; add
a warning for behaviour implementations missing the
alpha_notify vfunc; add api documentation
* clutter/clutter-behaviour-opacity.c:
* clutter/clutter-behaviour-path.c:
* clutter/clutter-behaviour-scale.c: Reimplement the
alpha_notify functions using the new foreach function
and, where possible, by directly iterating on the
actors: this shaves off the number of recalculations
of the property/alpha values, and the number of
functions.
* clutter/clutter-private.h: Add our own READABLE,
WRITABLE and READWRITE paramspec flags, declaring the
string components of the properties GParamSpec as static;
this should shave off some bytes in the memory footprint
and avoid relocations.
* clutter/clutter-actor.c:
* clutter/clutter-behaviour.c:
* clutter/clutter-behaviour-opacity.c:
* clutter/clutter-behaviour-path.c:
* clutter/clutter-behavuour-scale.c:
* clutter/clutter-clone-texture.c:
* clutter/clutter-label.c:
* clutter/clutter-rectangle.c:
* clutter/clutter-stage.c:
* clutter/clutter-texture.c:
* clutter/clutter-timeline.c: Use the CLUTTER_PARAM_*
macros we just added.
* clutter/clutter-behaviour-scale.c: Add properties for
the scale begin, scale end and gravity parameters.
* clutter/clutter-behaviour-path.h: Mark the ClutterKnot
memory management functions as public (for the bindings),
since we use the slice allocator for copying knots around;
add a clutter_knot_equal() function.
* clutter/clutter-behaviour-path.c:
(node_distance): Use clutter_knot_equal() as a fast path
to avoid the sqrt() in case the nodes we are using are
at the same position.
(path_total_length): Additional check on the existence
of the next node.
* examples/behave.c: Do not leak the ClutterBehaviour
objects around.
* clutter/clutter-actor.c:
* clutter/clutter-alpha.c:
* clutter/clutter-behaviour-opacity.c:
* clutter/clutter-behaviour-scale.c:
* clutter/clutter-clone-texture.c:
* clutter/clutter-feature.c:
* clutter/clutter-label.c:
* clutter/clutter-main.c:
* clutter/clutter-stage.c:
* clutter/clutter-texture.c
* clutter/clutter-timeline.c:
* clutter/clutter-debug.h:
Make CLUTTER_NOTE() just take a string rather than a func.
Add more default context to output.
* configure.ac:
Fix flag and add more help docs for --ebable-debug option.
* configure.ac: Enable debug messages also when
--enable-debug is set to "minimum".
* clutter/Makefile.am:
* clutter/clutter-debug.h: Move all debugging macros inside
this private header; make all debug macros depend on the
CLUTTER_ENABLE_DEBUG compile time define, controlled by
the --enable-debug configure switch; add G_LOG_DOMAIN define.
* clutter/clutter-main.c: Clean up the debug stuff; add
command line argument parsing using GOption; the debug
messages now are triggered like this:
CLUTTER_DEBUG=section:section:... clutter-app
or like this:
clutter-app --clutter-debug=section:section:...
where "section" is one of the sections listed in clutter-main.c,
or "all", for all sections; each section is bound to a flag,
which can be used to define a domain when adding a debug note
using the CLUTTER_NOTE() macro; the old CLUTTER_DBG() macro is
just a wrapper around that, under the CLUTTER_DEBUG_MISC domain;
CLUTTER_NOTE() is used like this:
CLUTTER_NOTE (DOMAIN, log-function);
where log function is g_printerr(), g_message(), g_warning(),
g_critical() or directly g_log() - for instance:
CLUTTER_NOTE (PANGO, g_warning ("Cache miss: %d", glyph));
will print the warning only if the "pango" flag has been
set to the CLUTTER_DEBUG envvar or passed to the --clutter-debug
command line argument.
similar to CLUTTER_SHOW_FPS, there's also the --clutter-show-fps
command line switch; also, the --display and --screen command
line switches have been added: the first overrides the DISPLAY
envvar and the second controls the X screen used by Clutter to
get the root window on the display.
* clutter/clutter-main.h:
* clutter/clutter-main.c: Add extended support for GOption
in Clutter; use clutter_init_with_args() to let Clutter
parse your own command line arguments; use instead
clutter_get_option_group() to get the GOptionGroup used by
Clutter if you want to do the parsing yourself with
g_option_context_parse(). The init sequence has been verified,
updated and moved into common functions where possible.
* clutter/pango/pangoclutter-render.c:
* clutter/*.c: Include "clutter-debug.h" where needed; use
CLUTTER_NOTE() instead of CLUTTER_DBG().
* examples/super-oh.c: Use the new clutter_init_with_args()
function, and add a --num-hands command line switch to
the SuperOH example code controlling the number of hands at
runtime.
* clutter/clutter-behaviour-path.h:
* clutter/clutter-behaviour-path.c: Add a "knot-reached" signal,
which is emitted when the path reaches a node in the nodes list;
flesh out the documentation a bit; sync the parameters names
so that gtk-doc doesn't complain about missing stuff.
* clutter/clutter-behaviour.h:
* clutter/clutter-behaviour.c: Add the alpha value to the
ClutterBehaviour::alpha_notify vfunc, so you don't have to
get the value from the alpha inside the behaviour implementations;
add more documentation.
* clutter/clutter-alpha.c: Flesh out the description.
* clutter/clutter-actor.h: Update the header.
* clutter/clutter-behaviour-opacity.c:
* clutter/clutter-behaviour-scale.c: Update docs.
* clutter/clutter-alpha.h:
* clutter/clutter-alpha.c: Add a data parameter to
the ClutterAlphaFunc; add a data+destroy parameter
to clutter_alpha_set_func() and to clutter_alpha_new(),
and turned the latter into clutter_alpha_new_full();
add a simple, empty constructor clutter_alpha_new().
These changes makes writing bindings a tad more easy,
as bindings require passing their own functions in
order to call the real alpha function.
* clutter/clutter-behaviour.h: Clean up the header.
* clutter/clutter-behaviours.[ch]:
* clutter/clutter-behaviour-opacity.[ch]:
* clutter/clutter-behaviour-path.[ch]:
* clutter/clutter-behaviour-scale.[ch]: Split the
ClutterBehaviourPath, ClutterBehaviourOpacity and
ClutterBehaviourScale into their own files as they
have been growing a bit. Fix ClutterBehaviourPath
API.
* clutter/clutter-media.h: Remove the commented
"metadata_available" signal: gtk-doc chokes up on that.
* clutter/clutter-timeline.h:
* clutter/clutter-timeline.c: Remove the useless
ClutterTimelineAlphaFunc signature; add missing accessor
methods for the properties; clean up a bit.
* clutter/clutter-util.h:
* clutter/clutter-util.c: Remove unneeded function
clutter_util_can_create_texture().
* clutter/clutter-feature.h: Sync the name of
clutter_feature_get_all() with the name declared
in clutter-feature.h.
* clutter/Makefile.am:
* clutter/clutter.h: Update.
* examples/behave.c: Update to the new ClutterAlpha
constructor.
* examples/super-oh.c: Use the right pointer and avoid
the compiler making a fuss about it.