Commit Graph

5598 Commits

Author SHA1 Message Date
Emmanuele Bassi
9f83b64182 build: Move config.h under clutter/
We should not have header files in the project root.
2012-07-30 10:54:18 +01:00
Lionel Landwerlin
db74b184db events: process CLUTTER_TOUCH_CANCEL
These events might be emitted from the window manager/compositor, they
need to be transmitted to widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=680752
2012-07-29 14:59:13 +02:00
Lionel Landwerlin
86e064597e events: honour clutter_stage_set_motion_events_enabled() for touch events
When dragging/scrolling using touch events, we want the same behaviour
than for motion events. We need to honor the user's calls to
clutter_stage_set_motion_events_enabled() to deactive event
bubbling/captured sequences on the actor located under the pointer and
just transmit events to the stage/grab actor.

https://bugzilla.gnome.org/show_bug.cgi?id=680751
2012-07-29 14:59:08 +02:00
Emmanuele Bassi
fc04f015a6 gdk: Fix compilation on non-X11 platforms
The GDK backend may not work on non-X11 platforms, yet, but it's not a
good reason to let it introduce random build breakage.
2012-07-29 13:39:13 +01:00
Emmanuele Bassi
a4d1e6f6f1 actor: Ensure the invariants of transition-stopped
We need to make sure that ClutterActor::transition-stopped is emitted
after the transition was removed from the actor's list of transitions.

We cannot just remove the TransitionClosure from the hash table that
holds the transitions associated to an actor, and let the
TransitionClosure free function stop the timeline, thus emitting the
::transition-stopped signal - otherwise, stopping the timeline will end
up trying to remove the transition from the hash table, and we'll get
either a warning or a segfault.

Since we know we're removing the timeline anyway, we can emit the signal
ourselves in case the timeline is playing, in both the implicit and
explicit cases.
2012-07-26 14:01:01 +01:00
Emmanuele Bassi
17860b128e Annotate things to be removed/changed for 2.0
Lest we forget, like we did during the 0.9 → 1.0 cycle.
2012-07-26 14:01:01 +01:00
Emmanuele Bassi
178e6b2294 Add ClutterActor.transform
The :transform property controls the modelview matrix of an actor; it
can be used to set a custom modelview matrix on the actor, as opposed
to the decomposed transformations (rotation, scaling, translation)
provided by the ClutterActor class.
2012-07-26 14:01:00 +01:00
Emmanuele Bassi
25ba5374fe types: Add ClutterMatrix
A simple typedef to CoglMatrix, that we can use for GObject properties
and signal marshallers, without requiring Cogl to change.
2012-07-26 14:01:00 +01:00
Emmanuele Bassi
3f732cdc2b actor: Ensure that we remove only implicit transitions
The transitions we create implicitly should be removed from the set of
transitions associated to an actor; the transitions explicitly
associated to an actor, though, have to survive the emission of their
'stopped' signal.
2012-07-26 14:01:00 +01:00
Emmanuele Bassi
ee00e37bc4 actor: Simplify the implicit transition handling
We can remove the update_transition() private method, and move its
functionality inside the create_transition() private method, thereby
removing lots of duplicated code, as well as redundant checks on the
existence of a transition. This will allow handling transition updates
atomically in the future.
2012-07-26 14:01:00 +01:00
Emmanuele Bassi
28c2eeef95 actor: Add ::transition-stopped
The ::transition-stopped signal can be used to get notification of the
end of a transition.
2012-07-26 14:01:00 +01:00
Emmanuele Bassi
12c75e9737 timeline: Add cubic-bezier() progress functions
Another progress function from the CSS3 Transitions specification, using
a parametrices cubic bezier curve between (0, 0) and (1, 1) with two
control points.

(sadly, no ASCII art can approximate a cubic bezier, so no graph)

The cubic-bezier() progress function comes with a bunch of preset easing
modes: ease, ease-in, ease-out, and ease-in-out, that we can map to
enumeration values.
2012-07-19 22:13:24 -04:00
Emmanuele Bassi
4546f84408 timeline: Add support for step() progress
The CSS3 Transitions specification from the W3C defines the possibility
of using a parametrized step() timing function, with the following
prototype:

        steps(n_steps, [ start | end ])

where @n_steps represents the number of steps used to divide an interval
between 0 and 1; the 'start' and 'end' tokens describe whether the value
change should happen at the start of the transition, or at the end.

For instance, the "steps(3, start)" timing function has the following
profile:

  1 |           x
    |           |
    |       x---|
    |       '   |
    |   x---'   |
    |   '       |
  0 |---'       |

