Commit Graph

763 Commits

Author SHA1 Message Date
Emmanuele Bassi
24495918bb docs: Further clarifications on implicit vs explicit animations
The wording is a bit terse, so it's better to clarify it.
2012-06-10 17:54:21 +01:00
Emmanuele Bassi
7043a3a1ed docs: Add notes on implicit vs. explicit animations
The implicit animations only apply to properties that are documented as
'animatable'; the explicit animations apply to any property defined
through GObject or ClutterAnimatable.
2012-06-10 17:54:21 +01:00
Emmanuele Bassi
9412b1a4c3 actor: Provide an initial easing state
For 1.x, we still have a duration of 0 msecs, but we have a valid easing
state, so we can change the easing parameters without calling save and
restore.
2012-06-10 17:54:21 +01:00
Emmanuele Bassi
e7aa21203c actor: Add content-repeat
ClutterContent implementations may allow repeating their contents when
painting; we should provide the repeat policy on the actor, like we do
for scaling filters and content gravity.
2012-06-08 14:33:00 +01:00
Alexander Larsson
fd8dcfcc56 Ensure that fixed positions always start at 0,0
Fixed positions are defined to be initialized at 0,0 whenever
enabled, by setting fixed_position_enabled to true, or by setting
just one of x/y. This normally happens in the defaults, but we need
to make sure it also happens if a fixed position was once set but
then disabled. We do this by always resetting it back to 0,0 when
fixed_position_set is unset.
2012-06-07 16:32:01 +02:00
Alexander Larsson
962bcb1222 Add _clutter_actor_peek_layout_info
This will be needed later to get a layout_info without creating one
if there is none already.
2012-06-07 16:31:22 +02:00
Emmanuele Bassi
9371029a89 actor: Improve debug message for create_transition()
Add the property and easing state information.
2012-06-07 12:06:56 +01:00
Emmanuele Bassi
a3a2fbfd5a actor: Improve the debug name
Only for debug builds, the debug name should include a) actor name, b)
type name, and c) pointer address.

For non-debug builds we can live with the actor/type name.
2012-06-07 11:57:53 +01:00
Emmanuele Bassi
008afe80e3 docs: Fix wrong rotation-* properties name
Copy and paste typos from the old documentation.
2012-06-06 11:19:33 +01:00
Emanuele Aina
7f9c3976a1 Fix width-for-height allocations
https://bugzilla.gnome.org/show_bug.cgi?id=677039
2012-05-31 09:55:26 +01:00
Emmanuele Bassi
de4d70af69 timeline: Add a new "stopped" signal
The ::stopped signal is emitted when the timeline has been completely
exhausted or when the timeline has been programmatically stopped by
using clutter_timeline_stop(); the notification at the end of the
timeline run allows to write handlers without having to check whether
the current repeat is the last one, like we are forced to do when using
the ::completed signal.

Based on the patch by: Jasper St. Pierre <jstpierre@mecheye.net>

https://bugzilla.gnome.org/show_bug.cgi?id=676854
2012-05-31 09:54:23 +01:00
Emmanuele Bassi
4634dde613 actor: Stop transitions on remove_child()
There's no point in having transitions running when removing a child, so
we just stop them.

https://bugzilla.gnome.org/show_bug.cgi?id=677098
2012-05-31 10:28:54 +02:00
Emmanuele Bassi
b9533cb397 actor: Finally fix RESIZE_ASPECT content gravity
Ensure that resizing transitions smoothly when switching between major
axis; the allocation aspect ratio is not important: it's the size of the
allocation that dictates the major axis.
2012-05-30 12:49:11 +01:00
Bastian Winkler
aeea9ee778 actor: Add a custom scriptable "margin" property
The property uses an array with the following CSS style syntax

 [ top, right, bottom, left ] or
 [ top, left/right, bottom ] or
 [ top/bottom, left/right ] or
 [ top/right/bottom/left ]

https://bugzilla.gnome.org/show_bug.cgi?id=676367
2012-05-21 15:31:34 +02:00
Emmanuele Bassi
cb4f816840 actor: Include margin in explicit sizes for all cases
When asking for the preferred width and height of an actor, in case
only one of either the minimum or the natural width is set, the margin
offsets should also be applied.
2012-05-09 15:03:51 +01:00
Emmanuele Bassi
07c95ebf0c Move examples from tests/interactive to a new top-level
The example code that is meant to be XIncluded into the API reference
should not be part of the interactive test suite: it's code that it is
meant to be used as a reference implementation - whereas the interactive
test suite should be allowed to be lean and test behaviour even in nasty
ways. In short: the test suite should not be the place where we show off
idiomatic code for educational purposes.
2012-05-01 19:00:35 +01:00
Emmanuele Bassi
0dd74ca3fb docs: Annotation fixes
The introspection scanner has become slightly more annoying, in the hope
that people start fixing their annotations. As it turns out, it was the
right move.
2012-04-30 17:17:41 +01:00
Emmanuele Bassi
8ef2c46baa actor: Make :allocation animatable
Calling clutter_actor_allocate() should transition between the current
allocation and the new allocation, by using the defined implementation
of the easing state.

