Commit Graph

5043 Commits

Author SHA1 Message Date
Emmanuele Bassi
e798047ca0 animator: Code style fixes 2010-09-29 11:44:46 +01:00
Stephen Kennedy
3fe10e0bb1 ClutterAnimator doesn't ref timeline properly
ClutterAnimator currently has a number of bugs related to its
referencing of its internal timeline.

1) The default timeline created in _init is not unreffed (it appears the
programmer has wrongly thought ClutterTimeline has a floating reference
based on the use of g_object_ref_sink in _set_timeline)

2) The timeline and slave_timeline vars are unreffed in finalize instead
of dispose

3) The signal handlers set up in _set_timeline are not disconnected when
the animator is disposed

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-29 10:57:39 +01:00
Neil Roberts
d0cab85673 Add a conformance test for clutter_actor_contains
This adds a conformance test for clutter_actor_contains to assert that
it gets the expected results for the given tree of actors.
2010-09-28 15:21:49 +01:00
Neil Roberts
3068520752 Simplify the loop for clutter_actor_contains
This reorganizes the loop for clutter_actor_contains so that it is a
for loop rather than a while loop. Although this is mostly just
nitpicking, I think this change could make the loop slightly faster if
not optimized because it doesn't perform the self == descendant check
twice and it is clearer.
2010-09-28 15:21:49 +01:00
Neil Roberts
99adb88e9b Document what happens when self==descendant in clutter_actor_contains
The documentation for clutter_actor_contains didn't specify what
happens when self==descendant. A strict reading of it might lead you
to think that it would return FALSE because in that case the
descendant isn't an immediate child or a deeper descendant. The code
actually would return TRUE. I think this is more useful so this patch
fixes the docs rather than the code.
2010-09-28 15:21:49 +01:00
Emmanuele Bassi
bba1424a44 Post-branch version bump to 1.5.1 2010-09-27 16:46:26 +01:00
Emmanuele Bassi
1971581dfa doap: Remove mallum from the maintainers list 2010-09-26 18:48:04 +01:00
Emmanuele Bassi
43e85836b4 actor: Dispose all constrains
We are leaking the ClutterMetaGroup with all the constraints when
disposing an Actor.
2010-09-26 16:52:58 +01:00
Emmanuele Bassi
fda1f3a8ba json: Allow NULL as a value for strings, arrays and objects
We should not warn when asking for a string, array or object if the
contents were 'null'.

Patch from JSON-GLib.
2010-09-25 20:23:41 +01:00
Emmanuele Bassi
8fe9f3a37d test-clutter-units: Force a known resolution to avoid fuzzyness
Instead of taking the current resolution, whatever it may be, use a
known DPI. This should alleviate fuzzyness and create consistent
results.
2010-09-24 16:21:06 +01:00
Emmanuele Bassi
51a4af9262 Post-release version bump to 1.4.1 2010-09-24 15:25:15 +01:00
Emmanuele Bassi
1f3f718a50 Release 1.4.0 (stable) 2010-09-24 15:07:17 +01:00
Elliot Smith
34407c14b0 cookbook: Reduce complexity of sample ClutterAnimator code for recipe
http://bugzilla.clutter-project.org/show_bug.cgi?id=2341

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-24 14:48:53 +01:00
Øyvind Kolås
4640dad6af animator: fix removal of all keys
When removing all keys in a ClutterAnimator, the hash table with
object/property name pairs went out of sync. This change makes
the animator always clear this hash table upon key-removal; and
refreshing it if the animator's timeline is running.

Fixes bug #2335
2010-09-24 13:30:38 +01:00
Robert Bragg
f834b8b138 material: Don't prune ancestry if it owns some layers
Each time a material property changes we look to see if any of its
ancestry has become redundant and if so we prune that redundant
ancestry.

There was a problem with the logic that handles this though because we
weren't considering that a material which is a layer state authority may
still defer to ancestors to define the state of individual layers.

For example a material that derives from a parent with 5 layers can
become a STATE_LAYERS authority by simply changing it's ->n_layers count
to 4 and in that case it can still defer to its ancestors to define the
state of those 4 layers.

This patch checks first if a material is a layer state authority and if
so only tries to prune its ancestry if it also *owns* all the individual
layers it depends on. (I.e. if g_list_length
(material->layer_differences) != material->n_layers then it's not safe
to try pruning its ancestry!)

http://bugzilla-attachments.gnome.org/attachment.cgi?id=170907
2010-09-24 00:12:14 +01:00
Jammy Zhou
ffd5c32209 cogl-framebuffer.c: GL_DEPTH_STENCIL not supported in gles
There is GL_INVALID_ENUM error for GL_DEPTH_STENCIL when call
glRenderbufferStorage() with OpenGL ES backend. So enable this
only for OpenGL backend.

