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.
Commit eae4561929 tried to clean how it checks for the private actor
flags. However the check for the 'IN_DESTRUCTION' flag in the Win32
backend got inverted so it would always clear the current
context. This was causing _cogl_check_driver_valid to fail later and
then the realize would get stuck in a infinite loop.
When we free a state because there are no more keys with it as a target use a
goto to re-initialize temporary variables that have become invalid.
Fixing bug #2273
In 965907deb3 the picking was changed to render the full stage
instead of a single pixel whenever picking is performed more than once
between paints. However the condition in the if-statement was
backwards so it would end up always doing a full stage render.
The glx and egl(x) backends export some internal symbols. Hide these
symbols (using '_' prefix) to reduce ABI differentiation between the
glx and eglx flavours.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2267
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* 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.
This clarifies the documentation for clutter_actor_queue_redraw to
explain that custom actors should call this whenever some private state
changes that affects painting *or* picking.
The expectation is that actors should call clutter_actor_queue_redraw
when ever some private state changes that affects painting *or* picking.
ClutterTexture was not doing this for pick_with_alpha property changes.
The idea is that if we see multiple picks per frame then that implies
the visible scene has become static. In this case we can promote the
next pick render to be unclipped so we have valid pick values for the
entire stage. Now we can continue to read from this cached buffer until
the stage contents do visibly change.
Thanks to Luca Bruno on #clutter for this idea!
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.
Added a video showing the two texture cross-fade.
Modified the example code to animate on key press, so
this video could be captured.
Also altered the stage size to minimise the video size.
Front/back seems like the wrong terminology when discussing
actors arranged in layers. Top/bottom fits better with Clutter
API function names and other recipes, so renamed variables.
Cross-fading between two images is straightforward,
but cycling between more than two is more efficient
if done by copying COGL textures between the
two textures, rather than trying to reposition the
textures.
The example demonstrates how to reuse a pair of
textures to cycle through multiple images.
Modified the code example for the Clutter API version
of the cross-fade to use the same command line
as the COGL version.
This also simplifies the explanation in the recipe.
Also made the COGL code sample more consistent with
the Clutter API code sample.
Added simple image viewer which loads image file names
from a directory, displays the first one, then displays
the next in the list with each key press. Uses the
primitive fade front in/fade back out approach.
Also adapted Emmanuele's example code which uses Cogl
to produce a similar effect, but within a single texture.
This code loads two images specified on the command
line and cross-fades between them.