This means that:

  clutter_actor_save_easing_state (actor);
  clutter_actor_allocate (actor, &new_alloc, flags);
  clutter_actor_restore_easing_state (actor);

will cause "actor" to transition between the current allocation and the
desired new allocation.

The trick is to ensure that this happens without invalidating the
entire actor tree, but only the portion of the tree that has the
transitioned actor as the local root. For this reason, we just call the
allocate() implementation from within the transition frame advancement,
without invalidating flags: the actor, after all, *has* a valid
allocation for the duration of the transition.
2012-04-27 12:30:49 +01:00
Emmanuele Bassi
8cb9725699 actor: Ignore allocation flags
Allocation flags are informative, and are only meant to be used to
communicate additional information about the allocation process to
an actor.
2012-04-27 12:30:49 +01:00
Emmanuele Bassi
78aae84d43 actor: Coalesce needs_[xy]_expand() into one method
Use the orientation enumeration instead of a per-axis method.
2012-04-27 12:30:49 +01:00
Emmanuele Bassi
473aaf7766 actor: Add private get_effective_x_align() method
A method to retrieve the effective horizontal alignment of the actor,
taking into consideration the text direction.
2012-04-27 12:30:49 +01:00
Emmanuele Bassi
90032e0019 actor: Add basic automatic expand flags
The :x-expand and :y-expand flags on ClutterActor are used to signal
that an actor should expand horizontally and/or vertically - i.e. that
its parent's layout management policy should try to assign extra space
to the actor when allocating it.

The expand flags are automatic: when set on a leaf node in the actor
tree, they will bubble up through the parent and grandparents up to the
top level actor; during allocation, the actors with children will lazily
compute whether their children needs to expand.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
217c4e7ba0 actor: Remove automatic transition init from add_transition()
Adding an explicit transition overrides any consideration of the easing
state of an actor.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
865a682450 actor: Make add_transition() work regardless of easing state
We can add transitions to an actor even if the easing state hasn't been
set beforehand.
2012-04-27 12:30:47 +01:00
Emmanuele Bassi
fe6d284a83 docs: Use the Transition convenience API 2012-04-27 12:30:47 +01:00
Emmanuele Bassi
7814ec2eb5 actor: Add position and size animatable properties
Using a compound type property for position and size has various
advantages: it reduces the amount of checks; it reduces the amount
of notify signals to connect to; it reduces the amount of transitions
generated.
2012-04-27 12:30:46 +01:00
Emmanuele Bassi
0f3f0d54d2 actor: Use ClutterSize for minimum and natural fixed sizes 2012-04-27 12:30:46 +01:00
Emmanuele Bassi
b7b641d5d3 actor: Use ClutterPoint for the fixed position 2012-04-27 12:30:46 +01:00
Emmanuele Bassi
61f17e345a Add base geometric types
Clutter should provide some more basic geometric types - Point, Size,
Rect - so that we can use them in properties and accessors.
2012-04-27 12:30:46 +01:00
Emmanuele Bassi
14572f4db0 actor: Call show() on set parent conditionally
This commit adds a further conditional check for calling
clutter_actor_show() when adding a child to an actor. We cannot
unconditionally change the value of the show-on-set-parent property like
the original solution of commit 81b19a78f5
as that breaks the document invariant that show-on-set-parent will be
changed iff an actor is without a parent.

The new ADD_CHILD_SHOW_ON_SET_PARENT flag is part of the default and
legacy flags, thus retaining the default behaviour when adding a child;
the flag is not passed when reordering the list of children, which means
we ignore the state of the show-on-set-parent property.

The conformance test suite fully passes, including the newly added test
to verify that changing the paint order does not trigger visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=674510
2012-04-26 14:06:00 +01:00
Emmanuele Bassi
a2f54c59f5 Revert "actor: Unconditionally set show_on_set_parent"
This reverts commit 81b19a78f5.

The commit breaks the conformance test unit for the invariants we
guarantee for the 1.x API:

ERROR:actor-invariants.c:307:actor_show_on_set_parent: assertion failed: (show_on_set_parent)
2012-04-26 14:02:07 +01:00
Jasper St. Pierre
81b19a78f5 actor: Unconditionally set show_on_set_parent
Otherwise, doing something like adjusting the child's position
on a hidden actor will re-show it, which is not what we want.

https://bugzilla.gnome.org/show_bug.cgi?id=674510
2012-04-24 11:25:42 -04:00
Jasper St. Pierre
0287dc26ad actor: Not-actors don't have metas 2012-04-24 11:25:42 -04:00
Emmanuele Bassi
7fffb7290e actor: Return a valid paint volume by default
It's been a year and change, and two stable releases, since we
introduced the paint volume mechanism to allow actors to paint outside
their allocation safely in environments that support clipped redraws.

