profile/ivi/clutter.git
13 years agoactor: Rename in_clone_paint parameter to avoid variable shadowing
Chris Lord [Fri, 11 Feb 2011 16:27:46 +0000 (16:27 +0000)]
actor: Rename in_clone_paint parameter to avoid variable shadowing

The 'in_clone_paint' parameter of the private function
_clutter_actor_set_in_clone_paint() shadowed the private function
in_clone_paint(). Rename this parameter to 'is_in_clone_paint' to remove
a compiler warning.

13 years agooffscreen: Fix partially off-stage actors being clipped in the fbo
Chris Lord [Fri, 11 Feb 2011 15:18:08 +0000 (15:18 +0000)]
offscreen: Fix partially off-stage actors being clipped in the fbo

If an actor was partially off of the stage, it would be clipped because
of the stage viewport. This produces problems if you use an offscreen
effect that relies on the entire actor being rendered (e.g. shadows).

Expand the viewport in this scenario so that the offscreen-rendering isn't
clipped.

This fixes http://bugzilla.clutter-project.org/show_bug.cgi?id=2550

13 years agooffscreen-effect: Use actor's opacity_override when redirecting painting
Chris Lord [Thu, 3 Feb 2011 14:36:55 +0000 (14:36 +0000)]
offscreen-effect: Use actor's opacity_override when redirecting painting

Override the actor's paint opacity so that it will appear fully opaque in
the offscreen surface. This avoids multiple multiplications of an actor's
opacity.

Fixes http://bugzilla.clutter-project.org/show_bug.cgi?id=2541

13 years agoactor: Replace private opacity_parent with opacity_override
Chris Lord [Thu, 3 Feb 2011 13:58:20 +0000 (13:58 +0000)]
actor: Replace private opacity_parent with opacity_override

Replace the opacity_parent with an opacity_override variable, to allow
direct overriding of the paint opacity and simplify this mechanism
somewhat.

This also required a new private flag, in_clone_paint, to maintain the
functionality of the public function clutter_actor_is_in_clone_paint()

13 years agobuild: Modify maintainer compiler flags values
Emmanuele Bassi [Fri, 11 Feb 2011 15:45:13 +0000 (15:45 +0000)]
build: Modify maintainer compiler flags values

We use the micro version for distinguishing released tarballs and Git
builds; the maintainer compiler flags should be enabled for the latter,
and not just for unstable cycles, since it makes sense to have extra
warning flags even on stable cycles.

We also want to allow people to turn on -Werror on demand, so let's add
a third option to --enable-maintainer-flags.

13 years agodocs: Clarify interface_age usage in configure.ac
Emmanuele Bassi [Fri, 11 Feb 2011 15:44:03 +0000 (15:44 +0000)]
docs: Clarify interface_age usage in configure.ac

The clutter_interface_age value should be changed only on stable cycles;
unstable cycles should reset the value to 0.

13 years agoMerge remote-tracking branch 'elliot/cookbook-animations-path'
Emmanuele Bassi [Fri, 11 Feb 2011 15:03:22 +0000 (15:03 +0000)]
Merge remote-tracking branch 'elliot/cookbook-animations-path'

* elliot/cookbook-animations-path:
  docs: Add recipe for animating an actor on a curved path

13 years agocogl-framebuffer: Fix flushing the framebuffer on push
Neil Roberts [Wed, 2 Feb 2011 15:17:50 +0000 (15:17 +0000)]
cogl-framebuffer: Fix flushing the framebuffer on push

When pushing a framebuffer it would previously push
COGL_INVALID_HANDLE to the top of the framebuffer stack so that when
it later calls cogl_set_framebuffer it will recognise that the
framebuffer is different and replace the top with the new
pointer. This isn't ideal because it breaks the code to flush the
journal because _cogl_framebuffer_flush_journal is called with the
value of the old pointer which is NULL. That function was checking for
a NULL pointer so it wouldn't actually flush. It also would mean that
if you pushed the same framebuffer twice we would end up dirtying
state unnecessarily. To fix this cogl_push_framebuffer now pushes a
reference to the current framebuffer instead.

13 years agocogl-framebuffer: Remove all dependencies after a flush
Neil Roberts [Wed, 9 Feb 2011 19:31:42 +0000 (19:31 +0000)]
cogl-framebuffer: Remove all dependencies after a flush

After a dependent framebuffer is added to a framebuffer it was never
getting removed. Once the journal for a framebuffer is flushed we no
longer depend on any framebuffers so the list should be cleared. This
was causing leaks of offscreens and textures.

13 years agoclutter.modules: Fix Wayland's location
Emmanuele Bassi [Thu, 10 Feb 2011 10:35:35 +0000 (10:35 +0000)]
clutter.modules: Fix Wayland's location

The Git repository URL for Wayland has been moved into the main fd.o
structure.

13 years agoglx: Make sure to glFlush if blitting to frontbuffer.
Robert Bragg [Tue, 8 Feb 2011 17:54:49 +0000 (17:54 +0000)]
glx: Make sure to glFlush if blitting to frontbuffer.

