[cluttermm_tutorial] Update for the latest cluttermm and clutter-gtkmm.



commit 9fc1cb024825a5eb67b45b317c477c788833f02c
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Apr 5 19:57:17 2010 +0200

    Update for the latest cluttermm and clutter-gtkmm.
    
      * configure.ac: Check for clutter-gtkmm-1.0, not clutter-gtkmm-0.9.
    * examples/*/*.[h|cc]: Update for the latest API, based on the changes in
    the corresponding clutter-tutorial examples. This at least builds now
    though I have no idea if the code is correct. We should check more carefully
    against the recent changes in the clutter tutorial.
      * docs/tutorial/cluttermm-tut.xml: Removed the multiline text editing
      appendix, because regular cluttermm can now do this.
    * docs/tutorial/figures/multiline_text_entry.png:
    * examples/multiline_text_entry/: Removed these parts of the example.

 ChangeLog                                        |   16 +-
 INSTALL                                          |  200 ++++++++--
 Makefile.am                                      |    8 +-
 cluttermm_tutorial.doap                          |   17 +
 configure.ac                                     |    2 +-
 docs/tutorial/cluttermm-tut.xml                  |   44 +--
 docs/tutorial/figures/multiline_text_entry.png   |  Bin 19467 -> 0 bytes
 examples/behaviour/main.cc                       |    6 +-
 examples/custom_container/examplebox.cc          |   49 ++-
 examples/custom_container/examplebox.h           |   10 +-
 examples/full_example/main.cc                    |   12 +-
 examples/multiline_text_entry/main.cc            |   59 ---
 examples/multiline_text_entry/multiline_entry.cc |  436 ----------------------
 examples/multiline_text_entry/multiline_entry.h  |   90 -----
 examples/score/main.cc                           |    4 +-
 examples/scrolling/scrollingcontainer.cc         |   30 +-
 examples/scrolling/scrollingcontainer.h          |    2 +-
 examples/stage/main.cc                           |    4 +-
 examples/stage_widget/main.cc                    |    4 +-
 examples/timeline/main.cc                        |    2 +-
 20 files changed, 266 insertions(+), 729 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9fea4bf..55de48e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,22 @@
+2010-04-05  Murray Cumming  <murrayc murrayc com>
+
+  Update for the latest cluttermm and clutter-gtkmm.
+  
+  * configure.ac: Check for clutter-gtkmm-1.0, not clutter-gtkmm-0.9.
+	* examples/*/*.[h|cc]: Update for the latest API, based on the changes in 
+	the corresponding clutter-tutorial examples. This at least builds now 
+	though I have no idea if the code is correct. We should check more carefully 
+	against the recent changes in the clutter tutorial.
+  * docs/tutorial/cluttermm-tut.xml: Removed the multiline text editing 
+  appendix, because regular cluttermm can now do this.
+	* docs/tutorial/figures/multiline_text_entry.png:
+	* examples/multiline_text_entry/: Removed these parts of the example.
+
 2009-03-16  Siavash Safi  <siavash siavashs org>
 
 	* trunk/INSTALL: Autoupdated by autoconf
 	* trunk/Makefile.am: Disabled effects example (should be updated to use
-	Clutter::Animation when t's wrapped)
+	Clutter::Animation when it's wrapped)
 	* trunk/examples/actor/main.cc:
 	* trunk/examples/actor_group/main.cc:
 	* trunk/examples/actor_transformations/main.cc:
diff --git a/INSTALL b/INSTALL
index d3c5b40..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,18 +2,24 @@ Installation Instructions
 *************************
 
 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
+   Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.  This file is offered as-is,
+without warranty of any kind.
 
 Basic Installation
 ==================
 
-Briefly, the shell commands `./configure; make; make install' should
+   Briefly, the shell commands `./configure; make; make install' should
 configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+instructions specific to this package.  Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below.  The lack of an optional feature in a given package is not
+necessarily a bug.  More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -42,7 +48,7 @@ may remove or edit it.
 you want to change it or regenerate `configure' using a newer version
 of `autoconf'.
 
-The simplest way to compile this package is:
+   The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
      `./configure' to configure the package for your system.
@@ -53,12 +59,22 @@ The simplest way to compile this package is:
   2. Type `make' to compile the package.
 
   3. Optionally, type `make check' to run any self-tests that come with
-     the package.
+     the package, generally using the just-built uninstalled binaries.
 
   4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
+     documentation.  When installing into a prefix owned by root, it is
+     recommended that the package be configured and built as a regular
+     user, and only the `make install' phase executed with root
+     privileges.
+
+  5. Optionally, type `make installcheck' to repeat any self-tests, but
+     this time using the binaries in their final installed location.
+     This target does not install anything.  Running this target as a
+     regular user, particularly if the prior `make install' required
+     root privileges, verifies that the installation completed
+     correctly.
+
+  6. You can remove the program binaries and object files from the
      source code directory by typing `make clean'.  To also remove the
      files that `configure' created (so you can compile the package for
      a different kind of computer), type `make distclean'.  There is
@@ -67,15 +83,22 @@ The simplest way to compile this package is:
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
-  6. Often, you can also type `make uninstall' to remove the installed
-     files again.
+  7. Often, you can also type `make uninstall' to remove the installed
+     files again.  In practice, not all packages have tested that
+     uninstallation works correctly, even though it is required by the
+     GNU Coding Standards.
+
+  8. Some packages, particularly those that use Automake, provide `make
+     distcheck', which can by used by developers to test that all other
+     targets like `make install' and `make uninstall' work correctly.
+     This target is generally not run by end users.
 
 Compilers and Options
 =====================
 
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
 
    You can give `configure' initial values for configuration parameters
 by setting variables in the command line or in the environment.  Here
@@ -88,25 +111,41 @@ is an example:
 Compiling For Multiple Architectures
 ====================================
 
-You can compile the package for more than one kind of computer at the
+   You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
 own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'.  This
+is known as a "VPATH" build.
 
    With a non-GNU `make', it is safer to compile the package for one
 architecture at a time in the source code directory.  After you have
 installed the package for one architecture, use `make distclean' before
 reconfiguring for another architecture.
 
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
 Installation Names
 ==================
 
-By default, `make install' installs the package's commands under
+   By default, `make install' installs the package's commands under
 `/usr/local/bin', include files under `/usr/local/include', etc.  You
 can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
