Commit Graph

5685 Commits

Author SHA1 Message Date
Emanuele Aina
436ebb2716 gesture-action: add _get_motion_delta()/_get_velocity()
Add some accessors to simplify common tasks for GestureAction users:

• clutter_gesture_action_get_motion_delta() to get the delta
  on the X and Y axis in stage coordinates since the last motion
  event, and the scalar distance travelled;

• clutter_gesture_action_get_velocity() to get an estimate of the
  speed of the last motion event along the X and Y axis and as a
  scalar value in pixels per millisecond.

https://bugzilla.gnome.org/show_bug.cgi?id=681648
2012-08-28 09:57:33 -03:00
Emanuele Aina
e8e91b62c8 gesture-action: add allow-none annotations to getters
https://bugzilla.gnome.org/show_bug.cgi?id=681648
2012-08-28 09:57:30 -03:00
Andre Kuehne
d332255111 Fix clutter_table_layout_pack row/column count incrementation.
When appending (with a negative row/column parameter), the row/column
count should be incremented by 1, not 2. This also fixes layout errors
when using column/row spacing: The amount of extra space required was
calculated incorrectly due to the wrong column count.

https://bugzilla.gnome.org/show_bug.cgi?id=679990
2012-08-27 16:23:34 +01:00
Emanuele Aina
59801ef854 drag-action: fix press coords transform with drag_handle
When setting a drag handle, transform the original press
coordinates using the drag handle as reference instead of the
associated actor.

This causes the initial misplacement of drag handle in
example/drag-action when holding down the Shift key: the handle
gets placed at the main actor origin on the first drag event,
instead of following the mouse pointer.

All subsequent motion events already use the right actor when
transforming the coordinates, thus they are not affected.

https://bugzilla.gnome.org/show_bug.cgi?id=681746
2012-08-27 16:21:13 +01:00
Lionel Landwerlin
8cf5c5959f rotate-action: fix wrong marshaller usage
https://bugzilla.gnome.org/show_bug.cgi?id=682754
2012-08-27 14:05:44 +01:00
Lionel Landwerlin
fe92acd649 actor-iter: fix prev()/next() annotations
https://bugzilla.gnome.org/show_bug.cgi?id=682795
2012-08-27 13:47:29 +01:00
Emmanuele Bassi
3937a7c74c actor: Setting the child-transform invalidates the children's modelview
We need to ensure that the children's cached modelview matrix gets
invalidated when setting the :child-transform property on their parent.
2012-08-27 12:24:20 +01:00
Emmanuele Bassi
1b155504c5 actor: Call queue_redraw() when setting child-transform 2012-08-27 10:48:28 +01:00
Emmanuele Bassi
6bf0b983af actor: Deprecate the pick signal
Just like we did for the paint signal; a warning will be emitted if the
diagnostic mode of GLib is enabled through the G_ENABLE_DIAGNOSTIC env
var.
2012-08-27 10:48:27 +01:00
Emmanuele Bassi
06ea2cf7b1 drag-action: Ensure that we can destroy the drag handle
If the DragAction has a drag handle that gets destroyed inside the
::drag-end signal handler, the destruction sequence will trigger a
callback we have in place to check if the handle is being destroyed
mid-drag, e.g. from a ::drag-motion event.

The callback on the drag handle destruction will check if we are still
in the middle of a drag and emit the ::drag-end signal to allow cleaning
up; the callback erroneously uses the drag handle as the argument for
the emit_drag_end() function — instead of the actor to which the drag
action has been attached. Also, by the time we emit the ::drag-end, we
are not dragging the actor any more, so we shouldn't be emitted the
::drag-end signal twice.

The fix is, thus, made of two parts:

  - reset the in_drag boolean before emitting the ::drag-end signal
    so that destroying the drag handle will not result in a double
    signal emission;

  - use the correct actor when calling emit_drag_end().

https://bugzilla.gnome.org/show_bug.cgi?id=681814
2012-08-20 19:04:56 +01:00
Lionel Landwerlin
84325057af Add zoom action
https://bugzilla.gnome.org/show_bug.cgi?id=678427
2012-08-20 18:28:22 +01:00
Tristan Van Berkom
d037890fc4 ClutterBoxLayout: Blessing with proper h4w geometry management
The box layout was broken for height-for-width requests in the opposing orientation of the box.

https://bugzilla.gnome.org/show_bug.cgi?id=679483
2012-08-20 17:52:38 +01:00
Emmanuele Bassi
8536314dbf bin-layout: Ensure that fixed position get a 0.0 alignment
If the actor has a fixed position set, but it's not using the BinLayout
alignment enumeration to set its alignment, then we force the alignment
factor to 0.0; this is consistent with what happens with an explicit
alignment of CLUTTER_BIN_ALIGNMENT_FIXED.

https://bugzilla.gnome.org/show_bug.cgi?id=682265
2012-08-20 14:50:39 +01:00
Emmanuele Bassi
ffe32426b8 actor: Add the :child-transform property
An additional transformation that is applied to the children of an actor
before their own transformations, but not to the actor itself.
2012-08-19 17:23:26 +01:00
Emmanuele Bassi
f7dd2d3746 matrix: Fix the init_with_matrix() implementation
As usual, I swapped the memcpy() arguments around.
2012-08-19 17:23:26 +01:00
Emmanuele Bassi
e9bcb4cf6e text: Clean up button press handling
Event handling should only apply to editable ClutterText actors, but we
also have the :selectable property to care about.