The time has come to flip the switch, and return a valid paint volume,
matching the actor's allocation, by default - at least for Actor
instances from classes that do not override paint() and
get_paint_volume().

If an actor has a paint signal handler then it's the user responsability
not to paint outside the allocation - and to suffer the consequences of
doing so; in an ideal world, paint() would not be a signal in the first
place anyway. Plus, the idea that painting can happen at any time and
still have a valid surface greatly conflicts with the design goal of
making Clutter's rendering operations fully retained into a render tree.

We can still revert this commit before spinning 1.12, if need be.
2012-04-12 17:50:43 +01:00
Emmanuele Bassi
119a25269e actor: Check for mapped children in the default get_paint_volume()
Unmapped children won't be painted so they should not contribute to the
default paint volume computation.
2012-04-12 17:07:06 +01:00
Emmanuele Bassi
98c9dad42f actor: Clear MetaGroups when empty
When removing the last Action, Constraint, or Effect, we should also be
clearing the corresponding MetaGroup: code inside ClutterActor relies on
NULL checks, and changing them all to check for NULL && n_items == 0
would not be fun.
2012-04-12 17:04:57 +01:00
Emmanuele Bassi
14b9cb4f7b actor: Fix completed transitions logic
We need to remove the transition only if the current repeat is equal to
the number of repeats, and if the transition was marked as remove on
complete. Otherwise, the transition has to remain where it is.
2012-04-11 13:57:06 +01:00
Emmanuele Bassi
ab486bfe70 actor: Remove unnecessary relayout/redraw calls
They will be handled internally.
2012-04-10 13:37:04 +01:00
Emmanuele Bassi
de9112bc8c actor: Do not queue_redraw() in set_opacity()
The opacity internal setter will do it for us, and it will take into
consideration any eventual flatten effect applied to the actor.

This unbreaks the actor-offscreen-redirect conformance test.
2012-04-10 12:59:16 +01:00
Emmanuele Bassi
d45420f992 actor: Make _clutter_actor_foreach_child() safe again
We were using g_list_foreach() prior to the first Apocalypse, and that
function is resilient against changes to the list while iterating it;
since we are not using a GList any more, we need handle this case
ourselves.
2012-03-29 15:52:51 +01:00
Emmanuele Bassi
499534f3ac actor: Make :content-gravity animatable
Let's start making some non-trivial property animatable, like the
content gravity.
2012-03-29 15:11:52 +01:00
Emmanuele Bassi
97dcfe5bf1 actor: Ensure that we correctly remove transitions
The check on :remove-on-complete was inverted, but we also need to check
that the current repeat of the timeline is also the last.
2012-03-29 12:01:03 +01:00
Emmanuele Bassi
ff9a503c14 actor: Minor optimization to avoid get_preferred_*
When the easing state has a duration of zero milliseconds we can skip
the entire create_transition() call inside set_width() and set_height(),
to avoid what may be a costly call to get_preferred_*.
2012-03-28 18:07:06 +01:00
Emmanuele Bassi
cede56dcdd actor: Ensure we use the current easing duration and mode
When updating a transition in flight, if the current easing state does
not match the transition's.
2012-03-28 16:39:30 +01:00
Emmanuele Bassi
824dfcc67e docs: Mention in-flight value changes 2012-03-28 13:21:58 +01:00
Emmanuele Bassi
24d43cd076 actor: Check easing duration when updating in-flight transitions
If we update a transition that is currently playing, we need to check
the current easing state, and look at the eventual duration, in case
the user wants to cancel the transition.
2012-03-28 12:43:57 +01:00
Jasper St. Pierre
628ffa7b91 actor: Invalidate the current state when popping easing states
https://bugzilla.gnome.org/show_bug.cgi?id=672945
2012-03-28 11:56:01 +01:00
Emmanuele Bassi
fa8d431941 actor: Simplify setters of animatable properties
Instead of checking the duration of the current easing state we should
check if there's a transition in progress, and update it
unconditionally.

If there is no easing state, or the easing state has a duration of zero
milliseconds, then create_transition() should bail out early and set the
requested final state.

This allows us to write:

  clutter_actor_save_easing_state (actor);
  clutter_actor_set_x (actor, 200);
  clutter_actor_restore_easing_state (actor);

  [...]

  clutter_actor_set_x (actor, 100);

and have the second set_x() update the easing in progress, instead of
being ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=672945
2012-03-28 11:52:01 +01:00
Emmanuele Bassi
b074db869c actor: Add debug annotation in add_transition() 2012-03-27 11:38:04 +01:00
Emmanuele Bassi
1ef85372cc actor: Add IN_DESTRUCTION checks
Commit 80626e7584 removed an
IN_DESTRUCTION check from within the add_child_internal() method,
outlining an option for bringing it back. It was too late for the 1.10
cycle to do it, and eventually pick up the pieces, but now that we're
at the beginning of the 1.11 cycle we can restore it, and add checks
elsewhere to balance it.
2012-03-27 11:38:04 +01:00