Unlike glXSwapBuffers, glXCopySubBuffer and glBlitFramebuffer don't
issue an implicit glFlush() so we have to flush ourselves if we want the
request to complete in finite amount of time since otherwise the driver
can batch the command indefinitely.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2551

13 years agodocs: clarify cogl_vertex_buffer_adds docs
Robert Bragg [Tue, 1 Feb 2011 13:24:13 +0000 (13:24 +0000)]
docs: clarify cogl_vertex_buffer_adds docs

This adds a clarification that cogl_vertex_buffer_add can also be
used to replace a previously added attribute with the same name.

13 years agomatrix: note that _matrix_multiply can multiply in-place
Robert Bragg [Tue, 1 Feb 2011 13:19:49 +0000 (13:19 +0000)]
matrix: note that _matrix_multiply can multiply in-place

This adds a note to clarify that cogl_matrix_multiply allows you to
multiply the @a matrix in-place, so @a can equal @result but @b can't
equal @result.

13 years agoFix compilation of the EGL backend
Emmanuele Bassi [Wed, 9 Feb 2011 16:16:57 +0000 (16:16 +0000)]
Fix compilation of the EGL backend

Sorry for breaking it.

13 years agokeymap/x11: Remove unused variables
Emmanuele Bassi [Wed, 9 Feb 2011 16:20:40 +0000 (16:20 +0000)]
keymap/x11: Remove unused variables

Silence compiler warnings.

13 years agocogl: Set the layer matrix on the right layer instead of a random one
Neil Roberts [Wed, 9 Feb 2011 15:24:43 +0000 (15:24 +0000)]
cogl: Set the layer matrix on the right layer instead of a random one

When uploading the layer matrix to GL it wasn't first calling
glActiveTextureMatrix to set the right texture unit for the
layer. This would end up setting the texture matrix on whatever layer
happened to be previously active. This happened to work for
test-cogl-multitexture presumably because it was coincidentally
setting the layer matrix on the last used layer.

13 years agoAdd a conformance test for cogl_pipeline_set_layer_matrix
Neil Roberts [Wed, 9 Feb 2011 15:12:13 +0000 (15:12 +0000)]
Add a conformance test for cogl_pipeline_set_layer_matrix

This adds a conformance test which paints using a pipeline that has
two layers containing textures. Each layer has a different user
matrix. When the two layers are combined with the right matrices then
all of the colors end up white. The test then verifies this by reading
back the pixels.

13 years agoIntern clutter_get_actor_by_gid() implementation
Emmanuele Bassi [Wed, 9 Feb 2011 14:53:20 +0000 (14:53 +0000)]
Intern clutter_get_actor_by_gid() implementation

As the prelude to deprecation of the function in 1.8, let's move the
implementation to an internal function, and use that instead of the
public facing one.

13 years agotest-actors: Clear the state on destroy
Emmanuele Bassi [Wed, 9 Feb 2011 13:05:12 +0000 (13:05 +0000)]
test-actors: Clear the state on destroy

The venerable test-actors used the default stage, which meant that
closing the window just stopped the main loop but left the scene intact.
This does not happen with a normal stage created through
clutter_stage_new().

The change happened in 6ed6b2a54b5c8f44496399057ad5e58771bfc620, in an
unhelpfully named commit that was just supposed to switch to static
colors. My bad.

Anyway, the change led to some assertion failures when closing the stage
in the middle of an animation.

The correct thing to do when using an actor from another object (a
Timeline ::new-frame callback in this case) without owning the instance
is to connect to the ::destroy signal and clean up the pointer to avoid
calling an invalid actor.

13 years agoClean up ClutterMainContext and clutter-private.h
Emmanuele Bassi [Wed, 9 Feb 2011 12:55:25 +0000 (12:55 +0000)]
Clean up ClutterMainContext and clutter-private.h

Do a better job at documenting the main context structure fields; remove
unused members; clean up the declarations.

13 years agoAvoid direct access to the main context events queue
Emmanuele Bassi [Wed, 9 Feb 2011 12:38:10 +0000 (12:38 +0000)]
Avoid direct access to the main context events queue

The GQueue that stores the global events queue is handled all over the
place:

  • the structure is created in _clutter_backend_init_events();
  • the queue is handled in clutter-event.c, clutter-stage.c and
    clutter-backend.c;
  • ClutterStage::dispose cleans up the events associated with
    the stage being destroyed;
  • the queue is destroyed in ClutterBackend::dispose.

Since we need to have access to it in different places we cannot put it
inside ClutterBackendPrivate, hence it should stay in ClutterMainContext;
but we should still manage it from just one place - preferably by the
ClutterEvent API only.

13 years agobackend: Move event translators to the base class
Emmanuele Bassi [Wed, 9 Feb 2011 12:20:56 +0000 (12:20 +0000)]
backend: Move event translators to the base class

In the future, we want event translators to be the way to handle events
in backends. For this reason, they should be a part of the base abstract
ClutterBackend class, and not an X11-only concept.

13 years agodocs: Update the HACKING.backends documentation
Emmanuele Bassi [Tue, 8 Feb 2011 18:03:43 +0000 (18:03 +0000)]
docs: Update the HACKING.backends documentation

