profile/ivi/clutter.git
13 years agoclutter-backend-win32: Use g_object_unref on the stage manager
Neil Roberts [Mon, 1 Nov 2010 15:13:12 +0000 (15:13 +0000)]
clutter-backend-win32: Use g_object_unref on the stage manager

Previously when trying to destroy all of the stages in the backend
dispose function it would poke directly in the ClutterStageManager
struct to get the list. In 8613013ab08 the defintion of
ClutterStageManager moved to a different header which isn't included
by the Win32 backend so it wouldn't compile. In that commit the X11
backend was changed to unref the stage manager instead of poking in
the internals so we should do the same for the win32 backend.

13 years agoclone: Remove checks in set_source_internal()
Damien Lespiau [Sun, 31 Oct 2010 18:34:23 +0000 (18:34 +0000)]
clone: Remove checks in set_source_internal()

One of the ideas behind _internal() functions is to be able to have a
version of the original one without checks (among other things). As
these functions are either static or private to the library, we control
the arguments given to it, and thus no need for checking them again
here.

13 years agotexture: Warn when the file loaded from a ClutterScript can't be found
Damien Lespiau [Sun, 31 Oct 2010 16:49:40 +0000 (16:49 +0000)]
texture: Warn when the file loaded from a ClutterScript can't be found

Telling the user about files not found when loading a ClutterScript with
ClutterTextures in it is very useful and can save a few minutes (or
hours) of frustation because it "does not work".

13 years agoMerge cogl-program-{gl,gles}.c into one cogl-program.c
Neil Roberts [Fri, 15 Oct 2010 17:00:29 +0000 (18:00 +0100)]
Merge cogl-program-{gl,gles}.c into one cogl-program.c

This merges the two implementations of CoglProgram for the GLES2 and
GL backends into one. The implementation is more like the GLES2
version which would track the uniform values and delay sending them to
GL. CoglProgram is now effectively just a GList of CoglShaders along
with an array of stored uniform values. CoglProgram never actually
creates a GL program, instead this is left up to the GLSL material
backend. This is necessary on GLES2 where we may need to relink the
user's program with different generated shaders depending on the other
emulated fixed function state. It will also be necessary in the future
GLSL backends for regular OpenGL. The GLSL and ARBfp material backends
are now the ones that create and link the GL program from the list of
shaders. The linked program is attached to the private material state
so that it can be reused if the CoglProgram is used again with the
same material. This does mean the program will get relinked if the
shader is used with multiple materials. This will be particularly bad
if the legacy cogl_program_use function is used because that
effectively always makes one-shot materials. This problem will
hopefully be alleviated if we make a hash table with a cache of
generated programs. The cogl program would then need to become part of
the hash lookup.

Each CoglProgram now has an age counter which is incremented every
time a shader is added. This is used by the material backends to
detect when we need to create a new GL program for the user program.

The internal _cogl_use_program function now takes a GL program handle
rather than a CoglProgram. It no longer needs any special differences
for GLES2. The GLES2 wrapper function now also uses this function to
bind its generated shaders.

The ARBfp shaders no longer store a copy of the program source but
instead just directly create a program object when cogl_shader_source
is called. This avoids having to reupload the source if the same
shader is used in multiple materials.

There are currently a few gross hacks to get the GLES2 backend to work
with this. The problem is that the GLSL material backend is now
generating a complete GL program but the GLES2 wrapper still needs to
add its fixed function emulation shaders if the program doesn't
provide either a vertex or fragment shader. There is a new function in
the GLES2 wrapper called _cogl_gles2_use_program which replaces the
previous cogl_program_use implementation. It extracts the GL shaders
from the GL program object and creates a new GL program containing all
of the shaders plus its fixed function emulation. This new program is
returned to the GLSL material backend so that it can still flush the
custom uniforms using it. The user_program is attached to the GLES2
settings struct as before but its stored using a GL program handle
rather than a CoglProgram pointer. This hack will go away once the
GLSL material backend replaces the GLES2 wrapper by generating the
code itself.

Under Mesa this currently generates some GL errors when glClear is
called in test-cogl-shader-glsl. I think this is due to a bug in Mesa
however. When the user program on the material is changed the GLSL
backend gets notified and deletes the GL program that it linked from
the user shaders. The program will still be bound in GL
however. Leaving a deleted shader bound exposes a bug in Mesa's
glClear implementation. More details are here:

https://bugs.freedesktop.org/show_bug.cgi?id=31194

13 years agocogl: Use separate materials for set_source_color and texture
Neil Roberts [Wed, 27 Oct 2010 14:07:03 +0000 (15:07 +0100)]
cogl: Use separate materials for set_source_color and texture

Previously cogl_set_source_color and cogl_set_source_texture modified
a single global material. If an application then mixes using
cogl_set_source_color and texture then the material will constantly
need a new ARBfp program because the numbers of layers alternates
between 0 and 1. This patch just adds a second global material that is
only used for cogl_set_source_texture. I think it would still end up
flushing the journal if cogl_set_source_texture is used with multiple
different textures but at least it should avoid a recompile unless the
texture target also changes. It might be nice to somehow attach a
material to the CoglTexture for use with cogl_set_source_texture but
it would be difficult to implement this without creating a circular
reference.