Whereas the "steps(3, end)" timing function has the following profile:

  1 |       x---|
    |       '   |
    |   x---'   |
    |   '       |
    x---'       |
    |           |
  0 |           |

Since ClutterTimeline uses an enumeration for controlling the progress
mode, we need additional API to define the parameters of the steps()
progress; for this reason, we need a CLUTTER_STEPS enumeration value,
and a method for setting the number of steps and the value transition
policy.

The CSS3 Transitions spec helpfully also defines a step-start and a
step-end shorthands, which expand to step(1, start) and step(1, end)
respectively; we can provide a CLUTTER_STEP_START and CLUTTER_STEP_END
enumeration values for those.
2012-07-19 20:47:00 -04:00
Emmanuele Bassi
b10e7057ad actor: Consolidate rotation angle internal setter
Use the GParamSpec, instead of the rotation axis enumeration, to
simplify the caller code, similarly to how we handle scaling and
translation factors.
2012-07-19 13:58:50 -04:00
Emmanuele Bassi
f99abad4a4 Split off LayoutManager deprecated functions to a separate file
This should make it easier to clean up later when we branch off for
1.99.
2012-07-18 17:23:35 -04:00
Emmanuele Bassi
1c03be7346 event: Expose is-pointer-emulated flag
Clutter on X11 already stores this flag to distinguish between events
that have been synthesized by the X server and real events.

https://bugzilla.gnome.org/show_bug.cgi?id=680174
2012-07-18 17:14:18 -04:00
Emanuele Aina
a8fcd4dfae event: Copy the is-pointer-emulated flag
https://bugzilla.gnome.org/show_bug.cgi?id=680174
2012-07-18 17:14:18 -04:00
Emmanuele Bassi
31b8b2e22f x11: Add debug notes for pointer-emulated 2012-07-18 17:14:17 -04:00
Emmanuele Bassi
9b4f13c15a input-device: Fix introspection annotation
The event sequence can be %NULL.
2012-07-18 17:14:17 -04:00
Emmanuele Bassi
08da111f5e Fix compiler warning
Mark a variable as unused.
2012-07-18 17:14:17 -04:00
Lionel Landwerlin
fcd7321f23 input-device: fix destroy signal connection on wrong actor 2012-07-18 20:42:32 +01:00
Lionel Landwerlin
9e02ef459e input-device: add enter/leave events generation for touch events
This patch brings 'enter-event' and 'leave-event' generation for touch
based devices. This leads to adding a new API to retrieve coordinates
of a touch point.

https://bugzilla.gnome.org/show_bug.cgi?id=679797
2012-07-17 21:49:26 +01:00
Lionel Landwerlin
6eef8ea042 fix build (missing marshaller) 2012-07-17 17:29:24 +01:00
Lionel Landwerlin
e2264c0484 Add rotate action
Allow rotation of an actor using 2 points (touch or pointers) events.

Also refactor the accumulators from various actions.

https://bugzilla.gnome.org/show_bug.cgi?id=678587
2012-07-17 16:52:41 +01:00
Emmanuele Bassi
2a31a93c5e x11/xi2: Do not generate scroll events on ButtonRelease
Scroll events are generated on ButtonPress only in the core event
handling, so it should happen the same if we use XInput.

https://bugzilla.gnome.org/show_bug.cgi?id=680088
2012-07-17 10:13:12 -04:00
Lionel Landwerlin
5200390037 gesture-action: add multiple point support and touch events support
https://bugzilla.gnome.org/show_bug.cgi?id=678586
2012-07-17 01:27:38 +01:00
Emmanuele Bassi
2bec43c3c2 actor: Round the adjusted allocation origin correctly
We use floorf() for the allocation origin, and ceilf() for the
allocation size. Swapping the two introduces rounding errors if
the original allocation is not clamped to the nearest pixel.
2012-07-12 22:32:02 +01:00
Emmanuele Bassi
8b03ac6bae Documentation fixes 2012-07-11 15:27:56 +01:00
Emmanuele Bassi
0afc137918 Revert "layout-manager: Add a new animation API"
This reverts commit 7f6b17bc50.

ClutterLayoutManager implementations should just defer the easing state
set up to the child, and not try to impose a global one.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
1806a2140b Revert "table-layout: Use the ClutterLayoutManager animation API"
This reverts commit 793bde9143.

ClutterLayoutManager implementations should just defer the easing state
set up to the child, and not try to impose a global one.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
2fef1a174e grid-layout: Remove layout animations
ClutterLayoutManager implementations should just defer the easing state
set up to the child, and not try to impose a global one.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
5a1c16de62 Revert "flow-layout: Implement layout animations"
This reverts commit 320fb156b4.