@@ -117,16 +156,47 @@ Documentation and other data files still use the regular prefix.
    In addition, if you use an unusual directory layout you can give
 options like `--bindir=DIR' to specify different values for particular
 kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them.  In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+   The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+   The first method involves providing an override variable for each
+affected directory.  For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'.  Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated.  The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+   The second method involves providing the `DESTDIR' variable.  For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names.  The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters.  On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
 
    If the package supports it, you can cause programs to be installed
 with an extra prefix or suffix on their names by giving `configure' the
 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
 
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
+   Some packages pay attention to `--enable-FEATURE' options to
 `configure', where FEATURE indicates an optional part of the package.
 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
 is something like `gnu-as' or `x' (for the X Window System).  The
@@ -138,14 +208,53 @@ find the X include and library files automatically, but if it doesn't,
 you can use the `configure' options `--x-includes=DIR' and
 `--x-libraries=DIR' to specify their locations.
 
+   Some packages offer the ability to configure how verbose the
+execution of `make' will be.  For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+   On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'.  It is recommended to use the following options:
+
+     ./configure --prefix=/boot/common
+
 Specifying the System Type
 ==========================
 
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
 `--build=TYPE' option.  TYPE can either be a short name for the system
 type, such as `sun4', or a canonical name which has the form:
 
@@ -153,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form:
 
 where SYSTEM can have one of these forms:
 