13 years agobackend: Invoke ClutterStageWindow::redraw by default
Emmanuele Bassi [Fri, 4 Feb 2011 15:09:41 +0000 (15:09 +0000)]
backend: Invoke ClutterStageWindow::redraw by default

Instead of asking all backends to do that for us, we can call
ClutterStageWindow::redraw ourselves by default.

This changeset fixes all backends to actually do the right thing, and
move the stage implementation redraw inside the ClutterStageWindow
implementation itself.

13 years agostage-window: Add ::redraw virtual function
Emmanuele Bassi [Fri, 4 Feb 2011 15:08:48 +0000 (15:08 +0000)]
stage-window: Add ::redraw virtual function

How to redraw a ClutterStage's implementation should be part of the
ClutterStageWindow interface.

13 years agoSkip some x11-specific calls when generating introspection
Emmanuele Bassi [Tue, 8 Feb 2011 15:31:20 +0000 (15:31 +0000)]
Skip some x11-specific calls when generating introspection

Some types are just not handled currently.

13 years agoUnify the vfunc parameters names with their callers
Emmanuele Bassi [Tue, 8 Feb 2011 15:30:48 +0000 (15:30 +0000)]
Unify the vfunc parameters names with their callers

Otherwise g-ir-scanner will get fairly angry.

13 years agodocs: Add recipe for animating an actor on a curved path
Elliot Smith [Tue, 8 Feb 2011 14:37:59 +0000 (14:37 +0000)]
docs: Add recipe for animating an actor on a curved path

Show how to animate an actor using a ClutterPathConstraint.

This demonstrates how to get effects similar to
ClutterPathBehaviour with the modern animation APIs.

Includes 3 examples:

1) Simple ClutterPathConstraint used with implicit animations
2) ClutterPathConstraint used to simulate circular animation,
using ClutterAnimator
3) Creating simple curved path animations with non-linear
easing

13 years agox11: Refresh key mapping when notified by X11
Emmanuele Bassi [Tue, 8 Feb 2011 12:08:18 +0000 (12:08 +0000)]
x11: Refresh key mapping when notified by X11

Use both the MappingNotify event and the XKB XkbMapNotify event, if
we're compiled with XKB support.

This change is also useful for making ClutterKeymapX11 an event
translator and let it deal with XKB events internally like we do for
stage and input events.

Based on a patch by: Damien Lespiau <damien.lespiau@intel.com>

Signed-off by: Emmanuele Bassi <ebassi@linux.intel.com>

http://bugzilla.clutter-project.org/show_bug.cgi?id=2525

13 years agoPost-release version bump to 1.6.3
Emmanuele Bassi [Mon, 7 Feb 2011 15:59:42 +0000 (15:59 +0000)]
Post-release version bump to 1.6.3

13 years agoRelease Clutter 1.6.2
Emmanuele Bassi [Mon, 7 Feb 2011 15:42:45 +0000 (15:42 +0000)]
Release Clutter 1.6.2

13 years agoUpdate NEWS
Emmanuele Bassi [Mon, 7 Feb 2011 15:42:23 +0000 (15:42 +0000)]
Update NEWS

13 years agobuild: Fix the Cally pkg-config file
Emmanuele Bassi [Mon, 7 Feb 2011 15:40:09 +0000 (15:40 +0000)]
build: Fix the Cally pkg-config file

Do not use ${winsys}: use ${soname_infix} instead.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2549

13 years agoosx: Add more checks to the redraw function
Emmanuele Bassi [Thu, 3 Feb 2011 16:25:42 +0000 (16:25 +0000)]
osx: Add more checks to the redraw function

The redraw function might be called during destruction phase, when the
Stage state has not entirely been tore down. We need to be slightly more
resilient to that scenario.

13 years agoAdd some more sanity checks to clutter_do_event()
Emmanuele Bassi [Thu, 3 Feb 2011 11:30:10 +0000 (11:30 +0000)]
Add some more sanity checks to clutter_do_event()

Silently ignore events on stages during destruction; but print out a
warning if clutter_do_event() is being called with a stage-less event.

13 years agostage: Unconditionally create the devices hash table
Emmanuele Bassi [Thu, 3 Feb 2011 11:26:09 +0000 (11:26 +0000)]
stage: Unconditionally create the devices hash table

13 years agostage: Do not update when destroying a stage
Emmanuele Bassi [Thu, 3 Feb 2011 11:25:28 +0000 (11:25 +0000)]
stage: Do not update when destroying a stage

During the stage destruction we should just skip event processing, since
we cannot guarantee that the stage is actually valid.

13 years agoFixed bugs with mouse events.
Viatcheslav Gachkaylo [Thu, 3 Feb 2011 08:51:20 +0000 (14:51 +0600)]
Fixed bugs with mouse events.

Enter/leave events are now being received. Mouse move events
now work properly.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
http://bugzilla.clutter-project.org/show_bug.cgi?id=2545

13 years agoosx: Use _clutter_event_push()
Emmanuele Bassi [Wed, 2 Feb 2011 14:43:38 +0000 (14:43 +0000)]
osx: Use _clutter_event_push()