13 years agoMove IndicesType and VerticesMode typedefs to cogl-types.h
Robert Bragg [Tue, 12 Oct 2010 11:53:44 +0000 (12:53 +0100)]
Move IndicesType and VerticesMode typedefs to cogl-types.h

This moves the CoglIndicesType and CoglVerticesMode typedefs from
cogl-vertex-buffer.h to cogl-types.h so they can be shared with the
anticipated cogl vertex attribute API.

13 years agobuffer: BufferBindTarget + BufferUsageHint enum renaming
Robert Bragg [Tue, 26 Oct 2010 15:05:00 +0000 (16:05 +0100)]
buffer: BufferBindTarget + BufferUsageHint enum renaming

This renames the BufferBindTarget + BufferUsageHint enums to match the
anticipated new APIs for "index arrays" and "vertex arrays" as opposed
to using the terms "vertices" or "indices".

13 years agobuffer: warn if (offset + size) > buffer->size
Robert Bragg [Mon, 18 Oct 2010 17:50:02 +0000 (18:50 +0100)]
buffer: warn if (offset + size) > buffer->size

previously we would silently bail out if the given offset + data size
would overflow the buffer size. Now we use g_return_val_if_fail so we
get a warning if we hit this case.

13 years agopixel-array: Remove some benign variables
Robert Bragg [Tue, 12 Oct 2010 12:25:05 +0000 (13:25 +0100)]
pixel-array: Remove some benign variables

There were some completely unused static global variables declared in
cogl-pixel-array.c which this patch removes.

13 years agopixel-array: Remove flags member and flag macros
Robert Bragg [Tue, 12 Oct 2010 12:23:44 +0000 (13:23 +0100)]
pixel-array: Remove flags member and flag macros

There are no flags associated with pixel-arrays so we don't need the
flags member or flag macros.

13 years agobuffer: Add a store_created bit field member
Robert Bragg [Tue, 26 Oct 2010 15:06:46 +0000 (16:06 +0100)]
buffer: Add a store_created bit field member

This adds a store_created bit field to CoglBuffer so we know if the
underlying buffer has been allocated yet. Previously the code was trying
to do something really wrong by accidentally using the
COGL_PIXEL_ARRAY_FLAG_IS_SET macro (note "PIXEL_ARRAY") and what is more
odd was the declaration of a CoglPixelArray *pixel_array in
cogl-buffer.c which the buffer was being cast too before calling using
the macro. Probably this was the fall-out of some previous code
re-factoring.

13 years agobuffer: remove flag macros
Robert Bragg [Tue, 12 Oct 2010 10:46:29 +0000 (11:46 +0100)]
buffer: remove flag macros

All the macros get used for are to |= (a new flag bit), &= ~(a flag bit)
or use the & operator to test if a flag bit is set. I haven't found the
code more readable with these macros, but several times now I've felt
the need to double check if these macros do anything else behind the
hood or I've forgotten what flags are available so I've had to go to the
macro definition to see what the full enum names are for the flags (the
macros use symbol concatenation) so I can search for the definition of
all the flags. It turns out they are defined next to the macro so you
don't have to search far, but without the macro that wouldn't have been
necessary.

The more common use of the _IS_SET macro is actually more concise
expanded and imho since it doesn't hide anything in a separate header
file the code is more readable without the macro.

13 years agomaterial: Adds _cogl_material_get_layer_texture
Robert Bragg [Tue, 12 Oct 2010 11:35:47 +0000 (12:35 +0100)]
material: Adds _cogl_material_get_layer_texture

This is a counter part for _cogl_material_layer_get_texture which takes
a layer index instead of a direct CoglMaterialLayer pointer. The aim is
to phase out code that directly iterates the internal layer pointers of
a material since the layer pointers can change if any property of any
layer is changed making direct layer pointers very fragile.

13 years agomaterial: add internal layer filter getters
Robert Bragg [Mon, 18 Oct 2010 18:00:50 +0000 (19:00 +0100)]
material: add internal layer filter getters

This adds internal _cogl_material_get_layer_filters and
_cogl_material_get_layer_{min,mag}_filter functions which can be used to
query the filters associated with a layer using a layer_index, as
opposed to a layer pointer. Accessing layer pointers is considered
deprecated so we need to provide layer_index based replacements.

13 years agomaterial: Adds missing get_layer_wrap_mode_xyz prototypes
Robert Bragg [Sun, 1 Aug 2010 22:05:28 +0000 (23:05 +0100)]
material: Adds missing get_layer_wrap_mode_xyz prototypes

This adds missing getter function prototypes for
cogl_material_get_layer_wrap_mode_{s,t,p}

13 years agovertex-buffer: remove the unstrided CBO type
Robert Bragg [Sun, 1 Aug 2010 15:07:38 +0000 (16:07 +0100)]
vertex-buffer: remove the unstrided CBO type

