--- clutter-1.0-1.2.12.orig/debian/libclutter-1.0-0.install +++ clutter-1.0-1.2.12/debian/libclutter-1.0-0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/*.so.* --- clutter-1.0-1.2.12.orig/debian/libclutter-1.0-doc.links +++ clutter-1.0-1.2.12/debian/libclutter-1.0-doc.links @@ -0,0 +1,2 @@ +usr/share/gtk-doc/html/clutter usr/share/doc/libclutter-doc/html +usr/share/gtk-doc/html/cogl usr/share/doc/libclutter-doc/html-cogl --- clutter-1.0-1.2.12.orig/debian/libclutter-1.0-dev.examples +++ clutter-1.0-1.2.12/debian/libclutter-1.0-dev.examples @@ -0,0 +1,2 @@ +tests/*.c +tests/*.png --- clutter-1.0-1.2.12.orig/debian/control.in +++ clutter-1.0-1.2.12/debian/control.in @@ -0,0 +1,94 @@ +Source: clutter-1.0 +Section: libs +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Ross Burton +Uploaders: @GNOME_TEAM@ +Build-Depends: debhelper (>= 5), + cdbs (>= 0.4.41), + gnome-pkg-tools, + libgl1-mesa-dev | libgl-dev, + libgtk2.0-dev, + libcairo2-dev (>= 1.4), + libpango1.0-dev (>= 1.20), + libglib2.0-dev (>= 2.16), + libjson-glib-dev (>= 0.8), + gtk-doc-tools, + libgirepository1.0-dev (>= 0.6.3), + gobject-introspection (>= 0.6.5-3), + gir1.0-freedesktop (>= 0.6.3), + gir1.0-glib-2.0, + gir1.0-gtk-2.0, + gir-repository-dev, + gir1.0-json-glib-1.0 +Standards-Version: 3.8.3 + +Package: libclutter-1.0-0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends} +Description: Open GL based interactive canvas library + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + +Package: libclutter-1.0-dev +Section: libdevel +Architecture: any +Depends: libclutter-1.0-0 (= ${binary:Version}), + libgtk2.0-dev, + libgl1-mesa-dev|libgl-dev, + libjson-glib-dev (>= 0.8), + ${misc:Depends}, + ${shlibs:Depends} +Recommends: pkg-config +Suggests: libclutter-1.0-doc +Description: Open GL based interactive canvas library (development files) + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + . + This package contains the development files. + +Package: libclutter-1.0-dbg +Section: debug +Priority: extra +Architecture: any +Depends: libclutter-1.0-0 (= ${binary:Version}), + ${misc:Depends} +Description: Open GL based interactive canvas library (debug files) + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + . + This package contains the debug files. + +Package: libclutter-1.0-doc +Section: doc +Architecture: all +Depends: ${misc:Depends} +Suggests: devhelp +Conflicts: libclutter-0.1-doc, libclutter-doc +Replaces: libclutter-0.1-doc +Description: Open GL based interactive canvas library (documentation) + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + . + This package contains the documentation. + +Package: gir1.0-clutter-1.0 +Section: libs +Architecture: any +Depends: ${gir:Depends}, + ${shlibs:Depends}, + ${misc:Depends} +Conflicts: libclutter-1.0-0 (<< 1.0.8) +Replaces: libclutter-1.0-0 (<< 1.0.8) +Description: GObject introspection data for the Clutter 1.0 library + This package contains introspection data for the Clutter scene + graph library. + . + It can be used by packages using the GIRepository format to generate + dynamic bindings. --- clutter-1.0-1.2.12.orig/debian/watch +++ clutter-1.0-1.2.12/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://www.clutter-project.org/sources/clutter/([\d.]+[02468])/clutter-(.*)\.tar\.gz --- clutter-1.0-1.2.12.orig/debian/rules +++ clutter-1.0-1.2.12/debian/rules @@ -0,0 +1,27 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/gnome.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk +include /usr/share/cdbs/1/rules/utils.mk +include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk +-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk + +GNOME_MODULE = clutter +GNOME_DOWNLOAD_URL = http://www.clutter-project.org/sources/clutter/$(DEB_UPSTREAM_VERSION_MAJOR_MINOR)/$(GNOME_TARBALL) + +LDFLAGS += -Wl,-O1 -Wl,--as-needed +DEB_COMPRESS_EXCLUDE += .c +DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc \ + --enable-introspection=yes \ + --with-json=system + +#CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) +#ifeq ($(CPU),arm) +#CFLAGS += -march=armv5t +#endif + +$(patsubst %,binary-predeb/%,$(DEB_ALL_PACKAGES)) :: + dh_girepository -p$(cdbs_curpkg) + +common-binary-predeb-arch:: list-missing --- clutter-1.0-1.2.12.orig/debian/libclutter-1.0-dev.install +++ clutter-1.0-1.2.12/debian/libclutter-1.0-dev.install @@ -0,0 +1,4 @@ +debian/tmp/usr/lib/*.so +debian/tmp/usr/lib/pkgconfig/ +debian/tmp/usr/include/ +debian/tmp/usr/share/gir-1.0/ --- clutter-1.0-1.2.12.orig/debian/control +++ clutter-1.0-1.2.12/debian/control @@ -0,0 +1,99 @@ +# This file is autogenerated. DO NOT EDIT! +# +# Modifications should be made to debian/control.in instead. +# This file is regenerated automatically in the clean target. + +Source: clutter-1.0 +Section: libs +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Ross Burton +Uploaders: Debian GNOME Maintainers , Emilio Pozuelo Monfort , Gustavo Noronha Silva +Build-Depends: debhelper (>= 5), + cdbs (>= 0.4.41), + gnome-pkg-tools, + libgl1-mesa-dev | libgl-dev, + libgtk2.0-dev, + libcairo2-dev (>= 1.4), + libpango1.0-dev (>= 1.20), + libglib2.0-dev (>= 2.16), + libjson-glib-dev (>= 0.8), + gtk-doc-tools, + libgirepository1.0-dev (>= 0.6.3), + gobject-introspection (>= 0.6.5-3), + gir1.0-freedesktop (>= 0.6.3), + gir1.0-glib-2.0, + gir1.0-gtk-2.0, + gir-repository-dev, + gir1.0-json-glib-1.0 +Standards-Version: 3.8.3 + +Package: libclutter-1.0-0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends} +Description: Open GL based interactive canvas library + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + +Package: libclutter-1.0-dev +Section: libdevel +Architecture: any +Depends: libclutter-1.0-0 (= ${binary:Version}), + libgtk2.0-dev, + libgl1-mesa-dev|libgl-dev, + libjson-glib-dev (>= 0.8), + ${misc:Depends}, + ${shlibs:Depends} +Recommends: pkg-config +Suggests: libclutter-1.0-doc +Description: Open GL based interactive canvas library (development files) + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + . + This package contains the development files. + +Package: libclutter-1.0-dbg +Section: debug +Priority: extra +Architecture: any +Depends: libclutter-1.0-0 (= ${binary:Version}), + ${misc:Depends} +Description: Open GL based interactive canvas library (debug files) + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + . + This package contains the debug files. + +Package: libclutter-1.0-doc +Section: doc +Architecture: all +Depends: ${misc:Depends} +Suggests: devhelp +Conflicts: libclutter-0.1-doc, libclutter-doc +Replaces: libclutter-0.1-doc +Description: Open GL based interactive canvas library (documentation) + Clutter is an Open GL based interactive canvas library, designed for creating + fast, mainly 2D single window applications such as media box UIs, + presentations, kiosk style applications and so on. + . + This package contains the documentation. + +Package: gir1.0-clutter-1.0 +Section: libs +Architecture: any +Depends: ${gir:Depends}, + ${shlibs:Depends}, + ${misc:Depends} +Conflicts: libclutter-1.0-0 (<< 1.0.8) +Replaces: libclutter-1.0-0 (<< 1.0.8) +Description: GObject introspection data for the Clutter 1.0 library + This package contains introspection data for the Clutter scene + graph library. + . + It can be used by packages using the GIRepository format to generate + dynamic bindings. --- clutter-1.0-1.2.12.orig/debian/libclutter-1.0-doc.install +++ clutter-1.0-1.2.12/debian/libclutter-1.0-doc.install @@ -0,0 +1,2 @@ +debian/tmp/usr/share/gtk-doc/html/cogl +debian/tmp/usr/share/gtk-doc/html/clutter --- clutter-1.0-1.2.12.orig/debian/changelog +++ clutter-1.0-1.2.12/debian/changelog @@ -0,0 +1,277 @@ +clutter-1.0 (1.2.12-0ubuntu3) maverick; urgency=low + + * debian/control.in: + - -dev package should depend on libjson-glib-dev as well + + -- Didier Roche Fri, 06 Aug 2010 13:26:59 +0200 + +clutter-1.0 (1.2.12-0ubuntu2) maverick; urgency=low + + * debian/patches/01_fix_motion_events.patch, + 02__fix_SIGSEGV_clutter_stage_has_full_redraw_queued.patch: + removed, included in 01_speed_current_position_detection.patch + * debian/patches/01_speed_current_position_detection.patch: + Improve the detection of current mouse position + * debian/rules: + - Use external json-glib (LP: #613927) + * debian/control.in: + - build-dep on libjson-glib-dev + + -- Didier Roche Fri, 23 Jul 2010 16:03:16 +0200 + +clutter-1.0 (1.2.12-0ubuntu1) maverick; urgency=low + + * New upstream release + - Provide a fallback for MESA_copy_sub_buffer by using the + EXT_blit_framebuffer extension. (BCP#2128) + - Never promote clipped redraws to fullscreen redraws. (BCP#2136) + - Fix rounding error in ClutterText. (BCP#2170) + - Fix drawing of transparent stages on X11. (BCP#2050) + - ClutterAnimator bug fixes. + - ClutterAnimation fixes for vector-based API. (BCP#2149) + - Fixes for the Windows backend event handling. (BCP#2135) + - Fixes for the setup of the GL context on OSX. (BCP#1394) + - Documentation improvements. (BCP#2081, BCP#2133) + - Build fixes for the conformance test suite. (BCP#1930) + + -- Didier Roche Thu, 15 Jul 2010 11:48:06 +0200 + +clutter-1.0 (1.2.10-0ubuntu2) maverick; urgency=low + + * debian/patches/02_fix_SIGSEGV_clutter_stage_has_full_redraw_queued.patch: + Ensure that the stage is really a clutter stage before going further + (Jason Smith) (LP: #594209) + + -- Didier Roche Mon, 12 Jul 2010 15:53:18 +0200 + +clutter-1.0 (1.2.10-0ubuntu1) maverick; urgency=low + + * New upstream release + * debian/control.in: + - add gir1.0-json-glib-1.0 build-dep + + -- Didier Roche Mon, 05 Jul 2010 11:52:36 +0200 + +clutter-1.0 (1.2.4-0ubuntu1) lucid; urgency=low + + * New upstream release: + - Revert patch for bug 2017 which broke subclassing ClutterListModel + - Add more error reporting in case the GLX context creation failed + - Fix cogl_texture_get_data() returning garbage + - Fix the computation of the stage bounding rectangle when submitting + clipped redraw requests + - Switch texture units before setting the Cogl texture filters + - Make sure that GLX_SGI_swap_control is set up correctly + * debian/patches/01_fix_motion_events.patch: + - Set a default stage for motion events if one isn't available + (Neil J. Patel) + + -- Didier Roche Thu, 25 Mar 2010 14:16:07 +0100 + +clutter-1.0 (1.2.2-1ubuntu1) lucid; urgency=low + + * Merge from debian experimental, remaining changes: + - comment out the enforced building for armv5t in debian/rules, ubuntu + does not support v5t anymore (fixes FTBFS on armel). + * don't build with json support (will mean deps update): + - debian/rules: remove --enable-json + - debian/control.in: remove libjson-glib-dev (>= 0.8) and + gir1.0-json-glib-1.0 build-dep + + -- Didier Roche Tue, 23 Mar 2010 20:19:50 +0100 + +clutter-1.0 (1.2.2-1) experimental; urgency=low + + [ Gustavo Noronha Silva ] + * debian/control: + - bump Standards-Version to 3.8.3 + + [ Emilio Pozuelo Monfort ] + * New upstream release. + - Build depend on libjson-glib-dev and gir1.0-json-glib-1.0. + * debian/control.in, + debian/rules: + - GNOMEify. + + -- Emilio Pozuelo Monfort Sun, 21 Mar 2010 13:27:56 +0100 + +clutter-1.0 (1.0.8-1) unstable; urgency=low + + * New upstream release + * debian/control: + - adopt new GObject-Introspection mini-policy, by build-depending on + gobject-introspection >= 0.6.5-3, and using the new gir1.0-* packages + * debian/control, libclutter-1.0-0.install, gir1.0-clutter-1.0.install: + - add new package for the typelib files + * debian/rules: + - make dh_girepository be called on the packages + + -- Gustavo Noronha Silva Mon, 19 Oct 2009 13:55:06 -0200 + +clutter-1.0 (1.0.6-1) unstable; urgency=low + + * New upstream release + + -- Gustavo Noronha Silva Wed, 30 Sep 2009 19:25:03 +0100 + +clutter-1.0 (1.0.0-1) unstable; urgency=low + + [ Loïc Minier ] + * Downgrade pkg-config dep to a recommends. + * Update download URL in copyright. + * Use LDFLAGS/CFLAGS vars directly to avoid overriding them completely; bdep + on cdbs >= 0.4.41. + * Wrap build-deps and deps. + * Let libclutter-0.8-dev dep on ${shlibs:Depends}. + * Bdep on libpango1.0-dev (>= 1.18) and libglib2.0-dev (>= 2.14) + explicitly. + * Cleanup rules. + * Use CDBS gnome.mk class instead of autotools. + + [ Gustavo Noronha Silva ] + * New stable upstream release + * Updated build-dependencies according to upstream's configure.ac + * Build-Depend on cairo explicitly + * debian/control: + - make the doc package clutter-version-specific (libclutter-1.0-doc), + and make it conflict with libclutter-doc + * debian/copyright: + - fixed and updated information with recent copyright changes + + -- Gustavo Noronha Silva Thu, 30 Jul 2009 12:48:00 +0200 + +clutter (0.8.8-1) unstable; urgency=low + + * New upstream release. + * Ship the COGL documentation + * Clean up minor lintian warnings + + -- Ross Burton Fri, 19 Jun 2009 11:38:03 +0100 + +clutter (0.8.4-1) unstable; urgency=low + + * New upstream release + - Fixes linking (Closes: #498506) + + -- Ross Burton Mon, 01 Dec 2008 14:46:24 +0000 + +clutter (0.8.2-1) unstable; urgency=low + + * New upstream release. + + -- Rob Bradford Fri, 26 Sep 2008 16:09:31 +0100 + +clutter (0.8.0-1) unstable; urgency=low + + * New upstream release. + + -- Rob Bradford Sat, 12 Jul 2008 21:34:06 +0100 + +clutter (0.6.4-1) unstable; urgency=low + + * New upstream release. + + -- Rob Bradford Sun, 29 Jun 2008 21:30:53 +0100 + +clutter (0.6.2-2) unstable; urgency=low + + * Switch to using -march=armv5t when compiling on ARM (closes: #478152.) + + -- Rob Bradford Mon, 19 May 2008 15:30:29 +0100 + +clutter (0.6.2-1) unstable; urgency=low + + * New upstream release. + + -- Rob Bradford Thu, 03 Apr 2008 15:08:09 +0100 + +clutter (0.6.0-2) unstable; urgency=low + + * Switch dependency to libgl1-mesa-dev|libgl-dev rather than + just libgl1-mesa-dev so that it does not conflict with other installed + OpenGL headers. + + -- Rob Bradford Thu, 28 Feb 2008 14:54:24 +0000 + +clutter (0.6.0-1) unstable; urgency=low + + * New upstream release. + - Replace deprecated substvars. + - Update debian/copyright file. + + -- Rob Bradford Mon, 18 Feb 2008 13:27:15 +0000 + +clutter (0.5.6-1) unstable; urgency=low + + * New (unstable) upstream release. + + -- Rob Bradford Mon, 11 Feb 2008 17:21:32 +0000 + +clutter (0.5.2-1) unstable; urgency=low + + * New (unstable) upstream release. + + -- Rob Bradford Mon, 14 Jan 2008 13:34:58 +0000 + +clutter (0.5.0-1) unstable; urgency=low + + * New (unstable) upstream release. + + -- Rob Bradford Thu, 10 Jan 2008 15:58:27 +0000 + +clutter (0.4.2-1) unstable; urgency=low + + * New upstream release. + + -- Ross Burton Tue, 18 Sep 2007 11:30:38 +0100 + +clutter (0.4.1-1) unstable; urgency=low + + * New upstream release. + + -- Ross Burton Mon, 20 Aug 2007 13:55:10 +0100 + +clutter (0.4.0-1) unstable; urgency=low + + * New upstream release. + + -- Ross Burton Tue, 7 Aug 2007 20:50:46 +0100 + +clutter (0.3.1-1) unstable; urgency=low + + * New upstream release. + + -- Ross Burton Tue, 24 Jul 2007 09:13:14 +0100 + +clutter (0.2.3-1) unstable; urgency=low + + * New upstream release. + + -- Ross Burton Wed, 11 Apr 2007 18:37:12 +0100 + +clutter (0.2.2-1) unstable; urgency=low + + * New upstream release. + * Don't compress the examples. + + -- Ross Burton Wed, 14 Feb 2007 09:26:01 +0000 + +clutter (0.2.1-1) unstable; urgency=low + + * New upstream release. + - Upstream package split up, remove Python packaging + + -- Ross Burton Wed, 7 Feb 2007 16:18:44 +0000 + +clutter (0.1.0-2) unstable; urgency=low + + * Ship the Python bindings in python2.4-clutter (thanks to Jeff Waugh) + + -- Ross Burton Fri, 23 Jun 2006 11:48:12 +0100 + +clutter (0.1.0-1) unstable; urgency=low + + * Initial upload. + + -- Ross Burton Wed, 21 Jun 2006 17:46:05 +0100 + --- clutter-1.0-1.2.12.orig/debian/copyright +++ clutter-1.0-1.2.12/debian/copyright @@ -0,0 +1,31 @@ +This package was debianized by Ross Burton on Wed, 21 Jun 2006 +17:40:36 +0100. + +It was downloaded from http://www.clutter-project.org/sources/clutter/ + +Upstream Authors: +Matthew Allum +Emmanuele Bassi +Iain Holmes +Jorn Baayen + +Copyright (C) 2006-2008 OpenedHand Ltd. +Copyright (C) 2009 Intel Corp. + +License: + + This library is free software; you can redistribute it and/or modify it 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. + + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along + with this library; if not, write to the Free Software Foundation, Inc., 51 + Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/LGPL-2'. --- clutter-1.0-1.2.12.orig/debian/compat +++ clutter-1.0-1.2.12/debian/compat @@ -0,0 +1 @@ +5 --- clutter-1.0-1.2.12.orig/debian/gir1.0-clutter-1.0.install +++ clutter-1.0-1.2.12/debian/gir1.0-clutter-1.0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/girepository-1.0/ --- clutter-1.0-1.2.12.orig/debian/patches/01_speed_current_position_detection.patch +++ clutter-1.0-1.2.12/debian/patches/01_speed_current_position_detection.patch @@ -0,0 +1,570 @@ +Description: Awesome Jason improvement to get the better mouse position + detection performance + +diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c +index f4fe8ee..984c24b 100644 +--- a/clutter/clutter-actor.c ++++ b/clutter/clutter-actor.c +@@ -1480,14 +1480,76 @@ _clutter_actor_rerealize (ClutterActor *self, + clutter_actor_realize (self); /* realize self and all parents */ + } + ++gboolean ++clutter_actor_should_pick_for_pos (ClutterActor *self, int x, int y) ++{ ++ int lines_crossed = 0, i = 0; ++ gfloat line_x, slope, y_int; ++ ClutterVertex verts[4]; ++ ++ clutter_actor_get_abs_pick_vertices (self, verts); ++ ++ for (i = 0; i < 4; i++) ++ { ++ ClutterVertex a, b, tmp; ++ a = verts[i]; ++ ++ if (i == 3) ++ b = verts[0]; ++ else ++ b = verts[i+1]; ++ ++ /* you may not cross flat lines */ ++ if (a.y == b.y) ++ continue; ++ ++ /* ensure b has a bigger y */ ++ if (a.y > b.y) ++ { ++ tmp = a; ++ a = b; ++ b = tmp; ++ } ++ ++ /* do not consider lines which do not actually cross the pick line */ ++ if (G_LIKELY (a.y >= y || b.y <= y)) ++ continue; ++ ++ if (G_LIKELY (a.x == b.x)) ++ { ++ line_x = a.x; ++ } ++ else ++ { ++ slope = (a.y - b.y) / (a.x - b.x); ++ y_int = a.y - (slope * a.x); ++ line_x = (y - y_int) / slope; ++ } ++ ++ if (x < line_x) ++ { ++ lines_crossed++; ++ } ++ } ++ ++ return lines_crossed % 2; ++} ++ + static void + clutter_actor_real_pick (ClutterActor *self, + const ClutterColor *color) + { ++ ClutterMainContext *context; ++ ++ context = _clutter_context_get_default (); ++ + /* the default implementation is just to paint a rectangle + * with the same size of the actor using the passed color + */ +- if (clutter_actor_should_pick_paint (self)) ++ if (!clutter_actor_should_pick_paint (self)) ++ return; ++ ++ if (context->gl_picking) + { + ClutterActorBox box = { 0, }; + float width, height; +@@ -1504,6 +1566,10 @@ clutter_actor_real_pick (ClutterActor *self, + + cogl_rectangle (0, 0, width, height); + } ++ else ++ { ++ context->pick_stack = g_list_prepend (context->pick_stack, self); ++ } + } + + /** +@@ -1729,7 +1795,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self, + if (self->priv->propagated_one_redraw) + { + ClutterActor *stage = clutter_actor_get_stage (self); +- if (stage && ++ if (CLUTTER_IS_STAGE (stage) && + _clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage))) + return; + } +@@ -2289,6 +2355,112 @@ clutter_actor_get_allocation_vertices (ClutterActor *self, + full_vertex_to_units (&tmp, &verts[3]); + } + ++void ++clutter_actor_get_abs_pick_vertices (ClutterActor *self, ClutterVertex verts[]) ++{ ++ ClutterActorPrivate *priv; ++ CoglMatrix mtx; ++ CoglMatrix mtx_p; ++ float v[4]; ++ full_vertex_t vertices[4]; ++ ++ g_return_if_fail (CLUTTER_IS_ACTOR (self)); ++ ++ priv = self->priv; ++ ++ /* if the actor needs to be allocated we force a relayout, so that ++ * the actor allocation box will be valid for ++ * _clutter_actor_transform_and_project_box() ++ */ ++ if (priv->needs_allocation) ++ { ++ ClutterActor *stage = clutter_actor_get_stage (self); ++ ++ /* FIXME: if were not yet added to a stage, its probably unsafe to ++ * return default - idealy the func should fail ++ */ ++ if (stage == NULL) ++ stage = clutter_stage_get_default (); ++ ++ _clutter_stage_maybe_relayout (stage); ++ } ++ ++ clutter_actor_get_pick_vertices (self, verts); ++ ++ _clutter_actor_get_relative_modelview (self, NULL, &mtx); ++ ++ full_vertex_transform (&mtx, verts[0].x, verts[0].y, 0, 1.0, &vertices[0]); ++ full_vertex_transform (&mtx, verts[1].x, verts[1].y, 0, 1.0, &vertices[1]); ++ full_vertex_transform (&mtx, verts[2].x, verts[2].y, 0, 1.0, &vertices[2]); ++ full_vertex_transform (&mtx, verts[3].x, verts[3].y, 0, 1.0, &vertices[3]); ++ ++ _clutter_actor_get_projection_and_viewport (self, &mtx_p, v); ++ ++ full_vertex_scale (&mtx_p, &vertices[0], v, &verts[0]); ++ full_vertex_scale (&mtx_p, &vertices[1], v, &verts[1]); ++ full_vertex_scale (&mtx_p, &vertices[2], v, &verts[2]); ++ full_vertex_scale (&mtx_p, &vertices[3], v, &verts[3]); ++} ++ ++void ++clutter_actor_get_pick_vertices (ClutterActor *self, ClutterVertex vertices[]) ++{ ++ ClutterActorPrivate *priv; ++ ClutterActorClass *klass; ++ ClutterActorBox box; ++ ++ g_return_if_fail (CLUTTER_IS_ACTOR (self)); ++ ++ priv = self->priv; ++ klass = CLUTTER_ACTOR_GET_CLASS (self); ++ ++ if (klass->get_pick_vertices) ++ { ++ klass->get_pick_vertices (self, vertices); ++ return; ++ } ++ ++ box.x1 = 0; ++ box.y1 = 0; ++ box.x2 = priv->allocation.x2 - priv->allocation.x1; ++ box.y2 = priv->allocation.y2 - priv->allocation.y1; ++ ++ if (priv->has_clip) ++ { ++ if (priv->clip[0] >= box.x2 || priv->clip[1] >= box.y2) ++ { ++ box.x1 = 0; ++ box.x2 = 0; ++ box.y1 = 0; ++ box.y2 = 0; ++ } ++ else ++ { ++ box.x1 += priv->clip[0]; ++ box.y1 += priv->clip[1]; ++ box.x2 = box.x1 + priv->clip[2]; ++ box.y2 = box.y1 + priv->clip[3]; ++ ++ } ++ } ++ ++ vertices[0].x = box.x1; ++ vertices[0].y = box.y2; ++ vertices[0].z = 0; ++ ++ vertices[1].x = box.x2; ++ vertices[1].y = box.y2; ++ vertices[1].z = 0; ++ ++ vertices[2].x = box.x2; ++ vertices[2].y = box.y1; ++ vertices[2].z = 0; ++ ++ vertices[3].x = box.x1; ++ vertices[3].y = box.y1; ++ vertices[3].z = 0; ++} ++ + /** + * clutter_actor_get_abs_allocation_vertices: + * @self: A #ClutterActor +@@ -2528,30 +2700,33 @@ clutter_actor_paint (ClutterActor *self) + /* mark that we are in the paint process */ + CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT); + +- cogl_push_matrix(); +- +- if (priv->enable_model_view_transform) +- _clutter_actor_apply_modelview_transform (self); +- +- if (priv->has_clip) +- { +- cogl_clip_push_rectangle (priv->clip[0], +- priv->clip[1], +- priv->clip[0] + priv->clip[2], +- priv->clip[1] + priv->clip[3]); +- clip_set = TRUE; +- } +- else if (priv->clip_to_allocation) ++ if (context->pick_mode == CLUTTER_PICK_NONE || context->gl_picking) + { +- gfloat width, height; +- +- width = priv->allocation.x2 - priv->allocation.x1; +- height = priv->allocation.y2 - priv->allocation.y1; ++ cogl_push_matrix(); ++ ++ if (priv->enable_model_view_transform) ++ _clutter_actor_apply_modelview_transform (self); + +- cogl_clip_push_rectangle (0, 0, width, height); +- clip_set = TRUE; ++ if (priv->has_clip) ++ { ++ cogl_clip_push_rectangle (priv->clip[0], ++ priv->clip[1], ++ priv->clip[0] + priv->clip[2], ++ priv->clip[1] + priv->clip[3]); ++ clip_set = TRUE; ++ } ++ else if (priv->clip_to_allocation) ++ { ++ gfloat width, height; ++ ++ width = priv->allocation.x2 - priv->allocation.x1; ++ height = priv->allocation.y2 - priv->allocation.y1; ++ ++ cogl_clip_push_rectangle (0, 0, width, height); ++ clip_set = TRUE; ++ } + } +- ++ + if (context->pick_mode == CLUTTER_PICK_NONE) + { + CLUTTER_COUNTER_INC (_clutter_uprof_context, actor_paint_counter); +@@ -2578,10 +2753,11 @@ clutter_actor_paint (ClutterActor *self) + g_signal_emit (self, actor_signals[PICK], 0, &col); + } + +- if (clip_set) ++ if (clip_set && (context->pick_mode == CLUTTER_PICK_NONE || context->gl_picking)) + cogl_clip_pop(); + +- cogl_pop_matrix(); ++ if (context->pick_mode == CLUTTER_PICK_NONE || context->gl_picking) ++ cogl_pop_matrix(); + + /* paint sequence complete */ + CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT); +diff --git a/clutter/clutter-actor.h b/clutter/clutter-actor.h +index 4bb46cd..8055f88 100644 +--- a/clutter/clutter-actor.h ++++ b/clutter/clutter-actor.h +@@ -300,8 +300,10 @@ struct _ClutterActorClass + void (* queue_relayout) (ClutterActor *actor); + + /*< private >*/ ++ void (* get_pick_vertices) (ClutterActor *actor, ++ ClutterVertex verts[]); + /* padding for future expansion */ +- gpointer _padding_dummy[31]; ++ gpointer _padding_dummy[30]; + }; + + GType clutter_actor_get_type (void) G_GNUC_CONST; +@@ -531,6 +533,14 @@ gboolean clutter_actor_is_rotated (ClutterActor *self); + gboolean clutter_actor_is_scaled (ClutterActor *self); + gboolean clutter_actor_should_pick_paint (ClutterActor *self); + ++void clutter_actor_get_pick_vertices (ClutterActor *self, ClutterVertex verts[]); ++ ++void clutter_actor_get_abs_pick_vertices (ClutterActor *self, ClutterVertex verts[]); ++ ++gboolean clutter_actor_should_pick_for_pos (ClutterActor *self, ++ int x, ++ int y); ++ + void clutter_actor_get_abs_allocation_vertices (ClutterActor *self, + ClutterVertex verts[]); + +diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c +index 59bf9d7..92e4a47 100644 +--- a/clutter/clutter-main.c ++++ b/clutter/clutter-main.c +@@ -336,6 +336,22 @@ clutter_redraw (ClutterStage *stage) + clutter_stage_ensure_redraw (stage); + } + ++void ++clutter_set_gl_picking_enabled (gboolean enable) ++{ ++ ClutterMainContext *context = _clutter_context_get_default (); ++ ++ context->gl_picking = enable; ++} ++ ++gboolean ++clutter_get_gl_picking_enabled (void) ++{ ++ ClutterMainContext *context = _clutter_context_get_default (); ++ ++ return context->gl_picking; ++} ++ + /** + * clutter_set_motion_events_enabled: + * @enable: %TRUE to enable per-actor motion events +@@ -553,9 +569,10 @@ _clutter_do_pick (ClutterStage *stage, + ClutterMainContext *context; + guchar pixel[4] = { 0xff, 0xff, 0xff, 0xff }; + CoglColor stage_pick_id; ++ GList *l; + guint32 id; + GLboolean dither_was_on; +- ClutterActor *actor; ++ ClutterActor *actor = NULL; + CLUTTER_STATIC_COUNTER (do_pick_counter, + "_clutter_do_pick counter", + "Increments for each full pick run", +@@ -601,22 +618,24 @@ _clutter_do_pick (ClutterStage *stage, + /* needed for when a context switch happens */ + _clutter_stage_maybe_setup_viewport (stage); + +- if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS))) ++ if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS) && context->gl_picking)) + cogl_clip_push_window_rectangle (x, y, 1, 1); + +- cogl_disable_fog (); +- cogl_color_set_from_4ub (&stage_pick_id, 255, 255, 255, 255); +- CLUTTER_TIMER_START (_clutter_uprof_context, pick_clear); +- cogl_clear (&stage_pick_id, +- COGL_BUFFER_BIT_COLOR | +- COGL_BUFFER_BIT_DEPTH); +- CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_clear); +- +- /* Disable dithering (if any) when doing the painting in pick mode */ +- dither_was_on = glIsEnabled (GL_DITHER); +- if (dither_was_on) +- glDisable (GL_DITHER); +- ++ if (context->gl_picking) ++ { ++ cogl_disable_fog (); ++ cogl_color_set_from_4ub (&stage_pick_id, 255, 255, 255, 255); ++ CLUTTER_TIMER_START (_clutter_uprof_context, pick_clear); ++ cogl_clear (&stage_pick_id, ++ COGL_BUFFER_BIT_COLOR | ++ COGL_BUFFER_BIT_DEPTH); ++ CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_clear); ++ ++ /* Disable dithering (if any) when doing the painting in pick mode */ ++ dither_was_on = glIsEnabled (GL_DITHER); ++ if (dither_was_on) ++ glDisable (GL_DITHER); ++ } + /* Render the entire scence in pick mode - just single colored silhouette's + * are drawn offscreen (as we never swap buffers) + */ +@@ -626,46 +645,67 @@ _clutter_do_pick (ClutterStage *stage, + context->pick_mode = CLUTTER_PICK_NONE; + CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_paint); + +- if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS))) ++ if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS) && context->gl_picking)) + cogl_clip_pop (); + +- /* Make sure Cogl flushes any batched geometry to the GPU driver */ +- cogl_flush (); +- +- /* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used +- even though we don't care about the alpha component because under +- GLES this is the only format that is guaranteed to work so Cogl +- will end up having to do a conversion if any other format is +- used. The format is requested as pre-multiplied because Cogl +- assumes that all pixels in the framebuffer are premultiplied so +- it avoids a conversion. */ +- CLUTTER_TIMER_START (_clutter_uprof_context, pick_read); +- cogl_read_pixels (x, y, 1, 1, +- COGL_READ_PIXELS_COLOR_BUFFER, +- COGL_PIXEL_FORMAT_RGBA_8888_PRE, +- pixel); +- CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_read); +- +- if (G_UNLIKELY (clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)) ++ if (context->gl_picking) ++ { ++ /* Make sure Cogl flushes any batched geometry to the GPU driver */ ++ cogl_flush (); ++ ++ /* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used ++ even though we don't care about the alpha component because under ++ GLES this is the only format that is guaranteed to work so Cogl ++ will end up having to do a conversion if any other format is ++ used. The format is requested as pre-multiplied because Cogl ++ assumes that all pixels in the framebuffer are premultiplied so ++ it avoids a conversion. */ ++ CLUTTER_TIMER_START (_clutter_uprof_context, pick_read); ++ cogl_read_pixels (x, y, 1, 1, ++ COGL_READ_PIXELS_COLOR_BUFFER, ++ COGL_PIXEL_FORMAT_RGBA_8888_PRE, ++ pixel); ++ CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_read); ++ } ++ if (G_UNLIKELY (clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS && context->gl_picking)) + { + read_pixels_to_file ("pick-buffer", 0, 0, + clutter_actor_get_width (CLUTTER_ACTOR (stage)), + clutter_actor_get_height (CLUTTER_ACTOR (stage))); + } + +- /* Restore whether GL_DITHER was enabled */ +- if (dither_was_on) +- glEnable (GL_DITHER); ++ ++ if (context->gl_picking) ++ { ++ /* Restore whether GL_DITHER was enabled */ ++ if (dither_was_on) ++ glEnable (GL_DITHER); + +- if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff) ++ if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff) ++ { ++ actor = CLUTTER_ACTOR (stage); ++ goto result; ++ } ++ id = _clutter_pixel_to_id (pixel); ++ actor = clutter_get_actor_by_gid (id); ++ } ++ else + { +- actor = CLUTTER_ACTOR (stage); +- goto result; ++ for (l = context->pick_stack; l; l = l->next) ++ { ++ if (clutter_actor_should_pick_for_pos (CLUTTER_ACTOR (l->data), x, y)) ++ { ++ actor = CLUTTER_ACTOR (l->data); ++ break; ++ } ++ } ++ ++ g_list_free (context->pick_stack); ++ context->pick_stack = NULL; ++ ++ if (actor == NULL) ++ actor = CLUTTER_ACTOR (stage); + } +- +- id = _clutter_pixel_to_id (pixel); +- actor = clutter_get_actor_by_gid (id); +- + result: + + CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_timer); +@@ -1399,6 +1439,7 @@ _clutter_context_get_default (void) + + ctx->is_initialized = FALSE; + ctx->motion_events_per_actor = TRUE; ++ ctx->gl_picking = FALSE; + + #ifdef CLUTTER_ENABLE_DEBUG + ctx->timer = g_timer_new (); +diff --git a/clutter/clutter-main.h b/clutter/clutter-main.h +index 067cef0..5f8cba5 100644 +--- a/clutter/clutter-main.h ++++ b/clutter/clutter-main.h +@@ -140,6 +140,9 @@ void clutter_threads_remove_repaint_func (guint handle_id + void clutter_set_motion_events_enabled (gboolean enable); + gboolean clutter_get_motion_events_enabled (void); + ++void clutter_set_gl_picking_enabled (gboolean enable); ++gboolean clutter_get_gl_picking_enabled (void); ++ + void clutter_set_default_frame_rate (guint frames_per_sec); + guint clutter_get_default_frame_rate (void); + +diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h +index cf20132..dc8a373 100644 +--- a/clutter/clutter-private.h ++++ b/clutter/clutter-private.h +@@ -131,12 +131,14 @@ struct _ClutterMainContext + + guint is_initialized : 1; + guint motion_events_per_actor : 1;/* set for enter/leave events */ ++ guint gl_picking : 1; + guint defer_display_setup : 1; + guint options_parsed : 1; + + GTimer *timer; /* Used for debugging scheduler */ + + ClutterPickMode pick_mode; /* Indicates pick render mode */ ++ GList *pick_stack; /* Stack of actors for picking */ + + gint num_reactives; /* Num of reactive actors */ + +diff --git a/clutter/x11/clutter-event-x11.c b/clutter/x11/clutter-event-x11.c +index 1313b01..c05d312 100644 +--- a/clutter/x11/clutter-event-x11.c ++++ b/clutter/x11/clutter-event-x11.c +@@ -778,6 +778,9 @@ event_translate (ClutterBackend *backend, + break; + + case MotionNotify: ++ if (device->stage == NULL) ++ _clutter_input_device_set_stage (device, stage); ++ + event->motion.type = event->type = CLUTTER_MOTION; + event->motion.time = xevent->xmotion.time; + event->motion.x = xevent->xmotion.x; +diff --git a/tests/interactive/test-actors.c b/tests/interactive/test-actors.c +index fb2f492..df1a806 100644 +--- a/tests/interactive/test-actors.c ++++ b/tests/interactive/test-actors.c +@@ -166,7 +166,7 @@ test_actors_main (int argc, char *argv[]) + oh->stage = stage; + + /* Create a timeline to manage animation */ +- oh->timeline = clutter_timeline_new (6000); ++ oh->timeline = clutter_timeline_new (60000); + clutter_timeline_set_loop (oh->timeline, TRUE); + + /* fire a callback for frame change */ +@@ -203,6 +203,8 @@ test_actors_main (int argc, char *argv[]) + oh->hand[i] = real_hand; + else + oh->hand[i] = clutter_clone_new (real_hand); ++ ++ clutter_actor_set_name (oh->hand[i], g_strdup_printf ("Hand %i", i)); + + clutter_actor_set_reactive (oh->hand[i], TRUE); +