Do not operate directly on the event queue, but use the wrapper call
that all backends share.

13 years agoosx: Re-add the event time
Emmanuele Bassi [Wed, 2 Feb 2011 14:41:57 +0000 (14:41 +0000)]
osx: Re-add the event time

Some overzealous diffing led to a missing call to setting the time of a
ClutterEvent from the corresponding NSEvent.

13 years agocogl-vertex-buffer: Use a ref count on the pipeline private data
Neil Roberts [Tue, 1 Feb 2011 18:43:27 +0000 (18:43 +0000)]
cogl-vertex-buffer: Use a ref count on the pipeline private data

The pipeline private data is accessed both from the private data set
on a CoglPipeline and the destroy notify function of a weak material
that the vertex buffer creates when it needs to override the wrap
mode. However when a CoglPipeline is destroyed, the CoglObject code
first removes all of the private data set on the object and then the
CoglPipeline code gets invoked to destroy all of the weak children. At
this point the vertex buffer's weak override destroy notify function
will get invoked and try to use the private data which has already
been freed causing a crash.

This patch instead adds a reference count to the pipeline private data
stuct so that we can avoid freeing it until both the private data on
the pipeline has been destroyed and all of the weak materials are
destroyed.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2544

13 years agocogl-pipeline: Fix comparing the color in set_layer_combine_constant
Neil Roberts [Tue, 1 Feb 2011 17:38:58 +0000 (17:38 +0000)]
cogl-pipeline: Fix comparing the color in set_layer_combine_constant

In cogl_pipeline_set_layer_combine_constant it was comparing whether
the new color is the same as the old color using a memcmp on the
constant_color parameter. However the combine constant is stored in
the layer data as an array of four floats but the passed in color is a
CoglColor (which is currently an array of four guint8s). This was
causing valgrind errors and presumably also the check for setting the
same color twice would always fail.

This patch makes it do the conversion to a float array upfront before
the comparison.

13 years agoevent: The device setter work on sub-types
Emmanuele Bassi [Tue, 1 Feb 2011 14:44:22 +0000 (14:44 +0000)]
event: The device setter work on sub-types

Instead of just setting the input device pointer in the private event
data, it should also set the field in the event sub-types, so that
direct access to the structures still works.

13 years agobuild: Pass --enable-cookbook when distchecking
Emmanuele Bassi [Tue, 1 Feb 2011 14:38:08 +0000 (14:38 +0000)]
build: Pass --enable-cookbook when distchecking

We should force building the cookbook when releasing a tarball of
Clutter, so that users of packaged tarballs can actually build the
cookbook themselves.

13 years agobuild: Fixes to pass distcheck
Emmanuele Bassi [Tue, 1 Feb 2011 14:33:29 +0000 (14:33 +0000)]
build: Fixes to pass distcheck

Try to make the cookbook pass the distcheck phase, so that we can run
distcheck with --enable-docs, and make sure that a tarballed clutter
release can actually build the cookbook.

13 years agodocs: Switch a 'Since' annotation in CallyActor
Emmanuele Bassi [Tue, 1 Feb 2011 14:32:41 +0000 (14:32 +0000)]
docs: Switch a 'Since' annotation in CallyActor

Since doesn't like it when it's not the last annotation.

13 years agocogl-matrix: Get rid of the *_packed variants
Neil Roberts [Mon, 31 Jan 2011 18:53:51 +0000 (18:53 +0000)]
cogl-matrix: Get rid of the *_packed variants

cogl_matrix_project_points and cogl_matrix_transform_points had an
optimization for the common case where the stride parameters exactly
match the size of the corresponding structures. The code for both when
generated by gcc with -O2 on x86-64 use two registers to hold the
addresses of the input and output arrays. In the strided version these
pointers are incremented by adding the value of a register and in the
packed version they are incremented by adding an immediate value. I
think the difference in cost here would be negligible and it may even
be faster to add a register.

Also GCC appears to retain the loop counter in a register for the
strided version but in the packed version it can optimize it out and
directly use the input pointer as the counter. I think it would be
possible to reorder the code a bit to explicitly use the input pointer
as the counter if this were a problem.

Getting rid of the packed versions tidies up the code a bit and it
could potentially be faster if the code differences are small and we
get to avoid an extra conditional in cogl_matrix_transform_points.

13 years agobuild: Dist cb-button.h in the cookbook examples
Emmanuele Bassi [Tue, 1 Feb 2011 12:45:52 +0000 (12:45 +0000)]
build: Dist cb-button.h in the cookbook examples

The header is missing, so we have a build failure if you try to build
Clutter's cookbook from the tarball.

13 years agoPost-release version bump to 1.6.1
Emmanuele Bassi [Mon, 31 Jan 2011 15:04:48 +0000 (15:04 +0000)]
Post-release version bump to 1.6.1

13 years agoRelease Clutter 1.6.0
Emmanuele Bassi [Mon, 31 Jan 2011 14:47:37 +0000 (14:47 +0000)]
Release Clutter 1.6.0

13 years agodocs: Update the NEWS file
Emmanuele Bassi [Mon, 31 Jan 2011 13:59:14 +0000 (13:59 +0000)]
docs: Update the NEWS file

