Commit Graph

5553 Commits

Author SHA1 Message Date
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
Emmanuele Bassi
d685e8a95a text: Add :cursor-position and deprecate :position
The :position property on ClutterText clashes with the same property on
ClutterActor; it's also badly named, given that it represents the
cursor's position inside the text; finally, it does not match its
accessors, violating the API style conventions.

https://bugzilla.gnome.org/show_bug.cgi?id=679457
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
721caece5d drag-action: Add ::drag-progress signal
Overriding the default behaviour of ClutterDragAction::drag-motion is
currently a pain; you either need to subclass the ClutterDragAction and
override the class closure for the signal, or you need to connect to the
signal and call g_signal_stop_emission_by_name() - neither option being
particularly nice or clean. The established pattern for these cases
would be to have a boolean return value on the ::drag-motion signal, but
we cannot do that without breaking ABI.

To solve the issue in a backward compatible way, we should introduce a
new signal, ::drag-progress, with a boolean return value. If the signal
emission chain returns TRUE, the ::drag-motion signal will be emitted,
and the default behaviour will be honoured; if the signal emission chain
returns FALSE, instead, the ::drag-motion signal will not be emitted.

https://bugzilla.gnome.org/show_bug.cgi?id=679451
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
0e4c6d0a87 Deprecate clutter_threads_enter()/leave()
Acquiring the Clutter lock to mark critical sections is not portable,
and not recommended to implement threaded applications with Clutter.

The recommended pattern is to use worker threads, and schedule UI
updates inside idle or timeout handlers within the main loop. We should
enforce this pattern by deprecating the threads_enter()/leave()
functions. For compatibility concerns, we need internal API to acquire
the main lock during frame processing dispatch.

https://bugzilla.gnome.org/show_bug.cgi?id=679450
2012-07-11 13:22:19 +01:00
Emmanuele Bassi
0ba2d1df93 constraints: Clamp updated allocation to the nearest pixel
Use Clutter.ActorBox.clamp_to_pixel() to do it properly.
2012-06-27 21:28:01 +01:00
Emmanuele Bassi
1da42dd8a0 actor: Add ActorIter.is_valid()
It can be useful to check whether a ClutterActorIter is currently valid,
i.e. if the iterator has been initialized *and* if the actor to which it
refers to hasn't been updated.

We can also use the is_valid() method in the conformance test suite to
check that initialization has been successful, and that changing the
children list through the ClutterActorIter API leaves the iterator in a
valid state.
2012-06-27 21:28:01 +01:00
Alejandro Piñeiro
a8c829019f a11y: remove implementation for [add/remove]_global_event_listener
Since release 2.5.3, ATK provides an implementation for those
methods, so toolkits doesn't need to implement them.
2012-06-27 14:40:56 +02:00
Emmanuele Bassi
b6d5595470 docs: Add missing annotation for ClutterActorClass.touch_event 2012-06-25 23:47:12 +01:00
Emmanuele Bassi
ececa27ad0 docs: Fix XInclude path of the BindConstraint example 2012-06-25 23:44:11 +01:00
Jasper St. Pierre
6c4abde369 stage: Make sure to free any pending queued redraws if we have any
This fixes a memory leak when someone creates a stage and then immediately
destroys it.
2012-06-24 13:31:31 -04:00
Emmanuele Bassi
ab88511133 stage: Remove an extra reference count
The dispose sequence will keep the object alive, and we need to release
the last reference held by the StageManager before releasing control to
GObject.
2012-06-24 18:02:45 +01:00
Emmanuele Bassi
550168eee3 Clean up deprecated header inclusion
The build should not add deprecated/ into the default INCLUDE paths, so
that deprecated headers are clearly separated; this will make it easier
to get rid of them when we branch out for 2.0.
2012-06-23 08:23:11 +01:00
Emmanuele Bassi
8fe8b9c89e Move PathNode definitions into clutter-types.h
Near ClutterKnot, so that we can easily remove both when we branch off
for 2.0.
2012-06-23 08:23:11 +01:00
Lionel Landwerlin
49dd99f9c1 text: add touch events support
https://bugzilla.gnome.org/show_bug.cgi?id=678278
2012-06-22 21:53:07 +01:00
Lionel Landwerlin
927624d92c input-device: add APIs to grab sequences of touch events
https://bugzilla.gnome.org/show_bug.cgi?id=678279
2012-06-22 21:48:58 +01:00
Lionel Landwerlin
132e4b98d1 drag/drop actions: add touch event support
https://bugzilla.gnome.org/show_bug.cgi?id=678049
2012-06-22 21:40:08 +01:00
Lionel Landwerlin
1af7de8ac8 actor: add touch event vfuncs
https://bugzilla.gnome.org/show_bug.cgi?id=678047
2012-06-22 21:40:03 +01:00
Alejandro Piñeiro
dd7c1ed64a a11y: implementation for atk_text_get_text_[before/at/after]_offset
Copy and paste of the implementation done at Gtk+ based on pango. This
should be moved to a common library, like the old GailTextUtil. Ideally
on pango itself.

https://bugzilla.gnome.org/show_bug.cgi?id=677221
2012-06-22 18:06:06 +02:00
Bastian Winkler
d2fff6e3c3 actor: Make margin properties animatable
Enable implicit animations for :margin-(top|right|bottom|left)
properties.

https://bugzilla.gnome.org/show_bug.cgi?id=678264
2012-06-22 08:52:00 +02:00
Matthias Clasen
e3ca87784e XI2: Avoid a crash in event translation
It is possible that we get a DeviceChanged event for a device
that is not in the hash table yet. E.g. I've seen this when
using xrandr to change screen resolution. Prevent a crash in
this case.