When we come to submitting the users given attributes we sort them into
different types of buffers. Previously we had three types; strided,
unstrided and multi-pack. Really though unstrided was just a limited
form of multi-pack buffer and didn't imply any hind of special
optimization so this patch consolidates some code by reducing to just
two types; strided and multi-pack.

13 years agomaterial: Adds _cogl_material_pre_paint_for_layer
Robert Bragg [Wed, 28 Jul 2010 12:59:34 +0000 (13:59 +0100)]
material: Adds _cogl_material_pre_paint_for_layer

This is a counter part for _cogl_material_layer_pre_paint which takes a
layer index instead of a direct CoglMaterialLayer pointer. The aim is to
phase out code that directly iterates the internal layer pointers of a
material since the layer pointers can change if any property of any
layer is changed making direct layer pointers very fragile.

13 years agocogl: Adds {push,pop,get}_source functions
Robert Bragg [Mon, 25 Oct 2010 12:25:21 +0000 (13:25 +0100)]
cogl: Adds {push,pop,get}_source functions

This exposes the idea of a stack of source materials instead of just
having a single current material. This allows the writing of orthogonal
code that can change the current source material and restore it to its
previous state. It also allows the implementation of new composite
primitives that may want to validate the current source material and
possibly make override changes in a derived material.

13 years agoMerge branch 'private-cleanup'
Emmanuele Bassi [Mon, 25 Oct 2010 22:44:53 +0000 (23:44 +0100)]
Merge branch 'private-cleanup'

* private-cleanup:
  Add copyright notices
  Clean up clutter-private.h/6
  Clean up clutter-private.h/5
  Clean up clutter-private.h/4
  Clean up clutter-private.h/3
  Clean up clutter-private.h/2
  Clean up clutter-private.h/1

13 years agoPost-release version bump to 1.5.5
Emmanuele Bassi [Mon, 25 Oct 2010 16:44:27 +0000 (17:44 +0100)]
Post-release version bump to 1.5.5

13 years agoRelease Clutter 1.5.4
Emmanuele Bassi [Mon, 25 Oct 2010 16:30:52 +0000 (17:30 +0100)]
Release Clutter 1.5.4

13 years agostate: Correct the documentation
Chris Lord [Fri, 22 Oct 2010 16:41:06 +0000 (17:41 +0100)]
state: Correct the documentation

Correct the argument order and replace all occurrences of
clutter_state_change() with the appropriate clutter_state_set_state() or
clutter_state_warp_to_state().

13 years agostate: Fix warping to the current state during transitions
Chris Lord [Fri, 22 Oct 2010 15:32:05 +0000 (16:32 +0100)]
state: Fix warping to the current state during transitions

If you warp to a state, it should be immediately set. Check if the
animation is in progress when warping to a state and don't short-circuit
in the already-set check if we're not animating.

13 years agostate: Handle setting keys for the current target state
Chris Lord [Fri, 22 Oct 2010 15:13:16 +0000 (16:13 +0100)]
state: Handle setting keys for the current target state

Add special behaviour when you set the key of the current target state:
- If the state is transitioning, add/modify the interval so that the new
  key transitions from the current time (taking into account pre-delay) to
  its target final property
- If the state is set but has already finished animating/was warped to,
  set the property immediately

13 years agostate: Fix crasher when removing the last key of a transitioning state
Chris Lord [Fri, 22 Oct 2010 14:24:49 +0000 (15:24 +0100)]
state: Fix crasher when removing the last key of a transitioning state

If ClutterState is in the middle of a transition and you remove all the
keys from the target state, the target state will be destroyed without
stopping the animation/unsetting the target state. This caused an invalid
memory access.

13 years agostate: Allow setting a NULL state
Chris Lord [Thu, 21 Oct 2010 15:51:45 +0000 (16:51 +0100)]
state: Allow setting a NULL state

Allow setting a %NULL state. This has the effect of unsetting the current
state and stopping all animation. This allows you to, for example, start
a state transition, set the state to NULL, alter the state transition
and then resume it again, by just setting it.

13 years agoUpdate NEWS
Emmanuele Bassi [Mon, 25 Oct 2010 16:16:24 +0000 (17:16 +0100)]
Update NEWS

13 years agoMerge branch 'wip/path-constraint'
Emmanuele Bassi [Mon, 25 Oct 2010 16:09:46 +0000 (17:09 +0100)]
Merge branch 'wip/path-constraint'

* wip/path-constraint:
  docs: Add PathConstraint
  tests: Add a PathConstraint interactive test
  Add ClutterPathConstraint
  actor-box: Add setters for origin and size

13 years agodocs: Add PathConstraint
Emmanuele Bassi [Mon, 25 Oct 2010 15:09:40 +0000 (16:09 +0100)]
docs: Add PathConstraint

13 years agotests: Add a PathConstraint interactive test
Emmanuele Bassi [Mon, 25 Oct 2010 14:47:15 +0000 (15:47 +0100)]
tests: Add a PathConstraint interactive test