13 years agoMerge remote branch 'elliot/cookbook-actors-composite'
Emmanuele Bassi [Mon, 31 Jan 2011 13:58:12 +0000 (13:58 +0000)]
Merge remote branch 'elliot/cookbook-actors-composite'

* elliot/cookbook-actors-composite:
  docs: Add reference to useful GObject tutorial
  docs: Explain why destroy() is implemented
  docs: Implement destroy() rather than dispose()
  docs: Don't use clutter_stage_get_default()
  docs: Change text on button
  docs: Add a note about other state variables
  docs: Complete composite actor recipe
  docs: Change order of functions in example to match docs
  docs: Add more comments on how allocate() works
  docs: Include code examples in the recipe
  docs: Explain enums for properties and signals
  docs: Don't set explicit size on button
  docs: Add example of preferred_height() and preferred_width()
  docs: Add recipe for creating a custom ClutterActor with composition
  docs: Add more comments on code example for composite actor
  docs: Improve example code formatting
  docs: Add some gtk-doc annotations to example
  docs: Add custom ClutterActor example which uses composition

13 years agodocs: Update NEWS file
Emmanuele Bassi [Mon, 31 Jan 2011 13:50:37 +0000 (13:50 +0000)]
docs: Update NEWS file

13 years agoosx: Add devices to event translation code
Emmanuele Bassi [Fri, 28 Jan 2011 14:53:08 +0000 (14:53 +0000)]
osx: Add devices to event translation code

Use a DeviceManager sub-class similar to the Win32 backend one, which
creates two InputDevices: a core pointer and a core keyboard.

The event translation code then uses these two devices to fill out the
.device field of the events.

Throw in enter/leave tracking, given that we need to update the device's
state.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2490

13 years agoosx: Improve the event loop
Viatcheslav Gachkaylo [Fri, 28 Jan 2011 12:56:57 +0000 (12:56 +0000)]
osx: Improve the event loop

Implementation of event loop which works with GLib events, native OS X
events and Clutter events.

The event loop source code comes from the equivalent code in the Quartz
GDK backend from GTK+ 2.22.1, which is LGPL v2.1+ and thus compatible
with Clutter's licensing terms.

The code has been tested with libsoup, which did not work before together
with Clutter.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
http://bugzilla.clutter-project.org/show_bug.cgi?id=2490

13 years agodocs: Add reference to useful GObject tutorial
Elliot Smith [Mon, 31 Jan 2011 13:40:10 +0000 (13:40 +0000)]
docs: Add reference to useful GObject tutorial

Add a reference to a GObject tutorial which
is a good introduction to the various macros etc.
and what they're for.

13 years agodocs: Explain why destroy() is implemented
Elliot Smith [Mon, 31 Jan 2011 13:39:11 +0000 (13:39 +0000)]
docs: Explain why destroy() is implemented

As destroy() is Clutter-specific and not generic
GObject code, explain why we implement it
(rather than dispose()).

13 years agodocs: Fix documentation for clutter_actor_pop_internal()
Emmanuele Bassi [Mon, 31 Jan 2011 13:37:32 +0000 (13:37 +0000)]
docs: Fix documentation for clutter_actor_pop_internal()

http://bugzilla.clutter-project.org/show_bug.cgi?id=2534

13 years agodocs: Implement destroy() rather than dispose()
Elliot Smith [Mon, 31 Jan 2011 13:36:37 +0000 (13:36 +0000)]
docs: Implement destroy() rather than dispose()

Remove the dispose() implementation and replace
with destroy().

This should be promoted as the standard approach
for implementing a composite actor, as it emits a
signal when instances of the actor subclass are destroyed.

13 years agodocs: Update Cogl release notes for 1.6
Emmanuele Bassi [Mon, 31 Jan 2011 13:04:49 +0000 (13:04 +0000)]
docs: Update Cogl release notes for 1.6

13 years agoUpdate the NEWS file
Emmanuele Bassi [Mon, 31 Jan 2011 13:04:35 +0000 (13:04 +0000)]
Update the NEWS file

13 years agodocs: Update the documentation for clutter_actor_unparent()
Emmanuele Bassi [Mon, 31 Jan 2011 12:51:14 +0000 (12:51 +0000)]
docs: Update the documentation for clutter_actor_unparent()

Make sure that we document the semantics of unparent() and who should
call it.

13 years agodocs: Update documentation for ::destroy
Emmanuele Bassi [Mon, 31 Jan 2011 12:50:25 +0000 (12:50 +0000)]
docs: Update documentation for ::destroy

The ::destroy signal is meant to be used to break reference cycles on
third party code. The documentation should really make it clear.

13 years agodocs: Update release notes for 1.6
Emmanuele Bassi [Mon, 31 Jan 2011 12:28:03 +0000 (12:28 +0000)]
docs: Update release notes for 1.6

13 years agodocs: Don't use clutter_stage_get_default()
Elliot Smith [Mon, 31 Jan 2011 12:18:58 +0000 (12:18 +0000)]
docs: Don't use clutter_stage_get_default()