-     OS KERNEL-OS
+     OS
+     KERNEL-OS
 
    See the file `config.sub' for the possible values of each field.  If
 `config.sub' isn't included in this package, then this package doesn't
@@ -171,9 +281,9 @@ eventually be run) with `--host=TYPE'.
 Sharing Defaults
 ================
 
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
 `configure' looks for `PREFIX/share/config.site' if it exists, then
 `PREFIX/etc/config.site' if it exists.  Or, you can set the
 `CONFIG_SITE' environment variable to the location of the site script.
@@ -182,7 +292,7 @@ A warning: not all `configure' scripts look for a site script.
 Defining Variables
 ==================
 
-Variables not defined in a site shell script can be set in the
+   Variables not defined in a site shell script can be set in the
 environment passed to `configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
@@ -201,11 +311,19 @@ an Autoconf bug.  Until the bug is fixed you can use this workaround:
 `configure' Invocation
 ======================
 
-`configure' recognizes the following options to control how it operates.
+   `configure' recognizes the following options to control how it
+operates.
 
 `--help'
 `-h'
-     Print a summary of the options to `configure', and exit.
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
 
 `--version'
 `-V'
@@ -232,6 +350,16 @@ an Autoconf bug.  Until the bug is fixed you can use this workaround:
      Look for the package's source code in directory DIR.  Usually
      `configure' can determine that directory automatically.
 
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
 
diff --git a/Makefile.am b/Makefile.am
index 3c5e3d0..089d3fb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,7 +34,6 @@ noinst_PROGRAMS =	\
 	examples/custom_actor/example		\
 	examples/custom_container/example	\
 	examples/full_example/example		\
-	examples/multiline_text_entry/example	\
 	examples/score/example			\
 	examples/scrolling/example		\
 	examples/stage/example			\
@@ -54,10 +53,6 @@ examples_custom_container_example_SOURCES =	\
 	examples/custom_container/examplebox.h	\
 	examples/custom_container/main.cc
 examples_full_example_example_SOURCES		= examples/full_example/main.cc
-examples_multiline_text_entry_example_SOURCES =		\
-	examples/multiline_text_entry/main.cc		\
-	examples/multiline_text_entry/multiline_entry.cc\
-	examples/multiline_text_entry/multiline_entry.h
 examples_score_example_SOURCES			= examples/score/main.cc
 examples_scrolling_example_SOURCES =		\
 	examples/scrolling/main.cc		\
@@ -100,7 +95,6 @@ dist_figures_DATA =					\
 	docs/tutorial/figures/custom_container.png	\
 	docs/tutorial/figures/effects.png		\
 	docs/tutorial/figures/full_example.png		\
-	docs/tutorial/figures/multiline_text_entry.png	\
 	docs/tutorial/figures/path-alpha-func.png	\
 	docs/tutorial/figures/score.png			\
 	docs/tutorial/figures/scrolling.png		\
@@ -120,7 +114,7 @@ dist_icons_DATA =				\
 	docs/tutorial/icons/warning.png
 
 web_host	= www.openismus.com
-web_path	= /home/murrayc/openismus.com/documents/cluttermm_tutorial/0.9/
+web_path	= /home/openismusadmin/openismus.com/documents/cluttermm_tutorial/1.0/
 web_path_docs	= $(web_path)docs/
 
 clutter_tut_path = $(web_path_docs)tutorial
diff --git a/cluttermm_tutorial.doap b/cluttermm_tutorial.doap
new file mode 100644
index 0000000..c56b674
--- /dev/null
+++ b/cluttermm_tutorial.doap
@@ -0,0 +1,17 @@
+<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
+         xmlns:foaf="http://xmlns.com/foaf/0.1/";
+         xmlns:gnome="http://api.gnome.org/doap-extensions#";
+         xmlns="http://usefulinc.com/ns/doap#";>
+
+  <name xml:lang="en">cluttermm-tutorial</name>
+  <shortdesc xml:lang="en">A C++ tutorial for the cluttermm toolkit</shortdesc>
+  <homepage rdf:resource="http://www.openismus.com/documents/cluttermm_tutorial/"; />
+
+  <maintainer>
+    <foaf:Person>
+      <foaf:name>Murray Cumming</foaf:name>
+      <gnome:userid>murrayc</gnome:userid>
+    </foaf:Person>
+  </maintainer>
+</Project>
diff --git a/configure.ac b/configure.ac
index 80c2dc6..9c4825f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,7 @@ AM_INIT_AUTOMAKE([1.8 -Wall gnu no-define nostdinc])
 AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
 
 AC_PROG_CXX()
-PKG_CHECK_MODULES([TUTORIAL_MODULES], [cluttermm-0.9 >= 0.9.0 clutter-gtkmm-0.9 >= 0.9.0])
+PKG_CHECK_MODULES([TUTORIAL_MODULES], [cluttermm-1.0 >= 0.9.5 clutter-gtkmm-1.0 >= 0.9.0])
 
 AC_LANG([C++])
 
diff --git a/docs/tutorial/cluttermm-tut.xml b/docs/tutorial/cluttermm-tut.xml
index 0fe5e21..ad42439 100644
--- a/docs/tutorial/cluttermm-tut.xml
+++ b/docs/tutorial/cluttermm-tut.xml
@@ -968,45 +968,17 @@ large numbers of rows.</para>
 
 </appendix>
 
-<appendix id="appendix-implementing-text-editing">
-<title>Implementing Text Editing</title>
-
-<sect1>
-<title>The Technique</title>
-
-<para>&cluttermm; provides a <classname>Clutter::Entry</classname> actor for text entry. However,
-this is limited to single lines of text. Therefore you will need to implement your own custom actor
-if you need this functionality with multiple lines of text.</para>
-<para>Like <classname>Clutter::Entry</classname> you can use the Pango API -- specifically the
-<classname>Pango::Layout</classname> object. The <classname>Pango::Layout</classname> can then be
-rendered to the clutter display in your <function>ClutterActor::on_paint()</function> implementation
-by using the <function>cogl_pango_render_layout()</function> utility function.</para>
-</sect1>
-
-<sect1 id="multiline-text-entry-example"><title>Example</title>
-<para>This example has a custom actor, based on the <classname>Clutter::Entry</classname>
-implementation, using a <classname>PangoLayout</classname> to show text wrapped over multiple
-lines.</para>
-<para>Real-world applications will probably want to implement more text-editing features, such as
-the ability to move the cursor vertically, the ability to select and copy sections of text, the
-ability to show and manipulate right-to-left text, etc.</para>
-
-<figure id="figure-multiline-text-entry">
-  <title>Multiline Text Entry</title>
-  <screenshot>
-    <graphic format="PNG" fileref="&url_figures_base;multiline_text_entry.png"/>
-  </screenshot>
-</figure>
-
-<para><ulink url="&url_examples_base;multiline_text_entry">Source code</ulink></para>
-</sect1>
-
-</appendix>
 
 <chapter id="sec-Contributing">
 <title>Contributing</title>
-<para>If you find errors in this documentation or if you would like to contribute additional
-material, you are encouraged to write an email to clutter o-hand com  Thanks.</para>
+<para>
+If you find errors in this documentation or if you would like to contribute additional material, you are
+encouraged to write an email to murrayc openismus com  Thanks.
+</para>
+
+<para>The DocBook and C source code for this documentation is in the <ulink url="http://git.gnome.org/cgit/cluttermm_tutorial/";>cluttermm_tutorial</ulink> module in GNOME's git repository.
+</para>
+
 </chapter>
 
 </book>
diff --git a/examples/behaviour/main.cc b/examples/behaviour/main.cc
index 81b2815..ad0a7d8 100644
--- a/examples/behaviour/main.cc
+++ b/examples/behaviour/main.cc
@@ -37,11 +37,9 @@ static guint32 on_alpha(Glib::RefPtr<Clutter::Alpha> alpha)
 {
   // Get the position in the timeline, so we can base our value upon it:
   const Glib::RefPtr<Clutter::Timeline> timeline = alpha->get_timeline();
-  const int current_frame_num = timeline->get_current_frame();
-  const int n_frames = timeline->get_n_frames();
 
   // Return a value that is simply proportional to the frame position:
-  return Clutter::Alpha::MAX_ALPHA * current_frame_num / n_frames;
+  return timeline->get_progress();
 }
 
 } // anonymous namespace
@@ -67,7 +65,7 @@ int main(int argc, char** argv)
 
   {
     const Glib::RefPtr<Clutter::Timeline>
-      timeline = Clutter::Timeline::create(10 /*frames*/, 30 /*fps*/);
+      timeline = Clutter::Timeline::create(5000 /* milliseconds */);
     timeline->set_loop(true);
     timeline->start();
 
diff --git a/examples/custom_container/examplebox.cc b/examples/custom_container/examplebox.cc
index e46485c..916f864 100644
--- a/examples/custom_container/examplebox.cc
+++ b/examples/custom_container/examplebox.cc
@@ -134,10 +134,17 @@ void Box::hide_all_vfunc()
 
 void Box::pick_vfunc(const Clutter::Color& color)
 {
+  // Call the base class so we get  a bounding box painted (if we are reactive):
+  Clutter::Actor::pick_vfunc(color);
+
+  /* TODO: Do something with the color?
+   * In clutter 0.8 we used it to call clutter_actor_pick() on the children,
+   * but now we call clutter_actor_paint() instead.
+   */
   for(ChildrenList::iterator p = children_.begin(); p != children_.end(); ++p)
   {
     if((*p)->is_mapped())
-      (*p)->pick(color);
+      (*p)->paint();
   }
 }
 
@@ -146,20 +153,20 @@ void Box::pick_vfunc(const Clutter::Color& color)
  * of the children. The preferred width depends on the height provided
  * by for_height.
  */
-void Box::get_preferred_width_vfunc(Clutter::Unit  for_height,
-                                    Clutter::Unit& min_width_p,
-                                    Clutter::Unit& natural_width_p)
+void Box::get_preferred_width_vfunc(float  for_height,
+                                    float& min_width_p,
+                                    float& natural_width_p)
 {
-  Clutter::Unit min_width     = 0;
-  Clutter::Unit natural_width = 0;
+  float min_width     = 0;
+  float natural_width = 0;
 
   // Calculate the preferred width for this container, 
   // based on the preferred width requested by the children.
   for(ChildrenList::iterator p = children_.begin(); p != children_.end(); ++p)
     if((*p)->is_visible())
     {
-      Clutter::Unit child_min_width     = 0;
-      Clutter::Unit child_natural_width = 0;
+      float child_min_width     = 0;
+      float child_natural_width = 0;
 
       (*p)->get_preferred_width(for_height, child_min_width, child_natural_width);
 
@@ -175,20 +182,20 @@ void Box::get_preferred_width_vfunc(Clutter::Unit  for_height,
  * For this container, the preferred height is the maximum height
  * of the children. The preferred height is independent of the given width.
  */
-void Box::get_preferred_height_vfunc(Clutter::Unit  for_width,
-                                     Clutter::Unit& min_height_p,
-                                     Clutter::Unit& natural_height_p)
+void Box::get_preferred_height_vfunc(float  for_width,
+                                     float& min_height_p,
+                                     float& natural_height_p)
 {
-  Clutter::Unit min_height     = 0;
-  Clutter::Unit natural_height = 0;
+  float min_height     = 0;
+  float natural_height = 0;
 
   // Calculate the preferred height for this container,
   // based on the preferred height requested by the children.
   for(ChildrenList::iterator p = children_.begin(); p != children_.end(); ++p)
     if((*p)->is_visible())
     {
-      Clutter::Unit child_min_height     = 0;
-      Clutter::Unit child_natural_height = 0;
+      float child_min_height     = 0;
+      float child_natural_height = 0;
 
       (*p)->get_preferred_height(-1, child_min_height, child_natural_height);
 
@@ -200,16 +207,16 @@ void Box::get_preferred_height_vfunc(Clutter::Unit  for_width,
   natural_height_p = natural_height;
 }
 
-void Box::allocate_vfunc(const Clutter::ActorBox& box, bool absolute_origin_changed)
+void Box::allocate_vfunc(const Clutter::ActorBox& box, Clutter::AllocationFlags absolute_origin_changed)
 {
-  Clutter::Unit child_x = 0;
+  float child_x = 0;
 
   for(ChildrenList::iterator p = children_.begin(); p != children_.end(); ++p)
   {
-    Clutter::Unit min_width    = 0;
-    Clutter::Unit min_height   = 0;
-    Clutter::Unit child_width  = 0;
-    Clutter::Unit child_height = 0;
+    float min_width    = 0;
+    float min_height   = 0;
+    float child_width  = 0;
+    float child_height = 0;
 
     (*p)->get_preferred_size(min_width, min_height, child_width, child_height);
 
diff --git a/examples/custom_container/examplebox.h b/examples/custom_container/examplebox.h
index e784853..d45eb4c 100644
--- a/examples/custom_container/examplebox.h
+++ b/examples/custom_container/examplebox.h
@@ -49,11 +49,11 @@ protected:
   virtual void show_all_vfunc();
   virtual void hide_all_vfunc();
   virtual void pick_vfunc(const Clutter::Color& color);
-  virtual void get_preferred_width_vfunc(Clutter::Unit for_height,
-    Clutter::Unit& min_width_p, Clutter::Unit& natural_width_p);
-  virtual void get_preferred_height_vfunc(Clutter::Unit for_width,
-    Clutter::Unit& min_height_p, Clutter::Unit& natural_height_p);
-  virtual void allocate_vfunc(const Clutter::ActorBox& box, bool absolute_origin_changed);
+  virtual void get_preferred_width_vfunc(float for_height,
+    float& min_width_p, float& natural_width_p);
+  virtual void get_preferred_height_vfunc(float for_width,
+    float& min_height_p, float& natural_height_p);
+  virtual void allocate_vfunc(const Clutter::ActorBox& box, Clutter::AllocationFlags absolute_origin_changed);
 
 private:
   typedef std::list< Glib::RefPtr<Clutter::Actor> > ChildrenList;
diff --git a/examples/full_example/main.cc b/examples/full_example/main.cc
index 10ce381..4152e89 100644
--- a/examples/full_example/main.cc
+++ b/examples/full_example/main.cc
@@ -97,7 +97,7 @@ Example::Example()
   front_item_        (items_.end()),
   stage_             (Clutter::Stage::get_default()),
   label_filename_    (Clutter::Text::create()),
-  timeline_rotation_ (Clutter::Timeline::create(60 /*frames*/, 30 /*fps*/))
+  timeline_rotation_ (Clutter::Timeline::create(2000 /* milliseconds */))
 {
   stage_->set_size(800, 600);
   stage_->set_color(Clutter::Color(0xB0, 0xB0, 0xB0, 0xFF)); // light gray
@@ -232,7 +232,7 @@ void Example::on_timeline_rotation_completed()
 
   // Transform the image:
   const Glib::RefPtr<Clutter::Actor> actor = front_item_->texture;
-  timeline_moveup_ = Clutter::Timeline::create(60 /*frames*/, 30 /*fps*/);
+  timeline_moveup_ = Clutter::Timeline::create(1000 /* milliseconds */);
   const Glib::RefPtr<Clutter::Alpha> alpha =
       Clutter::Alpha::create(timeline_moveup_, CLUTTER_EASE_OUT_SINE);
  
@@ -325,13 +325,7 @@ void Example::rotate_item_to_front(std::list<Item>::iterator pitem)
     angle_start += angle_step;
   }
 
-  // Set the number of frames to be proportional to the distance to travel,
-  // so the speed is always the same:
-#if 0 /* TODO: This value is never used. */
-  const int pos_to_move = (pos_front < pos) ? items_.size() + (pos - pos_front)
-                                            : pos_front - pos;
-#endif
-  timeline_rotation_->set_n_frames(angle_diff);
+  timeline_rotation_->set_duration(angle_diff * 0.2);
 
   // Remember what item will be at the front when this timeline finishes:
   front_item_ = pitem;
diff --git a/examples/score/main.cc b/examples/score/main.cc
index 4d7d49b..b111b71 100644
--- a/examples/score/main.cc
+++ b/examples/score/main.cc
@@ -90,13 +90,13 @@ int main(int argc, char** argv)
   score->set_loop(true);
 
   const Glib::RefPtr<Clutter::Timeline>
-    timeline_rotation = Clutter::Timeline::create(200 /*frames*/, 120 /*fps*/);
+    timeline_rotation = Clutter::Timeline::create(5000 /* milliseconds */);
   timeline_rotation->signal_new_frame()
     .connect(sigc::bind(&on_timeline_rotation_new_frame, timeline_rotation));
   score->append(timeline_rotation);
 
   const Glib::RefPtr<Clutter::Timeline>
-    timeline_move = Clutter::Timeline::create(200 /*frames*/, 120 /*fps*/);
+    timeline_move = Clutter::Timeline::create(5000 /* milliseconds */);
   timeline_move->signal_new_frame()
     .connect(sigc::bind(&on_timeline_move_new_frame, timeline_move));
   score->append(timeline_rotation, timeline_move);
diff --git a/examples/scrolling/scrollingcontainer.cc b/examples/scrolling/scrollingcontainer.cc
index 2198da9..fa4f219 100644
--- a/examples/scrolling/scrollingcontainer.cc
+++ b/examples/scrolling/scrollingcontainer.cc
@@ -22,21 +22,21 @@ namespace
 {
 
 static void allocate_child(const Glib::RefPtr<Clutter::Actor>& actor,
-  int& child_x, bool absolute_origin_changed)
+  int& child_x, Clutter::AllocationFlags absolute_origin_changed)
 {
-  Clutter::Unit min_width  = 0;
-  Clutter::Unit min_height = 0;
-  Clutter::Unit width      = 0;
-  Clutter::Unit height     = 0;
+  float min_width  = 0;
+  float min_height = 0;
+  float width      = 0;
+  float height     = 0;
 
   actor->get_preferred_size(min_width, min_height, width, height);
 
-  const Clutter::ActorBox child_box (CLUTTER_UNITS_FROM_DEVICE(child_x), 0,
-    CLUTTER_UNITS_FROM_DEVICE(child_x) + width, height);
+  const Clutter::ActorBox child_box (child_x, 0,
+    child_x + width, height);
 
   actor->allocate(child_box, absolute_origin_changed);
 
-  child_x += CLUTTER_UNITS_TO_DEVICE(width);
+  child_x += width;
 }
 
 } // anonymous namespace
@@ -155,16 +155,14 @@ void ScrollingContainer::hide_all_vfunc()
 
 void ScrollingContainer::pick_vfunc(const Clutter::Color& color)
 {
-  if(border_->is_mapped())
-    border_->pick(color);
-
-  children_->pick(color);
+  // Call the base class so we get a bounding box painted (if we are reactive):
+  Clutter::Actor::pick_vfunc(color);
 }
 
-void ScrollingContainer::allocate_vfunc(const Clutter::ActorBox& box, bool absolute_origin_changed)
+void ScrollingContainer::allocate_vfunc(const Clutter::ActorBox& box, Clutter::AllocationFlags absolute_origin_changed)
 {
-  const Clutter::Unit width  = std::max<Clutter::Unit>(0, box.get_x2() - box.get_x1());
-  const Clutter::Unit height = std::max<Clutter::Unit>(0, box.get_y2() - box.get_y1());
+  const float width  = std::max<float>(0, box.get_x2() - box.get_x1());
+  const float height = std::max<float>(0, box.get_y2() - box.get_y1());
 
   Clutter::ActorBox child_box (0, 0, width, height);
 
@@ -172,7 +170,7 @@ void ScrollingContainer::allocate_vfunc(const Clutter::ActorBox& box, bool absol
   children_->allocate(child_box, absolute_origin_changed);
 
   // Make sure that the group only shows the specified area, by clipping:
-  children_->set_clip(0, 0, CLUTTER_UNITS_TO_DEVICE(width), CLUTTER_UNITS_TO_DEVICE(height));
+  children_->set_clip(0, 0, width, height);
 
   // Show a rectangle border to show the area:
   border_->allocate(child_box, absolute_origin_changed);
diff --git a/examples/scrolling/scrollingcontainer.h b/examples/scrolling/scrollingcontainer.h
index f778544..cd9401c 100644
--- a/examples/scrolling/scrollingcontainer.h
+++ b/examples/scrolling/scrollingcontainer.h
@@ -49,7 +49,7 @@ protected:
   virtual void show_all_vfunc();
   virtual void hide_all_vfunc();
   virtual void pick_vfunc(const Clutter::Color& color);
-  virtual void allocate_vfunc(const Clutter::ActorBox& box, bool absolute_origin_changed);
+  virtual void allocate_vfunc(const Clutter::ActorBox& box, Clutter::AllocationFlags absolute_origin_changed);
 
 private:
   Glib::RefPtr<Clutter::Rectangle> border_;
diff --git a/examples/stage/main.cc b/examples/stage/main.cc
index e6781f2..6ea6b85 100644
--- a/examples/stage/main.cc
+++ b/examples/stage/main.cc
@@ -23,8 +23,8 @@ namespace
 
 bool on_stage_button_press(Clutter::ButtonEvent* event)
 {
-  int x = 0;
-  int y = 0;
+  float x = 0;
+  float y = 0;
   // TODO: Wrap properly
   clutter_event_get_coords(reinterpret_cast<Clutter::Event*>(event), &x, &y);
 
diff --git a/examples/stage_widget/main.cc b/examples/stage_widget/main.cc
index ad6d4bb..a573e82 100644
--- a/examples/stage_widget/main.cc
+++ b/examples/stage_widget/main.cc
@@ -75,8 +75,8 @@ void StageWindow::on_button_clicked()
 
 bool StageWindow::on_stage_button_press(Clutter::ButtonEvent* event)
 {
-  int x = 0;
-  int y = 0;
+  float x = 0;
+  float y = 0;
   // TODO: Wrap properly
   clutter_event_get_coords(reinterpret_cast<Clutter::Event*>(event), &x, &y);
 
diff --git a/examples/timeline/main.cc b/examples/timeline/main.cc
index 162a428..fee8c22 100644
--- a/examples/timeline/main.cc
+++ b/examples/timeline/main.cc
@@ -68,7 +68,7 @@ int main(int argc, char** argv)
   stage->show();
 
   const Glib::RefPtr<Clutter::Timeline>
-    timeline = Clutter::Timeline::create(10 /*frames*/, 120 /*fps*/);
+    timeline = Clutter::Timeline::create(5000 /* milliseconds */);
   timeline->signal_new_frame()
     .connect(sigc::bind(&on_timeline_new_frame, timeline));
   timeline->set_loop(true); 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]