13 years agoAdd ClutterPathConstraint
Emmanuele Bassi [Mon, 25 Oct 2010 14:46:04 +0000 (15:46 +0100)]
Add ClutterPathConstraint

ClutterPathConstraint is a simple Constraint implementation that
modifies the allocation of the Actor to which is has been applied using
a progress value and a ClutterPath.

13 years agoactor-box: Add setters for origin and size
Emmanuele Bassi [Mon, 25 Oct 2010 14:45:35 +0000 (15:45 +0100)]
actor-box: Add setters for origin and size

13 years agoeglnative: Fix the type of stage for eglnative
Damien Lespiau [Thu, 14 Oct 2010 15:48:00 +0000 (11:48 -0400)]
eglnative: Fix the type of stage for eglnative

CLUTTER_TYPE_STAGE_EGLNATIVE does not exist any more, use
CUTTER_TYPE_STAGE_EGL instead.

13 years agowin32: Fix clutter_win32_disable_event_retrieval
Neil Roberts [Thu, 21 Oct 2010 16:20:44 +0000 (17:20 +0100)]
win32: Fix clutter_win32_disable_event_retrieval

There was previously a flag that gets set when this function was
called but nothing checked it so the function effectively did
nothing. Also the flag was a member of the backend struct but this
can't be used because the function should be called before
clutter_init so the backend is not ready yet. This patch makes the
event disabling work more like the X11 backend and set a global
variable instead.

13 years agowin32: Use _clutter_actor_rerealize() like X11 backend does
Ole André Vadla Ravnås [Thu, 14 Oct 2010 13:30:54 +0000 (15:30 +0200)]
win32: Use _clutter_actor_rerealize() like X11 backend does

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

13 years agowin32: Add a public clutter_win32_handle_event function
Neil Roberts [Fri, 27 Aug 2010 14:54:21 +0000 (15:54 +0100)]
win32: Add a public clutter_win32_handle_event function

This function handles a single windows message. The idea is that it
could be used by clutter-gtk to forward on events from a
GdkEventFilter. The function replaces the old message_translate()
function. That function didn't translate the event anymore anyway and
instead it could generate multiple events so
clutter_win32_handle_event seems like a more appropriate name. The
function returns TRUE or FALSE depending on whether the event was
completely handled instead of setting call_window_proc.

13 years agoclutter-stage: Set the Cogl framebuffer size after allocating
Neil Roberts [Thu, 21 Oct 2010 15:27:17 +0000 (16:27 +0100)]
clutter-stage: Set the Cogl framebuffer size after allocating

When handling an allocation on the stage, Clutter uses the oppurtunity
to inform Cogl of the new size of the framebuffer so that it can
handle the viewport correctly. It queries the size of the window
implementation using a backend virtual function. However it was doing
this before letting the backend handle the allocation so on Win32 it
would end up using the previous framebuffer size. This wasn't
affecting the X11 backend because in that case the resizes are
asynchronous so setting the stage size causes one allocation which
ends up sending a window size request. Eventually a ConfigureNotify is
received which causes the size of the stage to be set again and
another allocation is fired meaning the framebuffer size will be set
again this time with the correct size. In Win32 the resizes are
synchronous so we don't have this second allocation.

13 years agocogl-context-winsys: Avoid zero-length arrays
Neil Roberts [Mon, 25 Oct 2010 12:15:01 +0000 (13:15 +0100)]
cogl-context-winsys: Avoid zero-length arrays

When compiling for non-glx platforms the winsys feature data array
ends up empty. Empty arrays cause problems for MSVC so this patch adds
a stub entry so that the array always has at least one entry.

Based on a patch by Ole André Vadla Ravnås

13 years agoAvoid mixing declarations and code
Neil Roberts [Mon, 25 Oct 2010 12:08:52 +0000 (13:08 +0100)]
Avoid mixing declarations and code

Mixing declarations and code causes problems for MSVC as it is a C99
feature so we should try to avoid it.

13 years agoAvoid variable length arrays in clutter-backend-x11
Neil Roberts [Mon, 25 Oct 2010 12:07:50 +0000 (13:07 +0100)]
Avoid variable length arrays in clutter-backend-x11

There was an array whose length was define by a static const int
variable. GCC seems to consider this a variable-length array so it
will cause warnings now that -Wvla is enabled. We might as well make
this constant a #define instead to avoid the warning.

13 years agoAdd -Wdeclaration-after-statement and -Wvla to maintainer CFLAGS
Neil Roberts [Mon, 25 Oct 2010 12:03:39 +0000 (13:03 +0100)]
Add -Wdeclaration-after-statement and -Wvla to maintainer CFLAGS

These warnings pick up C99 extensions that are commonly accidentally
used and which cause problems when compiling with MSVC.

13 years agoAvoid warnings on ClutterClone with a NULL source
Giovanni Campagna [Sun, 24 Oct 2010 12:45:16 +0000 (14:45 +0200)]
Avoid warnings on ClutterClone with a NULL source