clutter_stage_get_new() is the recommended way to
get a stage instance, so use that instead.

13 years agodocs: Change text on button
Elliot Smith [Mon, 31 Jan 2011 11:06:01 +0000 (11:06 +0000)]
docs: Change text on button

Modify the text shown on the button to "hello / world"
rather than "winkle / pickers". Slightly more
sensible.

13 years agodocs: Add a note about other state variables
Elliot Smith [Mon, 31 Jan 2011 11:05:27 +0000 (11:05 +0000)]
docs: Add a note about other state variables

Explain that the private structure would be the
place to store other state variables for the instance.

13 years agodocs: Complete composite actor recipe
Elliot Smith [Mon, 31 Jan 2011 10:53:52 +0000 (10:53 +0000)]
docs: Complete composite actor recipe

Add some extra detail to the Discussion section of the
composite actor recipe, concentrating on the pros and
cons of this approach.

Also explain more about the Clutter parts of the implementation.

Also general tidy up of language and style.

13 years agodocs: Change order of functions in example to match docs
Elliot Smith [Fri, 28 Jan 2011 17:09:24 +0000 (17:09 +0000)]
docs: Change order of functions in example to match docs

Moved the functions around in the C code file, to match
the order Clutter uses them, and the order they are explained
in the recipe.

13 years agodocs: Add more comments on how allocate() works
Elliot Smith [Fri, 28 Jan 2011 16:43:22 +0000 (16:43 +0000)]
docs: Add more comments on how allocate() works

Add some extra description to the allocate() function,
explaining how the allocation has to be adjusted to
coordinates relative to the actor as a whole, before
applying to the single child actor it is composed from.

13 years agodocs: Include code examples in the recipe
Elliot Smith [Fri, 28 Jan 2011 11:49:08 +0000 (11:49 +0000)]
docs: Include code examples in the recipe

Include all the code examples inline as part of the recipe.

Remove sections around each code example, as these are
unnecessary; leave full discussion for the Discussion section
instead of trying to cram it in around the code example.

13 years agodocs: Explain enums for properties and signals
Elliot Smith [Fri, 28 Jan 2011 11:39:26 +0000 (11:39 +0000)]
docs: Explain enums for properties and signals

Add some more explanatory comments about the PROP_ and
signals enums.

13 years agodocs: Don't set explicit size on button
Elliot Smith [Fri, 28 Jan 2011 11:36:20 +0000 (11:36 +0000)]
docs: Don't set explicit size on button

Rather than set a size on the CbButton instance, let it
size itself automatically, based on the size requisition
functions.

13 years agodocs: Add example of preferred_height() and preferred_width()
Elliot Smith [Fri, 28 Jan 2011 11:35:14 +0000 (11:35 +0000)]
docs: Add example of preferred_height() and preferred_width()

As most actor subclasses will probably want to implement
size requisition, give a simple example of how to do this
on the basis of the composed actor's size, plus some padding.

13 years agodocs: Add recipe for creating a custom ClutterActor with composition
Elliot Smith [Wed, 26 Jan 2011 11:22:07 +0000 (11:22 +0000)]
docs: Add recipe for creating a custom ClutterActor with composition

13 years agodocs: Add more comments on code example for composite actor
Elliot Smith [Fri, 28 Jan 2011 11:13:47 +0000 (11:13 +0000)]
docs: Add more comments on code example for composite actor

Add more comments about the specific purpose of functions
and variables in the composite actor example, particularly
around GObject implementation.

13 years agodocs: Improve example code formatting
Elliot Smith [Wed, 26 Jan 2011 11:18:23 +0000 (11:18 +0000)]
docs: Improve example code formatting

Improve code formatting to adhere to Clutter uncrustify rules.

13 years agodocs: Add some gtk-doc annotations to example
Elliot Smith [Tue, 25 Jan 2011 11:36:13 +0000 (11:36 +0000)]
docs: Add some gtk-doc annotations to example

As this is a full GObject class implementation, add some
gtk-doc annotations to demonstrate how how custom actor subclasses
should be documented.

13 years agodocs: Add custom ClutterActor example which uses composition
Elliot Smith [Fri, 21 Jan 2011 16:43:03 +0000 (16:43 +0000)]
docs: Add custom ClutterActor example which uses composition

13 years agotext: Bind BackSpace + Shift as BackSpace
Emmanuele Bassi [Sun, 30 Jan 2011 23:00:00 +0000 (23:00 +0000)]
text: Bind BackSpace + Shift as BackSpace

Follow this old GTK+ bug:

  https://bugzilla.gnome.org/show_bug.cgi?id=80302

and ignore the Shift mask.

13 years agox11/stage: Use a global Window ↔ Stage relationship
Emmanuele Bassi [Fri, 28 Jan 2011 18:05:06 +0000 (18:05 +0000)]
x11/stage: Use a global Window ↔ Stage relationship

Since we need to find the stage from the X11 Window, it's better to use
a static hashmap that gets updated every time the ClutterStageX11:xwin
member is changed, instead of iterating over every stage handled by the
global ClutterStageManager singleton.

