diff --git a/doc/cookbook/clutter-cookbook.xml b/doc/cookbook/clutter-cookbook.xml
index bd3a0d1f7..2927f5065 100644
--- a/doc/cookbook/clutter-cookbook.xml
+++ b/doc/cookbook/clutter-cookbook.xml
@@ -43,9 +43,9 @@
Cookbook: approaching a programming problem is oftentimes
similar to balancing Columbus's egg. The initial difficulties of dealing
with, and more importantly solving, problems in the computer programming
- field sometimes can sometimes only be overcome if somebody shows you how
- to use a new tool. This is true for programming languages but also for
- programming libraries.
+ field sometimes can only be overcome if somebody shows you how to use a
+ new tool. This is true for programming languages but also for programming
+ libraries.
This book has been written to try and give you a reference on
how to solve common issues that you might have to face when using
@@ -65,16 +65,16 @@
Above all, this is a book for learning more
about Clutter, and about how to use it in the most efficient and easiest
- way. It is meant to help you move past the basic usage of Clutter
+ way. It is meant to help you move past the basic usage of Clutter.
This book is divided into chapters. Each chapter is dedicated to
- a specific class, or a specific area. Each chapter starts with a short
- introduction, followed by different recipes. Each
- recipe has a problem, as a short statement describing what we want to
- achieve; a solution, containing the source code; and a discussion
- section, where the code is explained, where alternative approaches might
- be usefule, caveats and references to the Clutter API for furher
- studying.
+ a specific class, like ClutterTexture, or a specific area, like animations.
+ Each chapter starts with a short introduction, followed by different
+ recipes. Each recipe starts with a problem, or a short
+ statement describing what we want to achieve; a solution, containing the
+ source code; and a discussion section, where the code is explained, where
+ alternative approaches might be useful, caveats and references to the
+ Clutter API for furher studying.
This book, in the cookbook spirit, can be accessed mostly at
random.
@@ -98,8 +98,10 @@
About this document
- This document is available in various formats like HTML,
- text and PDF. The latest version is always available at
+ This document is available in various formats like HTML, and
+ PDF.
+
+ The latest version is always available at
&docurl;.
@@ -107,18 +109,20 @@
Where to get Clutter
- You can obtain Clutter from &appurl;
- or perhaps from your distributor.
+ You can obtain Clutter from &appurl;.
+
+ Clutter is also available on all major GNU/Linux distributions,
+ in various package formats.
+
+ On OSX, Clutter is available with both Fink and MacPorts.
+
+ Binaries for Microsoft Windows are also available.
License
- Clutter is distributed under the terms of the GNU Lesser General
- Public License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version. A copy
- of this license can be found in the file COPYING included with the
- source code of this program.
+ FIXME
@@ -156,7 +160,7 @@
-
+
Knowing when an actor position or size change
@@ -177,11 +181,14 @@
g_signal_connect (actor, "notify::x",
- G_CALLBACK (on_x_changed), NULL);
+ G_CALLBACK (on_x_changed),
+ NULL);
g_signal_connect (actor, "notify::height",
- G_CALLBACK (on_height_changed), NULL);
+ G_CALLBACK (on_height_changed),
+ NULL);
g_signal_connect (actor, "notify::depth",
- G_CALLBACK (on_depth_changed), NULL);
+ G_CALLBACK (on_depth_changed),
+ NULL);
@@ -193,7 +200,8 @@ g_signal_connect (actor, "notify::depth",
g_signal_connect (actor, "notify::allocation",
- G_CALLBACK (on_allocation_changed), NULL);
+ G_CALLBACK (on_allocation_changed),
+ NULL);
@@ -229,7 +237,7 @@ on_x_changed (GObject *gobject,
{
gint x_value = 0;
- g_object_get (gobject, pspec->name, &x_value, NULL);
+ g_object_get (gobject, pspec->name, &x_value, NULL);
g_print ("The new X coordinate is '%d' pixels\n", x_value);
}
@@ -273,6 +281,63 @@ on_allocation_changed (GObject *gobject,
+
+ Overriding the paint sequence
+
+
+ Problem
+
+ You want to override the way an actor paints itself
+ without creating a subclass.
+
+
+
+ Solution
+
+ You can use the paint signal to
+ invoke a callback that will be executed before the actor's
+ paint implementation:
+
+
+
+g_signal_connect (actor, "paint",
+ G_CALLBACK (on_paint),
+ NULL);
+
+
+
+ You can paint something after the actor's paint implementation
+ by using the g_signal_connect_after() function
+ instead of g_signal_connect():
+
+
+
+g_signal_connect_after (actor, "paint",
+ G_CALLBACK (on_paint_after),
+ NULL);
+
+
+
+ The signature for the handler of the "paint" signal is:
+
+
+
+void
+on_paint (ClutterActor *actor,
+ gpointer user_data);
+
+
+
+
+
+
+
+
+
@@ -289,13 +354,13 @@ on_allocation_changed (GObject *gobject,
introduction
-
+
Maintaining the aspect ratio when loading a texture
Problem
-
+ You want to maintain the aspect ratio of a texture.
@@ -334,19 +399,20 @@ on_allocation_changed (GObject *gobject,
Problem
-
+ You want to have an animation exactly mirroring another one
+ that you just played.
@@ -361,4 +427,29 @@ on_allocation_changed (GObject *gobject,
directory of Clutter.
+
+