clutter_clone_apply_transform should check the source before calling
methods on it, else criticals will be emitted.

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

13 years agoUpdate NEWS
Emmanuele Bassi [Mon, 25 Oct 2010 11:31:50 +0000 (12:31 +0100)]
Update NEWS

13 years agobinding-pool: Use the correct marshaller
Ole André Vadla Ravnås [Sat, 9 Oct 2010 21:07:26 +0000 (23:07 +0200)]
binding-pool: Use the correct marshaller

13 years agointerval: Remember to chain up to parent in finalize()
Ole André Vadla Ravnås [Thu, 14 Oct 2010 11:11:46 +0000 (13:11 +0200)]
interval: Remember to chain up to parent in finalize()

13 years agocogl-texture-2d-sliced: Use the other backends for the slices
Neil Roberts [Mon, 4 Oct 2010 13:34:24 +0000 (14:34 +0100)]
cogl-texture-2d-sliced: Use the other backends for the slices

Instead of directly manipulating GL textures itself,
CoglTexture2DSliced now works in terms of CoglHandles. It creates the
texture slices using cogl_texture_new_with_size which should always
end up creating a CoglTexture2D because the size should fit. This
allows us to avoid replicating some code such as the first pixel
mipmap tracking and it better enforces the separation that each
texture backend is the only place that contains code dealing with each
texture target.

13 years agoSupport foreign textures in the texture-2d and rectangle backends
Neil Roberts [Mon, 4 Oct 2010 14:27:38 +0000 (15:27 +0100)]
Support foreign textures in the texture-2d and rectangle backends

This adds two new internal functions to create a foreign texture for
the texture 2d and rectangle backends. cogl_texture_new_from_foreign
will now use one of these backends directly if there is no waste
instead of always using the sliced texture backend.

13 years agobuild: Dist cookbook.xsl
Damien Lespiau [Fri, 22 Oct 2010 05:52:27 +0000 (06:52 +0100)]
build: Dist cookbook.xsl

cookbook.xsl was not in EXTRA_DIST, so the cookbook was not buildable
with released tarballs.

13 years agoAdd copyright notices
Emmanuele Bassi [Thu, 21 Oct 2010 12:13:00 +0000 (13:13 +0100)]
Add copyright notices

13 years agoClean up clutter-private.h/6
Emmanuele Bassi [Thu, 21 Oct 2010 11:16:05 +0000 (12:16 +0100)]
Clean up clutter-private.h/6

Move all Actor private API to a separate file.

13 years agoClean up clutter-private.h/5
Emmanuele Bassi [Thu, 21 Oct 2010 10:59:50 +0000 (11:59 +0100)]
Clean up clutter-private.h/5

Move PaintVolume private API to a separate header.

13 years agoClean up clutter-private.h/4
Emmanuele Bassi [Thu, 21 Oct 2010 10:49:37 +0000 (11:49 +0100)]
Clean up clutter-private.h/4

Move the private Backend API to a separate header.

This also allows us to finally move the class vtable and instance
structure to a separate file and plug the visibility hole that left
the Backend class bare for everyone to poke into.

13 years agoClean up clutter-private.h/3
Emmanuele Bassi [Thu, 21 Oct 2010 10:29:09 +0000 (11:29 +0100)]
Clean up clutter-private.h/3

Move Stage private API to a separate header.

13 years agoClean up clutter-private.h/2
Emmanuele Bassi [Thu, 21 Oct 2010 09:59:49 +0000 (10:59 +0100)]
Clean up clutter-private.h/2

Move StageManager private API to a different header.

13 years agoClean up clutter-private.h/1
Emmanuele Bassi [Thu, 21 Oct 2010 09:54:14 +0000 (10:54 +0100)]
Clean up clutter-private.h/1

Move DeviceManager/InputDevice private API to a different header.

13 years agobuild: Go back to autoreconf
Emmanuele Bassi [Wed, 20 Oct 2010 08:42:34 +0000 (09:42 +0100)]
build: Go back to autoreconf

After testing and distchecking, I verified that autoreconf can still be
used to rebuild the autotools setup.

Thanks to Javier Jardón for the second pair of eyes.

13 years agobuild: Remove unused Makefile.am
Emmanuele Bassi [Tue, 19 Oct 2010 16:48:15 +0000 (17:48 +0100)]
build: Remove unused Makefile.am

We switched to a non-recursive layout, hence we don't need Makefile.am
in the osx/ and fruity/ sub-directories.

13 years agoconform: Remove unnecessary destroy() calls
Emmanuele Bassi [Tue, 19 Oct 2010 11:32:02 +0000 (12:32 +0100)]
conform: Remove unnecessary destroy() calls

Unparented actors are owned by the Script instance, and if that goes
away then the actors go away with it. The fact that we needed an
explicit destroy() before was a hint of a memory management issue that I
blissfully - and regretfully - ignored for the sake of a passing test
suite.