13 years agowin32: Small clean ups in the event code
Emmanuele Bassi [Fri, 28 Jan 2011 17:25:43 +0000 (17:25 +0000)]
win32: Small clean ups in the event code

Use clutter_event_set_device() instead of setting the device field.

Also, use G_N_ELEMENTS() to determine the size of the key symbols
mapping array.

13 years agoClean up crossing event synthesis code
Emmanuele Bassi [Thu, 27 Jan 2011 17:26:16 +0000 (17:26 +0000)]
Clean up crossing event synthesis code

Clutter should just require that the windowing system used by a backend
adds a device to the stage when the device enters, and removes it from
the stage when the device leaves; with this information, we can
synthesize every crossing event and update the device state without
other intervention from the backend-specific code.

The generation of additional crossing events for actors that are
covering the stage at the coordinates of the crossing event should be
delegated to the event processing code.

The x11 and win32 backends need to be modified to relay the enter and
leave events from the windowing system.

13 years agoevent: Add a setter for the device field
Emmanuele Bassi [Thu, 27 Jan 2011 17:21:08 +0000 (17:21 +0000)]
event: Add a setter for the device field

When synthesizing events coming from input devices it should be
possible to just call a setter function, to avoid a huge switch
on the type of the event.

Clutter should also store the device pointer inside the private
data, for faster access of the pointer in allocated events.

Finally, the get_device_id() and get_device_type() accessors should
just be wrappers around clutter_event_get_device(), to reduce the
amount of code duplication.

13 years agox11/stage: Remove redundant line location
Emmanuele Bassi [Wed, 26 Jan 2011 12:44:03 +0000 (12:44 +0000)]
x11/stage: Remove redundant line location

The CLUTTER_NOTE() macro already adds the line location; adding another
will just clutter up the log.

13 years agox11: Store a back pointer to the backend in the stage
Emmanuele Bassi [Wed, 26 Jan 2011 11:58:08 +0000 (11:58 +0000)]
x11: Store a back pointer to the backend in the stage

Since we access it in order to get the X11 Display pointer, it makes
sense to have the ClutterBackendX11 already available inside the
ClutterStageX11 structure, and avoid the pattern:

  ClutterBackend *backend = clutter_get_default_backend ();
  ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);

which costs us a function call, a type cast and an unused variable.

13 years agotest-path: Fix the test when running against latest Cairo versions
Neil Roberts [Fri, 28 Jan 2011 18:11:38 +0000 (18:11 +0000)]
test-path: Fix the test when running against latest Cairo versions

Cairo has recently changed so that it no longer adds a final move-to
command when the path ends with a close. This patch makes the test
check the run-time version number of Cairo to avoid duplicating this
behaviour when testing the conversion to and from a Cairo path.

13 years agoclutter-stage-x11: Don't ensure the viewport when the window moves
Neil Roberts [Tue, 25 Jan 2011 15:53:35 +0000 (15:53 +0000)]
clutter-stage-x11: Don't ensure the viewport when the window moves

When we receive a ConfigureNotify event that doesn't affect the size
of the window (only the position) then we were still calling
clutter_stage_ensure_viewport which ends up queueing a full stage
redraw. This patch makes it so that it only ensures the viewport when
the size changes as it already did for avoiding queueing a relayout.

It now also avoids setting the clipped redraws cool off period when
the window only moves under the assumption that it's only necessary
for size changes.

13 years agoanimator: Only free the animator key when we've finished with it
Rob Bradford [Mon, 24 Jan 2011 18:41:49 +0000 (18:41 +0000)]
animator: Only free the animator key when we've finished with it

Fixes: http://bugzilla.clutter-project.org/show_bug.cgi?id=2530

13 years agoInclude stdint.h when using uint32_t
Emmanuele Bassi [Wed, 26 Jan 2011 10:32:42 +0000 (10:32 +0000)]
Include stdint.h when using uint32_t

Since the XI2 device manager code is going to be compiled only on
POSIX compliant systems, we can safely assume the presence of stdint.h
and include it unconditionally.

13 years agobind-constraint: Add BIND_POSITION and BIND_SIZE
Emmanuele Bassi [Tue, 25 Jan 2011 11:10:29 +0000 (11:10 +0000)]
bind-constraint: Add BIND_POSITION and BIND_SIZE

CLUTTER_BIND_POSITION and CLUTTER_BIND_SIZE are two convenience
enumeration values for binding x and y, and width and height
respectively, using a single ClutterBindConstraint.

13 years agox11: Remove more private symbols
Emmanuele Bassi [Tue, 25 Jan 2011 11:00:20 +0000 (11:00 +0000)]
x11: Remove more private symbols

Some private functions escaped my wrath in commit
a277b4091a3fa09a39cf001809c3048eb27f3952.

Thanks to: Emilio Pozuelo Monfort on #clutter

13 years agopipeline: fix for _init_multi_property_sparse_state
Robert Bragg [Mon, 24 Jan 2011 18:42:28 +0000 (18:42 +0000)]
pipeline: fix for _init_multi_property_sparse_state