ClutterLayoutManager implementations should just defer the easing state
set up to the child, and not try to impose a global one.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
b4994f9e76 Revert "box-layout: Use the ClutterLayoutManager animation API"
This reverts commit 58a1854b57.

ClutterLayoutManager implementations should just defer the easing state
set up to the child, and not try to impose a global one.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
d381ab1207 Revert "bin-layout: Implement layout animations"
This reverts commit 03ec016faa.

ClutterLayoutManager implementations should just defer the easing state
set up to the child, and not try to impose a global one.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
b985c4035e Deprecate ClutterTexture's API
ClutterTexture is full of side effects that have been picked up over the
years; they make improving ClutterTexture harder than necessary, as well
as making subclassing impossible without introducing weird behaviours in
the child classes as well.

Since Clutter 1.10 we have the ClutterImage content type, which is
side-effects free, given that it just paints texture data using the
state of the actor.

Sadly, we still have subclasses of ClutterTexture, both deprecated and
not, so we cannot deprecate ClutterTexture right out; the type and
structures will still be available, like we do for ClutterGroup, but the
whole API should be moved to the deprecated section, waiting for the
time in which we can get rid of it all.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
42ca7bf1f4 Use Vertex zero init macro 2012-07-11 13:22:21 +01:00
Emmanuele Bassi
a101600c7d types: Add CLUTTER_VERTEX_INIT_ZERO
Similar to the macros for ClutterPoint, ClutterSize, and ClutterRect.
2012-07-11 13:22:21 +01:00
Emmanuele Bassi
9b52f9b3f5 actor: Add scaling factor in the Z axis
Having a scaling factor on the Z axis helps with projects that use fully
3D elements, like Mash.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
6feee080b3 actor: Clean up the order of transformations
https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
1796b37948 actor: Deprecate anchor-point
The pivot point and the translation transformation replace it
completely.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
8cea162d3c actor: Add translation transformation
We need an alternative to the translation performed by the anchor point,
one that possibly applies to all three axes and is relative to the
pivot-point.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
0ba078a146 Add notes on the properties to remove
Lest we forget during the 1.99 cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
6e85feecf8 actor: Add :pivot-point-z
For some transformations we need to be able to set the Z component of
the pivot point.

Unlike :pivot-point, the Z coordinate is not normalized because actors
are 2D surfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
005584a1ee actor: Deprecate scale center and gravity accessors
The ClutterActor:pivot-point supercedes the scale center and gravity
properties.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
32b78a41f1 actor: Deprecate rotation center properties
The pivot point supercedes the per-axis center of rotation, including
the one based on the gravity enumeration.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:20 +01:00
Emmanuele Bassi
a758cf6d3d actor: Add accessors for rotation angles
Given that the rotation transformations are now affected by the pivot
point, the Actor class should provide an accessors pair only for the
angle of rotation on a given axis.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
1fd0f4b9a5 actor: Add pivot point
The pivot point is a point in normalized coordinates space around which
all transformations revolve.

It supercedes the anchor point and the per-transformation center points
as well as the gravity settings, and tries to sort out the mess that
is the modelview matrix set up in ClutterActor.

https://bugzilla.gnome.org/show_bug.cgi?id=677853
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
b20e9b78e5 actor: Add :z-position and deprecate :depth
The ClutterActor:depth property has always been a bit of a misnomer:
actors are 2D flat surfaces, so they cannot have "depth"; the property
defines the position on the Z axis.

Another side effect of the :depth property is that it decides the
default paint and allocation order on insertion, and that setting it
will call the ClutterContainer.sort_depth_order() method. This has
proven to be a fairly bad design decision that we strung along from the
0.x days, as it gives a false impression of being able to change the
paint and allocation order simply by changing the position on the Z
axis — something that, in reality, requires depth testing to be enabled
during the paint sequence of an actor's parent.

For 2.0 we need a clean break from the side effects, and a better
defined interface.

ClutterActor:z-position is essentially what ClutterActor:depth is, but
doesn't call into ClutterContainer, and has a more apt name.

https://bugzilla.gnome.org/show_bug.cgi?id=679465
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
9b7287e897 actor: Move event chain emission into ClutterActor
By moving the function that builds the event emission chain we can avoid
a bunch of checks and function calls.
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
67cbb56ab8 actor: Constify event argument in clutter_actor_event()
The Clutter.Actor.event() method is a signal emitter; it does not modify
the event passed to it.
2012-07-11 13:22:19 +01:00