13 years agobuild: Add test wrappers to the main ignore file
Emmanuele Bassi [Tue, 19 Oct 2010 10:03:13 +0000 (11:03 +0100)]
build: Add test wrappers to the main ignore file

They are generated at configure time, so it's a good idea to have them
in the main ignore file instead of adding them to the built ignore files
under tests.

13 years agobuild: Show whether we have XComposite
Emmanuele Bassi [Tue, 19 Oct 2010 09:48:39 +0000 (10:48 +0100)]
build: Show whether we have XComposite

Since we're doing it for other optional X11 extensions as well.

13 years agox11: Protect XComposite API calls
Emmanuele Bassi [Tue, 19 Oct 2010 09:40:57 +0000 (10:40 +0100)]
x11: Protect XComposite API calls

Since we allow compiling Clutter without the XComposite extension
available, we need to protect the calls to the XComposite API with
the guards provided by the configure script.

13 years agoscript: Fix the memory management
Emmanuele Bassi [Mon, 13 Sep 2010 20:29:52 +0000 (23:29 +0300)]
script: Fix the memory management

Currently, the memory management in ClutterScript is overly complicated.
The basic design tenet should be:

  - ClutterScript owns a reference on every object it creates

This allows the Script instance to reliably handle the lifetime of the
instances from creation to disposal.

In case of unmerge, the Script instance should destroy any Actor
instance, except for the Stage, and release the reference it owns. The
Stage is special because it's really owned by Clutter itself, and it
should be destroyed explicitly.

When disposing the Script itself, it should just release the reference;
any parented actor, or any InitiallyUnowned instance, will then be
managed by the parent object, as they should, while every GObject
instance will go away, as documented.

This commit is based on a patch by:

  Henrik Hedberg <hhedberg@innologies.fi>

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

13 years agodebug: Do not use '&' in the messages
Emmanuele Bassi [Tue, 19 Oct 2010 00:41:05 +0000 (01:41 +0100)]
debug: Do not use '&' in the messages

Use ':' as a separator between G_STRLOC and the debug message, like we
do for warnings.

13 years agoRemove unused variables
Emmanuele Bassi [Tue, 19 Oct 2010 00:40:44 +0000 (01:40 +0100)]
Remove unused variables

13 years agobuild: Fix CLUTTER_EGL_BACKEND definition for eglnative and cex100
Damien Lespiau [Thu, 14 Oct 2010 14:33:17 +0000 (15:33 +0100)]
build: Fix CLUTTER_EGL_BACKEND definition for eglnative and cex100

CLUTTER_EGL_BACKEND is used to define a special EGL native backend to
use and was introduced for the CEX100 EGL backend. Unfortunately
CLUTTER_EGL_BACKEND was defined to "cex100" for eglnative, which is
obviously wrong.

The paches defines the right values for CLUTTER_EGL_BACKEND for the
eglnative and cex100 flavours.

13 years agobuild: Fix EGL/CEX100 build with GLES2
Damien Lespiau [Thu, 14 Oct 2010 15:32:13 +0000 (16:32 +0100)]
build: Fix EGL/CEX100 build with GLES2

Some headers files have been renamed or removed and the gles(2) did not
compile anymore, fix that.

13 years agocairo-texture: Allow overriding the surface creation
Emmanuele Bassi [Fri, 15 Oct 2010 16:35:41 +0000 (17:35 +0100)]
cairo-texture: Allow overriding the surface creation

By using a new signal, ::create-surface (width, height), it should be
possible for third party code and sub-classes to override the default
surface creation code in CairoSurface.

This commit takes a bit of the patch from:

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

which cleans up CairoTexture; the idea, mutuated from that bug, is that
the CairoTexture actor checks whether the surface it has it's an image
one, and in that case it uses a Cogl texture as the backing store. In
case the surface is not an image one we assume that the surface itself
has some way of updating the GL state and flush the surface.

13 years agobuild: Depend on cairo-gobject
Emmanuele Bassi [Fri, 15 Oct 2010 15:09:19 +0000 (16:09 +0100)]
build: Depend on cairo-gobject

Starting from version 1.10, Cairo ships GTypes for its data types.

13 years agobuild: Remove unnecessary g-i version check
Emmanuele Bassi [Fri, 15 Oct 2010 15:09:12 +0000 (16:09 +0100)]
build: Remove unnecessary g-i version check

13 years agoMove more classes to install_properties()
Emmanuele Bassi [Fri, 15 Oct 2010 14:24:27 +0000 (15:24 +0100)]
Move more classes to install_properties()

13 years agoRemove unnecessary GLib version checks
Emmanuele Bassi [Fri, 8 Oct 2010 14:47:00 +0000 (15:47 +0100)]
Remove unnecessary GLib version checks

We now depend on a newer version of GLib than those checks tested for.

13 years agoUse G_DEFINE_BOXED_TYPE for all boxed types
Emmanuele Bassi [Fri, 8 Oct 2010 14:21:57 +0000 (15:21 +0100)]
Use G_DEFINE_BOXED_TYPE for all boxed types