When copying COMBINE state in
_cogl_pipeline_layer_init_multi_property_sparse_state we would read some
state from the destination layer (invalid data potentially), then
redundantly set the value back on the destination. This was picked up by
valgrind, and the code is now more careful about how it references the
src layer vs the destination layer.

13 years agoframebuffer: flush journal when switching framebuffers
Robert Bragg [Fri, 21 Jan 2011 19:05:23 +0000 (19:05 +0000)]
framebuffer: flush journal when switching framebuffers

There is currently a problem with per-framebuffer journals in that it's
possible to create a framebuffer from a texture which then gets rendered
too but the framebuffer (and corresponding journal) can be freed before
the texture gets used to draw with.

Conceptually we want to make sure when freeing a framebuffer that - if
it is associated with a texture - we flush the journal as the last thing
before really freeing the framebuffer's meta data. Technically though
this is awkward to implement since the obvious mechanism for us to be
notified about the framebuffer's destruction (by setting some user data
internally with a callback) notifies when the framebuffer has a
ref-count of 0. This means we'd have to be careful what we do with the
framebuffer to consider e.g. recursive destruction; anything that would
set more user data on the framebuffer while it is being destroyed and
ensuring nothing else gets notified of the framebuffer's destruction
before the journal has been flushed.

For simplicity, for now, this patch provides another solution which is
to flush framebuffer journals whenever we switch away from a given
framebuffer via cogl_set_framebuffer or cogl_push/pop_framebuffer. The
disadvantage of this approach is that we can't batch all the geometry of
a scene that involves intermediate renders to offscreen framebufers.
Clutter is doing this more and more with applications that use the
ClutterEffect APIs so this is a shame. Hopefully this will only be a
stop-gap solution while we consider how to reliably support journal
logging across framebuffer changes.

13 years agocogl-clip-stack: Fix flushing multiple stencil rectangles
Neil Roberts [Mon, 24 Jan 2011 17:32:06 +0000 (17:32 +0000)]
cogl-clip-stack: Fix flushing multiple stencil rectangles

When flushing a clip stack that contains more than one rectangle which
needs to use the stencil buffer the code takes a different path so
that it can combine the new rectangle with the existing contents of
the stencil buffer. However it was not correctly flushing the
modelview and projection matrices so that rectangle would be in the
wrong place.

13 years agotest-clip: Replace the ellipse with a rotated rectangle
Neil Roberts [Mon, 24 Jan 2011 17:17:16 +0000 (17:17 +0000)]
test-clip: Replace the ellipse with a rotated rectangle

With test-clip it's possible to draw three different shapes depending
on what mouse button is used: a rectangle, an ellipse or a path
containing multiple shapes. However the ellipse is also a path so it
doesn't really test anything extra from the third option. This
replaces the ellipse with a rectangle that is first rotated by the
modelview matrix. The rotated matrix won't be able to use the scissor
so it can be used to test stencil and clip plane clipping.

13 years agocogl-debug: Add a debug option for tracing clipping
Neil Roberts [Mon, 24 Jan 2011 16:36:56 +0000 (16:36 +0000)]
cogl-debug: Add a debug option for tracing clipping

This adds a COGL_DEBUG=clipping option that reports how the clip is
being flushed. This is needed to determine whether the scissor,
stencil clip planes or software clipping is being used.

13 years agocogl-debug: Split the flags to support more than 32
Neil Roberts [Mon, 24 Jan 2011 14:28:00 +0000 (14:28 +0000)]
cogl-debug: Split the flags to support more than 32

The CoglDebugFlags are now stored in an array of unsigned ints rather
than a single variable. The flags are accessed using macros instead of
directly peeking at the cogl_debug_flags variable. The index values
are stored in the enum rather than the actual mask values so that the
enum doesn't need to be more than 32 bits wide. The hope is that the
code to determine the index into the array can be optimized out by the
compiler so it should have exactly the same performance as the old
code.

13 years agocogl-pipeline: Flush the lighting params in common code not vertend
Neil Roberts [Fri, 14 Jan 2011 11:11:44 +0000 (11:11 +0000)]
cogl-pipeline: Flush the lighting params in common code not vertend

The lighting parameters such as the diffuse and ambient colors were
previously only flushed in the fixed vertend. This meant that if a
vertex shader was used then they would not be set. The lighting
parameters are uniforms which are just as useful in a fragment shader
so it doesn't really make sense to set them in the vertend. They are
now flushed in the common cogl-pipeline-opengl code but the code is
#ifdef'd for GLES2 because they need to be part of the progend in that
case.

13 years agocogl-pipeline-progend-glsl: Generalize updating GLES2 uniforms
Neil Roberts [Thu, 13 Jan 2011 18:24:22 +0000 (18:24 +0000)]
cogl-pipeline-progend-glsl: Generalize updating GLES2 uniforms

The uniforms for the alpha test reference value and point size on
GLES2 are updating using similar code. This generalizes the code so
that there is a static array of predefined builtin uniforms which
contains the uniform name, a pointer to a function to get the value
from the pipeline, a pointer to a function to update the uniform and a
flag representing which CoglPipelineState change affects the
uniform. The uniforms are then updated in a loop. This should simplify
adding more builtin uniforms.