https://bugzilla.gnome.org/review?bug=678439
2012-06-20 07:22:12 -04:00
Andy Wingo
d571719a3d cairo: Always update texture after ClutterCairoTexture::draw
* clutter/clutter-cairo-texture.c (clutter_cairo_texture_emit_draw):
  Always update the Cogl texture after emitting ::draw, since we control
  the dynamic extent in which drawing should happen on the cairo_t.

  Fixes #677966.
2012-06-20 11:45:21 +02:00
Emmanuele Bassi
286e7e28e8 Remove duplicate typedefs
Redefining typedefs is allowed by C11 and by a GCC extension, but Clang
doesn't really like it.
2012-06-20 09:13:11 +01:00
Emmanuele Bassi
c4acae7752 build: Remove gcov from the build
We want to switch to lcov, so let's start with a clean slate.
2012-06-19 14:55:10 +01:00
Emmanuele Bassi
7b07d4a7c5 transition: Check if we're setting the same interval
If we do, then don't bother.
2012-06-18 23:00:08 +01:00
Emmanuele Bassi
b658023324 property-transition: Lazily convert the interpolated value
If the Interval used has a different type than the property we are
animating through a PropertyTransition then we should transform the
interpolated value before applying it, to avoid warnings down the
line.
2012-06-18 22:21:14 +01:00
Emmanuele Bassi
bebe90e565 interval: Do not leak the result GValue
The compute() method will cache the result, to avoid multiple
allocations and copies; this means, though, that we need to unset the
GValue when destroying the Interval.
2012-06-18 18:04:54 +01:00
Emmanuele Bassi
cfc4e86b31 interval: Compute progress for signed char
Not just for unsigned ones, though both are pretty pointless.
2012-06-18 18:04:54 +01:00
Emmanuele Bassi
44642b6a57 interval: Validate more fundamental types
64bit integers and floating point values should be validated as well.
2012-06-18 18:04:54 +01:00
Emmanuele Bassi
54e22590b9 interval: Remove unnecessary check
Now that the interval can transform the initial and final values to the
type declared when constructing it, there is no need to check for the
value type inside set_initial_value() and set_final_value().
2012-06-18 18:04:54 +01:00
Emmanuele Bassi
a0c620b157 interval: Transform values on set, if needed
It's possible that GValues passed to a ClutterInterval setter are not
of the same type as the interval - for instance, if they come from
language bindings, or from untrusted sources; we can use the same
transformation functions we already use inside ClutterTransition to
ensure that the ClutterInterval always stores values of the same type
used to create the interval itself.
2012-06-18 17:25:47 +01:00
Alejandro Piñeiro
0d4d467dd5 a11y: Remove key event listener hash table if no longer required
https://bugzilla.gnome.org/show_bug.cgi?id=675183
2012-06-18 12:44:59 +02:00
Alejandro Piñeiro
cafcf14e0e a11y: atk_add_key_event_listener listener_id should not return 0 as a valid value
cally_util_add_key_event_listener first id returned was 0, but as
the documentation says, this is a reserved value for a wrong id

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=675183
2012-06-18 12:44:55 +02:00
Emmanuele Bassi
725f4a07f3 canvas: Propagate Cairo errors when diagnostic mode is enabled
It can be a useful debugging tool to report the eventual error state of
the cairo_t after the ::draw signal emission ended.
2012-06-14 14:57:28 +01:00
Emmanuele Bassi
60967127b4 docs: Mention the Timeline::stopped signal in the class description
Now that we have the ::stopped signal, it would be good if the
documentation mentioned it explicitly as the dual of the ::started
signal.
2012-06-13 09:09:56 +01:00
Emmanuele Bassi
e01f9f330d timeline: Emit last ::completed before ::stopped
The ::stopped signal should be emitted at the end of the Timeline, after
the last ::completed signal emission, in order to have a proper
chronological progress of signal emissions:

  started → new-frame → [ ... ] → completed → stopped

This way, ::stopped can perform a proper teardown of the state set up
during ::started, without interfering with the potential cyclical
emission of ::completed.
2012-06-13 08:42:29 +01:00
Evan Nemerson
252eafa520 introspection: assorted annotation fixes ported from Vala
https://bugzilla.gnome.org/show_bug.cgi?id=677778
2012-06-12 17:44:16 -07:00
Bastian Winkler
1bdd214811 grid-layout: Insert new rows/columns at the appropriate position 2012-06-12 23:50:44 +02:00
Bastian Winkler
7c8f761d43 grid-layout: Fix attach position for horizontal orientation
Switch the attach position. A new child should be positioned right of
it's previous sibling in ltr mode.
2012-06-12 23:50:44 +02:00
Emmanuele Bassi
c73549f9d3 Update keysyms headers 2012-06-11 13:47:29 +01:00
Emmanuele Bassi
716ee65a98 keysyms-update: Add deprecation guards to the deprecated header
We still need to add them in case the header is directly included.
2012-06-11 13:46:38 +01:00
Emmanuele Bassi
7118bab23c docs: Change GridLayout's short description
Clutter doesn't have widgets.
2012-06-11 10:02:38 +01:00
Emmanuele Bassi
231f0cbd0c docs: Document user_data argument for BindingActionFunc 2012-06-10 23:34:47 +01:00
Emmanuele Bassi
5eb07a3010 base-types: Don't free zero point and rect
Calling clutter_point_free(clutter_point_zero()) or calling
clutter_rect_free(clutter_rect_zero()) should be safe, exactly like it's
safe to call those functions with a NULL argument.
2012-06-10 17:54:22 +01:00
Emmanuele Bassi
17539bca95 base-types: Add zero point and rect
A constant ClutterPoint for (0, 0) and a constant degenerate ClutterRect
can be useful as guards for pointers, freeing the NULL value to mean
"unset".
2012-06-10 17:54:22 +01:00
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