We actually need a couple more macros for registering GValue
transformation functions. Those should be added to upstream
GLib.

13 years agoRemove conditional wrappers for property installation/notification
Emmanuele Bassi [Fri, 8 Oct 2010 13:49:47 +0000 (14:49 +0100)]
Remove conditional wrappers for property installation/notification

For the time being, just keep the #define's.

13 years agoUse G_DEFINE_INTERFACE
Emmanuele Bassi [Fri, 8 Oct 2010 13:47:46 +0000 (14:47 +0100)]
Use G_DEFINE_INTERFACE

GObject provides us with a nice, safe macro for defining interface
types.

13 years agobuild: Depend on GLib ≥ 2.26.0
Emmanuele Bassi [Fri, 8 Oct 2010 13:47:13 +0000 (14:47 +0100)]
build: Depend on GLib ≥ 2.26.0

We are going to need some new macros and API.

13 years agoactor: Add more checks to the redraw queue
Emmanuele Bassi [Fri, 15 Oct 2010 15:05:44 +0000 (16:05 +0100)]
actor: Add more checks to the redraw queue

13 years agomoduleset: Add Atk as a Clutter dependency
Emmanuele Bassi [Fri, 15 Oct 2010 14:24:58 +0000 (15:24 +0100)]
moduleset: Add Atk as a Clutter dependency

13 years agoosx: Fix glib.h include path
Emmanuele Bassi [Fri, 15 Oct 2010 11:40:43 +0000 (12:40 +0100)]
osx: Fix glib.h include path

The fix for removing glib/gmain.h introduced the wrong path for glib.h.

13 years agoosx: Add button mask to the modifier state translation
Roland Peffer [Thu, 14 Oct 2010 17:23:02 +0000 (18:23 +0100)]
osx: Add button mask to the modifier state translation

The modifier state translation is missing the CLUTTER_BUTTON*_MASK.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
13 years agoThe amazing lazy-copy-back-repaint-page-flip
Kristian Høgsberg [Wed, 29 Sep 2010 21:10:44 +0000 (17:10 -0400)]
The amazing lazy-copy-back-repaint-page-flip

Always use pageflipping, but avoid full repaint by copying back dirty
regions from front to back.  Additionally, we dealy copying back until
we're ready to paint the new frame, so we can avoid copying areas that
will be repainted anyway.

This is the least amount of copying per frame we can get away with at all
and at the same time we don't have to worry about stalling the GPU on
synchronized blits since we always pageflip.

13 years agoAdd wayland backend
Kristian Høgsberg [Tue, 28 Sep 2010 14:17:46 +0000 (10:17 -0400)]
Add wayland backend

This adds a clutter backend for running under the wayland window system.
Initial cogl framebuffer integration by Robert Bragg.

13 years agoInitialize color masks lazily
Kristian Høgsberg [Mon, 27 Sep 2010 17:25:50 +0000 (13:25 -0400)]
Initialize color masks lazily

When we don't use a window system drawable, we can't query the color
masks at context initialization time.  Do it lazily so we're sure to have
a current context with a valid framebuffer.

13 years agoWhen unparenting an actor, remove queued redraws for all descendants
Robert Bragg [Thu, 14 Oct 2010 15:19:55 +0000 (16:19 +0100)]
When unparenting an actor, remove queued redraws for all descendants

We need to make sure that redraws queued for actors on a stage are for
actors actually in the stage. So in clutter_actor_unparent() descend
through the children and remove redraws. Just removing the actor itself
isn't good enough since an entire hierarchy can be removed from the
stage without breaking it up into individual actors.

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

This is based on an original patch from Owen Taylor who debugged the
root cause of this bug; thanks.

13 years agostage: handle unclipped redraw following clipped
Robert Bragg [Thu, 30 Sep 2010 17:42:40 +0000 (18:42 +0100)]
stage: handle unclipped redraw following clipped

In the case that an unclipped redraw of an actor is queued after a
clipped we should update any existing ClutterStageQueueRedrawEntry
so entry->has_clip = FALSE and free the previous clip.

13 years agoconform: Start cleaning up the conformance test suite
Emmanuele Bassi [Tue, 12 Oct 2010 16:31:15 +0000 (17:31 +0100)]
conform: Start cleaning up the conformance test suite

Re-order the units into a sensible list, with basic tests at the
beginning, and per-class tests at the end - with Cogl last.

Also, start renaming the unit functions from test_<foo> to <foo>,
so that the executable wrappers and the reports have sensible names.

13 years agoconform: Implement TEST_CONFORM_TODO() correctly
Emmanuele Bassi [Tue, 12 Oct 2010 16:11:52 +0000 (17:11 +0100)]
conform: Implement TEST_CONFORM_TODO() correctly

The TODO() macro for adding new tests to the test suite has always meant
to be implemented like the TODO block in Test::More, i.e. a test that is
assumed to fail, and which warns if it unexpectedly succeeds.

