Modified the "animation reuse" sample code to provide
a simpler example to explain in the recipe.
Also modified variable names to mirror the names used
for the previous "complex animation" example and added
some more comments, to further simplify and support the
recipe.
With some help from pippin, moved variable declarations
into more sensible positions within their functions,
changed a function name, and found a better way
to unref a script once its associated actor has
been destroyed.
Extracted the animation into its own JSON definition,
then create a new script and get the animation each
time a rectangle is clicked.
Removes the need to reparent onto the background and
copy property values to the rectangle after the animation,
and generally much cleaner.
Added an example showing how to reuse a ClutterAnimator
instance to animate multiple actors at different times
using an animatable rig, combined with reparenting.
The keysyms defines in clutter-keysyms.h are generated from the X11 key
symbols headers by doing the equivalent of a pass of sed from XK_* to
CLUTTER_*. This might lead to namespace collisions, down the road.
Instead, we should use the CLUTTER_KEY_* namespace.
This commit includes the script, taken from GDK, that parses the X11
key symbols and generates two headers:
- clutter-keysyms.h: the default included header, with CLUTTER_KEY_*
- clutter-keysyms-compat.h: the compatibility header, with CLUTTER_*
The compat.h header file is included if CLUTTER_DISABLE_DEPRECATED is
not defined - essentially deprecating all the old key symbols.
This does not change any ABI and, assuming that an application or
library is not compiling with CLUTTER_DISABLE_DEPRECATED, the source
compatibility is still guaranteed.
When animating an actor through clutter_actor_animate() and friends we
might want forcibly detach the animation instance from the actor in
order to start a new one - for instance, in response to user
interaction.
Currently, there is no way to do that except in a very convoluted way,
by emitting the ::completed signal and adding a special case in the
signal handlers; this is due to the fact that clutter_actor_animate()
adds more logic than the one added by clutter_animation_set_object(),
so calling set_object(NULL) or unreferencing the animation instance
itself won't be enough.
The right way to approach this is to add a new method to Clutter.Actor
that detaches any eventual Animation currently referencing it.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2051
Uses ClutterAnimator to implement a reasonably complex
animation of a single actor (movement along a path with
simultaneous scaling).
Provides a metaphor for thinking about ClutterAnimator
animations (stage directions) and explains keys and key
frames in some depth. Also compares ClutterAnimator
with other possible approaches to this type of animation
(implicit animations, ClutterState).
Added another JSON example to show how transitions can
be easily overlapped when using ClutterAnimator (two
sequences of 5 transitions, simultaneous with two
sequences of 1 transition).
Modified the C JSON loader program so it can be used with
this example as well.
Intel CE3100 and CE4100 have several planes (framebuffers) and a
hardware blender to blend the planes togeteher to produce the final
image.
clutter_cex100_set_plane() lets you configure which framebuffer clutter
will use for its rendering.
*** This is an API change ***
The create_target() virtual function should return a CoglHandle to a
texture; clutter_offscreen_effect_get_target(), instead, returns a
CoglMaterial to be painted in the implementation of the paint_target()
virtual function.
Instead of equating textures with materials, and confusing the user of
the API, we should mark the difference more prominently.
First of all, we should return a CoglMaterial* (now that we have that
as a public type) in get_target(); having handles all over the place
does not make it easier to distinguish the semantics of the virtual
functions.
Then we should rename create_target() to create_texture(), to make it
clear that what should be returned is a texture that is used as the
backing for the offscreen framebuffer.
Added a recipe explaining how to connect signals to handlers
in the JSON definition used by ClutterScript; also shows
how to connect the signals in code once the JSON has been
loaded.
Includes guidelines on writing handlers (i.e. need to use
-export-dynamic and non-static functions) and example
which connects a handler for motion events on a rectangle.
GEnum nicknames can be used to set properties in JSON
definitions, so added a callout to the JSON example explaining
this, and showing how to derive the nickname for an enumeration
value.
Modified the example code to use nicknames as well.
As JSON can make use of nicknames for GEnum properties,
mentioned this in the table mapping C property values
to their JSON equivalents (as the nick name is a much
shorter and cleaner way of setting a property in JSON).
Wrote an introduction to using ClutterScript with JSON. Focus
is on explaining why you might want to use it, basic principles
of operation (with annotated JSON sample), and how to map
data types from C to JSON.
Written simultaneously with a short recipe (uses the same sample
code) showing how to load a JSON file and retrieve objects
from it in code.
Commented the ClutterScript example so it can be used
inline as part of the recipe, rather than as an
example in the appendix (it's too simple to warrant
a separate appendix).
New script chapter needs an introduction.
While writing the introduction, also slightly changed the
emphasis of the recipe (towards refactoring an existing
application to use ClutterScript) and incorporated example
code into documentation.
Set a parameter on the XSLT transform so that callout elements
are rendered as text rather than graphics (removes the need
to add callout graphics to the build).
There was too much in the example code to cover in a single
recipe, so I trimmed it down to demonstrate simple
UI building (no constraints, effects, animations, or signals).
Added a simple script and program to load it, to support
recipe on ClutterScript for UI definitions.
Also amended the Makefile (following the pattern of
the tests/interactive Makefile) to enable signal
connection from ClutterScript by passing -export-dynamic
to linker.
* elliot/cookbook-textures-crossfade:
cookbook: Use GdkPixbuf instead of getting data from a texture
cookbook: Added a recipe for cross-fading between two images
cookbook: Modified COGL example for consistency
cookbook: Added video of two texture cross-fade
cookbook: Removed unused constant
cookbook: Renamed front/back to top/bottom in cross-fade example
cookbook: Don't need to set keep-aspect-ratio for simple example
cookbook: Modified ordering of statements in cross-fade example
cookbook: Added a longer slideshow example
cookbook: Made code examples more consistent
cookbook: Added example code for texture cross-fading
Post-release version bump to 1.3.13
Release Clutter 1.3.12 (developers snapshot)
Conflicts:
doc/cookbook/examples/Makefile.am
Added a recipe about handling enter, leave, and motion events
on an actor.
Gives some pointers to data available from motion events,
explains a bit about stage-relative and actor-relative coords,
and covers how overlapping actors and reactivity of actors
can affect events occurring.
Examples include a simple scribble app showing how to integrate
pointer events into a more useful context.
Added another example (used for a screenshot) to demonstrate
how pointer events pass through non-reactive actors and how
depth ordering affects whether an actor will emit a pointer
motion signal.
Use clutter_event_get_coords() to get x and y position,
rather than casting to the right event type then directly
accessing members of the event struct.
Decided might be better to cover crossing and motion under
a broader "pointer motion" recipe, so renamed the example
(which only shows pointer crossing event handling).
It can be useful to be able to forcibly break the grab set up by the
ClickAction. The newly added release() method provides a mechanism to
release the grab and unset the :held state of the ClickAction.
Rewrote example for single texture + COGL to use
a GdkPixbuf to load images, rather than reading data
out of another CoglTexture.
The data is then loaded from the pixbuf to a region of
the CoglTexture (as before).
The recipe covers a two texture approach (using the Clutter API)
and a single texture approach (using COGL).
It also discusses issues with cross-fading between images of
different sizes with the COGL API, and gives a longer
example of cycling through multiple images in a slideshow
application.