Signed-off-by: Robert Bragg <robert@linux.intel.com>
2010-09-23 17:33:11 +01:00
Emmanuele Bassi
4533edeef0 cookbook: Further clarification of the anchor point
Make sure to add a note on the behaviour of the anchor point. Ideally,
it would be nice to have a recipe about it in the Actor section.
2010-09-23 17:03:17 +01:00
Elliot Smith
ce0bd4e26c cookbook: Recipe for "moving actors"
This recipe explains how to use the three animation
approaches (implicit, State, Animator) to animate movement
of actors.

Includes some guidelines about which approach to use when, with
a full code example for each approach.

The discussion section covers some subtleties around animated
movement; namely: moving actors out of their containers; anchor
points and movement; moving in the depth axis; interactions
between animated movement and constraints.
2010-09-23 16:24:21 +01:00
Elliot Smith
b8d36a364f cookbook: Fixed markup in animations section
Fixed indentation on some mark-up in an unrelated recipe.
2010-09-23 16:24:21 +01:00
Elliot Smith
6307876552 cookbook: Example of animated movement with ClutterAnimator
Added an example showing how to randomly animate the
simultaneous movement on the x axis of three actors,
using ClutterAnimator.
2010-09-23 16:24:21 +01:00
Elliot Smith
f1b2f1e8c5 cookbook: Example of animated movement with ClutterState
Added an example showing how to move two actors between
two states (one minimised, one maximised) using ClutterState
to do the movement. Also shows how movement can be mixed
with other animation (in this case, scaling).
2010-09-23 16:24:21 +01:00
Elliot Smith
5bca30300e cookbook: Example of simple movement animation
Added example showing how to move an actor in one of the
three axes (x,y,z) in response to a button event on the
actor.
2010-09-23 16:24:21 +01:00
Emmanuele Bassi
884ead03e1 Add some more argument validation
This is all internal, so we shouldn't need it; unfortunately, it seems
we're passing invalid data internally, so for the time being catching
inconsistencies should at least emit a warning for us to backtrace.
2010-09-23 16:17:24 +01:00
Robert Bragg
f66e1de0e3 actor: don't pass NULL to _stage_set_pick_buffer_valid
This adds a check in clutter_actor_real_queue_redraw after calling
_clutter_actor_get_stage_internal to check in case the actor doesn't yet
have an associated stage so we can avoid passing a NULL stage pointer to
_clutter_stage_set_pick_buffer_valid which could cause a crash.
2010-09-23 16:03:06 +01:00
Robert Bragg
37d0dbe6b2 docs: Put deprecated Cogl symbols into new section
This adds a "Cogl deprecated API" chapter to the Cogl reference manual
so we can group all the documentation for deprecated symbols together
instead of having them clutter up the documentation of symbols we would
rather developers used.
2010-09-23 15:53:30 +01:00
Robert Bragg
779c780500 docs: update the overview paragraph for Cogl
Instead of describing OpenGL as "a low level OpenGL abstraction
library" it is now summarised as "modern 3D graphics API".
2010-09-23 15:53:30 +01:00
Robert Bragg
2bc739ab44 docs: cogl-texture-3d wasn't listed as experimental
The CoglTexture3D API is only available when defining
COGL_ENABLE_EXPERIMENTAL_API so it should be listed in the experimental
section of the API reference.
2010-09-23 15:53:30 +01:00
Robert Bragg
a89b8f4304 docs: Use "Cogl" not "COGL" in Cogl API reference
Cogl isn't an acronym so we should use "Cogl" instead of "COGL" in
our documentation.
2010-09-23 15:53:29 +01:00
Emmanuele Bassi
4c8867ea07 table-layout: Invert row/column in arguments
*** This is an API change ***

The general pattern for axis-aligned arguments is:

        x argument
        y argument

If we consider columns an x-aligned argument, and row a y-aligned
argument, then we need to update the TableLayout functions to be:

        column
        row

and not:

        row
        column
2010-09-23 15:17:58 +01:00
Emmanuele Bassi
462d4c832a docs: Mention Uncrustify in the coding style document 2010-09-23 13:36:56 +01:00
Emmanuele Bassi
5335689340 Update the uncrustify configuration 2010-09-23 13:36:41 +01:00
Emmanuele Bassi
46357db389 Add uncrustify configuration file
Patch submission should include a pass of uncrustify to conform to the
coding style.

Uncrustify is not perfect - but at least it's a start.
2010-09-23 13:00:06 +01:00
Robert Bragg
56929942a8 picking: Fix tracking of pick buffer validity
We have an optimization to track when there are multiple picks per
frame so we can do a full render of the pick buffer to reduce the
number of pick renders for a static scene.

There was a problem though in that we were tracking this information in
the ClutterMainContext, but conceptually this doesn't really make sense
because the pick buffer is associated with a stage framebuffer and there
can be multiple stages for one context.

This patch moves the state tracking to ClutterStage.
2010-09-23 11:45:27 +01:00
Robert Bragg
b2a56c9cda Revert "picking: Fix tracking of pick buffer validity"
This reverts commit d7e86e2696.