Since GTest lacks the expressivity of Test::More, the implementation
just verifies that the tests marked as TODO actually fail, and will fail
if they happen to succeed - at which point the developer will have to
change the macro to SIMPLE or SKIP.

13 years agoconform: Save the revision and date inside the test report
Emmanuele Bassi [Tue, 12 Oct 2010 14:43:42 +0000 (15:43 +0100)]
conform: Save the revision and date inside the test report

Even if gtester-report doesn't use that information (yet), we should
store the revision of Clutter that generated the report, and the date in
which the test suite was ran.

13 years agoconstraints: Remove unused variable
Emmanuele Bassi [Tue, 12 Oct 2010 14:43:27 +0000 (15:43 +0100)]
constraints: Remove unused variable

13 years agotests: Generate the stub scripts using sed
Neil Roberts [Mon, 11 Oct 2010 15:16:45 +0000 (16:16 +0100)]
tests: Generate the stub scripts using sed

Instead of trying to run ./test-conformance with the -l option to
generate a list of available tests it now runs sed on the
test-conform-main.c file instead. Running the generated executable is
a pain for cross-compiling so it would be nice to avoid it unless it's
absolutely necessary. Although you could tell people who are cross
compiling to just disable the conformance tests, this seems a shame
because they could still be useful along with the wrappers for example
if the cross compile is built to a shared network folder where the
tests can be run on the actual device.

The sed script is a little more ugly than it could be because it tries
to avoid using the GNU extensions '\+' and '\|'.

The script ends up placing restrictions on the format of the C file
because the tests must all be listed on one line each. There is now a
comment to explain this. Hopefully the trade off is worth it.

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

13 years agotests: Re-enable the test-anchors conformance test
Neil Roberts [Tue, 12 Oct 2010 13:43:10 +0000 (14:43 +0100)]
tests: Re-enable the test-anchors conformance test

This test was disabled in b5d58213. The commit message doesn't mention
this so I'm guessing it was a mistake. In any case the test appears to
work now anyway so it should be re-enabled.

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

13 years agotest-flow-layout: Track stage size by default
Emmanuele Bassi [Tue, 12 Oct 2010 13:53:20 +0000 (14:53 +0100)]
test-flow-layout: Track stage size by default

Instead of requiring a special command line switch.

13 years agobind-constraint: Use ::queue-relayout
Emmanuele Bassi [Tue, 12 Oct 2010 13:09:47 +0000 (14:09 +0100)]
bind-constraint: Use ::queue-relayout

Instead of using the allocation-changed signal, use the queue-relayout
signal on the source to queue a relayout on the actor to which the
BindConstraint has been attached to.

The ::allocation-changed signal is not always enough, given that a
BindConstraint can use the position as well as the size of an actor to
drive the allocation of another; in this regard, it's much similar
to a ClutterClone, which requires a notification on every change, even
potential, and not just real ones, given the short-circuiting done
inside ClutterActor.

13 years agoconstraints: Do not check for :enabled
Emmanuele Bassi [Tue, 12 Oct 2010 13:09:17 +0000 (14:09 +0100)]
constraints: Do not check for :enabled

ClutterActor will do it for us.

13 years agoactor: Use an explicit check for NULL
Emmanuele Bassi [Tue, 12 Oct 2010 13:08:07 +0000 (14:08 +0100)]
actor: Use an explicit check for NULL

Follow the coding style, and don't use the implicit C boolean
equivalence for NULL pointers.

13 years agoactor: Queue a relayout when adding/removing constraints
Emmanuele Bassi [Tue, 12 Oct 2010 13:07:27 +0000 (14:07 +0100)]
actor: Queue a relayout when adding/removing constraints

Constraints change the way an actor is allocated; this warrants a
relayout.

13 years agoactor: Check CluterActorMeta:enabled
Emmanuele Bassi [Tue, 12 Oct 2010 13:04:21 +0000 (14:04 +0100)]
actor: Check CluterActorMeta:enabled

Instead of delegating the check for the ActorMeta:enabled property to
the sub-classes of ClutterActorMeta, ClutterActor can do the check prior
to using the ClutterActorMeta instances.

13 years agoactor: Add debugging note for allocation changes
Emmanuele Bassi [Tue, 12 Oct 2010 13:04:05 +0000 (14:04 +0100)]
actor: Add debugging note for allocation changes

13 years agoactor-box: Split out ActorBox into its own file
Emmanuele Bassi [Mon, 11 Oct 2010 14:57:22 +0000 (15:57 +0100)]
actor-box: Split out ActorBox into its own file

clutter-actor.c is getting way too large, so splitting it up wherever
possible makes sense.

13 years agovertex: Register progress function
Emmanuele Bassi [Mon, 11 Oct 2010 14:52:50 +0000 (15:52 +0100)]
vertex: Register progress function

This allows animating properties storing a ClutterVertex.

13 years agogeometry: Register a progress function
Emmanuele Bassi [Mon, 11 Oct 2010 14:44:09 +0000 (15:44 +0100)]
geometry: Register a progress function

This allows animating properties storing a ClutterGeometry.