The button/touch press should position the cursor inside an editable
ClutterText; the :selectable property should be used to allow selecting
the text, either through pointer or touch dragging, via the keyboard, or
by multiple pointer clicks. If neither of these two conditions are met,
the ClutterText should just propagate the event handling further.
2012-08-19 10:05:34 +01:00
Emmanuele Bassi
aeb7c6926b Fix segfault when enabling debugging notes 2012-08-19 10:05:34 +01:00
Jasper St. Pierre
f5a620ed3b clutter-text: Make sure to paint the background of a text actor
https://bugzilla.gnome.org/show_bug.cgi?id=682070
2012-08-17 13:17:01 -04:00
Giovanni Campagna
f99d48a0c6 ClutterDragAction: allow constraining the movement of the dragged actor
Allow setting a ClutterRect on the drag action and force the
dragged actor's position to be always within that rectangle (relative
to the actor's parent).

https://bugzilla.gnome.org/show_bug.cgi?id=681168
2012-08-16 18:21:07 +02:00
Emmanuele Bassi
b6e8f9d61e Remove (constructor) annotation
ClutterMatrix is an alias to CoglMatrix, and g-ir-scanner complains if
a function marked as a constructor does not return the correct type.
2012-08-16 12:22:56 +01:00
Emmanuele Bassi
803b3bafb6 Associate the device to a stage on touch events
Just like we do for crossing events, we need to update the stage pointer
inside ClutterInputDevice on TOUCH_BEGIN and TOUCH_END.

https://bugzilla.gnome.org/show_bug.cgi?id=681074
2012-08-16 11:27:25 +01:00
Emmanuele Bassi
260d8fc097 backend: Include deprecated header
To avoid compiler warnings.
2012-08-12 19:21:22 +01:00
Emmanuele Bassi
202d95d180 rotate-action: Use the correct accumulator
The boolean_handled accumulator will stop the signal emission if TRUE is
returned by a signal handler; the boolean_continue accumulator will stop
the signal emission if FALSE is returned. The first one is used for
event-related signals, while the latter is used for action-related
signals.
2012-08-12 19:19:02 +01:00
Emmanuele Bassi
00f7fc4e58 stage: Do not use get_allocation_geometry()
Second try, after testing.

Tested-by: Rico Tzschichholz <ricotz@t-online.de>
2012-08-12 11:14:54 +01:00
Emmanuele Bassi
44661902bd Revert "stage: Do not use get_allocation_geometry()"
This reverts commit ef1bb42a86.

Apparently, it broke GNOME Shell, so let's back it out first and try to
figure out why.
2012-08-12 09:29:29 +01:00
Emmanuele Bassi
93a43f879d Deprecate ClutterActor::paint
Only the signal connection. When using G_ENABLE_DIAGNOSTIC there will be
a warning for every signal connection.

We should try and discourage people from ever using the paint signal
ever again, until we can safely remove it in Clutter 2.0.
2012-08-11 11:43:28 +01:00
Emmanuele Bassi
3e4277c2e8 base-types: Add (constructor) annotations
The alloc() functions are the constructors for their types, so it's
better to have the introspection data match the intent of the API.
2012-08-10 15:05:44 +01:00
Emmanuele Bassi
5b7c61a026 actor: Deprecate Geometry-related API
We cannot fully deprecate Geometry, because ClutterActor and ClutterText
are actually using the type in signals and properties; but we can
deprecate the API that uses this type, so that 2.0 will be able to avoid
it entirely.
2012-08-10 15:05:43 +01:00
Emmanuele Bassi
ef1bb42a86 stage: Do not use get_allocation_geometry()
It's pointless, and it will be deprecated soon.
2012-08-10 15:05:43 +01:00
Emmanuele Bassi
699a1876d4 clone: Do not use get_allocation_geometry()
Another nail in ClutterGeometry's coffin.
2012-08-10 15:05:43 +01:00
Emmanuele Bassi
7a59b69f96 actor: Deprecate :clip and introduce :clip-rect instead
The :clip property still uses ClutterGeometry, which is a very bad
rectangle type. Since we cannot change the type of the property
compatibly, we should introduce a new property using ClutterRect
instead. This also matches the ClutterActor.set_clip() API, which uses a
decomposed rectangle with floating point values, like we do with
set_position() and set_size().
2012-08-10 15:05:33 +01:00
Emmanuele Bassi
9515cc5b94 docs: Fix the link to set_content_gravity() 2012-08-10 15:05:28 +01:00
Emmanuele Bassi
97755882c1 bin-layout: Use ClutterActor:fixed-position-set
Instead of only relying on the (now) deprecated BinAlignment.FIXED
enumeration value, we just ask the actor if a fixed position has been
explicitly set, under the assumption that if a developer decided to call
set_x(), set_y(), or set_position() on an actor inside a BinLayout then
she wanted the fixed position to be honoured.

This removes the last (proper) use of the BinAlignment enumeration.
2012-08-10 15:05:28 +01:00
Emmanuele Bassi
f576084277 docs: Warn users of ClutterGeometry
The Geometry type is an *awful* representation of a integer rectangle,
as it uses unsigned integers for its size, leading to overflow issues
when unioning and intersecting. We have better rectangle types in
Cairo and Clutter, these days.
2012-08-09 16:56:19 +01:00
Emmanuele Bassi
46211a65db types: Add INIT_ZERO macro for ActorBox
Last type that was missing this macro.
2012-08-09 16:55:41 +01:00
Emmanuele Bassi
97ed8e76d7 docs: Fix up deprecation notes for animate()
Instead of pointing to PropertyTransition, point to the implicit
animation support in ClutterActor.
2012-08-09 16:54:37 +01:00
Emmanuele Bassi
5461483df6 Documentation build fixes 2012-08-07 09:39:04 +01:00
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
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