This was a half baked patch that was pushed a bit early since it broke
test-texture-pick-with-alpha + the commit message refers to a change on
the wip/paint-box branch that hasn't happened yet.
2010-09-23 11:45:04 +01:00
Robert Bragg
d7e86e2696 picking: Fix tracking of pick buffer validity
We have an optimization to track when there are multiple picks per
frames so we can do a full render of the pick buffer to reduce the
number of pick renders for a static scene.

There were two problems with how we were tracking this state though.
Firstly we were tracking this information in the ClutterMainContext, but
conceptually this doesn't really make sense because the pick buffer is
associated with a stage framebuffer and there can be multiple stages for
one context.  Secondly - since the change to how redraws are queued - we
weren't marking the pick buffer as invalid when a queuing a redraw, we
were only marking the buffer invalid when signaling/finishing the
queue-redraw process, which is now deferred until just before a paint.
This meant using clutter_stage_get_actor_at_pos after a scenegraph
change could give a wrong result if it just read from an existing (but
technically invalid) pick buffer.

This patch moves the state tracking to ClutterStage, and ensures the
buffer is invalidated in _clutter_stage_queue_actor_redraw.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-23 11:14:56 +01:00
Emmanuele Bassi
60c9dc25df box-layout: Small cleanups 2010-09-22 14:22:23 +01:00
Emmanuele Bassi
acc7d48e47 docs: Update the coding style
Make sure to document:

  • nested if
  • conditions
  • interface definition
2010-09-22 14:22:23 +01:00
Neil Roberts
bcd4385a0e test-conform: Delay initializing Clutter until a test is run
Instead of calling clutter_init immediately, test-conformance now only
calls it as part of test_conform_simple_fixture_setup. The conformance
tests assert that only one test is run per instance of
test-conformance so it should never end up calling clutter_init
twice. Delaying clutter_init has the advantage that calling
"test-conformance -l" will still work even on systems with no X
server. This could be useful for automated build systems.
2010-09-21 14:10:19 +01:00
Emmanuele Bassi
ddf1e4c77b effects: Make sure we're using GLSL 1.10 2010-09-21 13:32:31 +01:00
Emmanuele Bassi
9f2b62a595 introspection: Build ClutterJson before Clutter
Since the latter requires the former.
2010-09-21 13:17:51 +01:00
Emmanuele Bassi
66ba609f3b Require the installed JSON-GLib
Continue to provide the internal copy for 1.4, but require an explicit
override to use it.

The internal copy will be removed for Clutter 1.6.
2010-09-21 13:15:56 +01:00
Emmanuele Bassi
4037f76a3e build: Update the remote publish path for the cookbook 2010-09-21 12:02:41 +01:00
Neil Roberts
8f4d61e663 clutter-box-layout: Swap the default request mode
The request mode set by the box layout was previously width-for-height
in a vertical layout and height-for-width in a horizontal layout which
seems to be wrong. For example, if width-for-height is used in a
vertical layout then the width request will come second with the
for_height parameter set. However a vertical layout doesn't pass the
for_height parameter on to its children so doing the requests in that
order doesn't help. If the layout contains a ClutterText then both the
width and height request for it will have -1 for the for_width and
for_height parameters so the text would end up allocated too small.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2328
2010-09-20 16:33:57 +01:00
Emmanuele Bassi
699e8bbed2 Merge branch 'cookbook-layouts-bind-constraint'
* cookbook-layouts-bind-constraint:
  cookbook: Add recipe about sync'ing actor sizes
  cookbook: Example using allocation-changed to sync actor size
  cookbook: Simple example to demonstrate bind constraint
  cookbook: Example of using a bind constraint for an overlay
2010-09-20 14:33:26 +01:00
Emmanuele Bassi
af42cdbe87 docs: Description fixes for State.set_animator() 2010-09-20 14:31:53 +01:00
Bastian Winkler
695839c6f3 state: Request the animator for the default state
Try to use the default-state animator in case there is no animator for
this specific state change request.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2325
2010-09-20 14:25:21 +01:00
Bastian Winkler
172fc6bfed state: Fix the usage of ClutterAnimator in ClutterScript
Fix the transition parser to allow transitions that have only an
animator and no keys defined.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2325
2010-09-20 14:25:20 +01:00
Bastian Winkler
2d41d5afcb state: Create a new target state in clutter_state_set_animator
clutter_state_set_animator needs to create a new state in order to use a
ClutterAnimator with a target state that doesn't exist yet.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2325
2010-09-20 14:25:19 +01:00
Dominique Leuenberger
9399760030 build: Pass CLUTTER_CFLAGS to g-ir-scanner
http://bugzilla.clutter-project.org/show_bug.cgi?id=2327

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-20 14:17:14 +01:00
Emmanuele Bassi
ce174654bf docs: API reference fixes 2010-09-20 13:15:44 +01:00