Commit Graph

44 Commits

Author SHA1 Message Date
Emmanuele Bassi
b3b2af7677 Re-introduce removed GestureAction method
The get_threshold_tigger_egde() method was renamed to fix the typo, but
it obviously broke the ABI. To be fair, nobody in the whole of Debian
was using the symbol, apparently, so it's not like we broke existing
code. Still, it's not nice to break ABI without bumping soname, so let's
put the old symbol back in — obviously, deprecated — as a wrapper to the
newly added one.
2014-09-03 14:16:31 +01:00
Carlos Garnacho
8d669ab8ce gesture-action: Prepare for clutter_gesture_action_cancel() within ::gesture-end
There may be odd situations where full gesture cancellation may be wanted at once
when the first touch is lifted and ::gesture-end is emitted on a gesture action.
Although calling clutter_gesture_action_cancel() within the ::gesture-end handler
causes 2 critical warnings that are otherwise harmless.

https://bugzilla.gnome.org/show_bug.cgi?id=732907
2014-07-08 18:48:20 +02:00
Emmanuele Bassi
036c2b3764 gesture-action: Use event type getter
Don't use direct struct access.
2014-06-25 16:58:18 +01:00
Carlos Garnacho
02590f08ac gesture-action: Ignore any other event than press/update/release ones
CLUTTER_ENTER/LEAVE might be processed too, leading to accounting of the
NULL sequence (ie. pointer) in the gesture, and fooling the gesture with
a static extra point that wouldn't go away.

https://bugzilla.gnome.org/show_bug.cgi?id=732235
2014-06-25 16:55:41 +01:00
Carlos Garnacho
fd8705b9c6 gesture-action: Fix typo in clutter_gesture_action_get_threshold_trigger_egde()
Let's cross fingers and hope nobody notices. If this went unnoticed so far, likely
means this function has never been used. If any complain is raised about this, a
stub function should be added (and marked deprecated).
2014-05-21 15:15:01 +02:00
Emmanuele Bassi
12370bd4f8 docs: Move to markdown
We're removing docbook tags in favour of the markdown syntax.
2014-03-17 23:07:58 +00:00
Bastien Nocera
32b3d27bb9 GestureActions: Add per-action thresholds
Instead of relying on the dnd drag threshold, add per-action
horizontal and vertical thresholds. Use them in the swipe action
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=724242
2014-02-13 18:53:24 +01:00
Emmanuele Bassi
ed2fdf85f6 gesture: Make threshold-trigger-edge public
When the threshold-trigger-edge property was introduced in
GestureAction, it was late in the cycle and I elected to keep it
private, given the fact that nobody was subclassing GestureAction
outside of Clutter itself.

These days, people are experimenting more with the GestureAction API, so
they will need access to the various knobs that control the class
default behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 15:20:39 +00:00
Lionel Landwerlin
b0227644ff gesture-action: set default edge value to NONE to restore initial behavior
https://bugzilla.gnome.org/show_bug.cgi?id=710229

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 15:20:39 +00:00
Emmanuele Bassi
154ca6ef99 gesture: Clean up trigger edge accessors
Use G_GNUC_INTERNAL instead of the leading underscore, as we may make
the accessor functions public at some point. Also, clean up the
documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 15:20:39 +00:00
Lionel Landwerlin
97724939c8 gesture-action: fix memory corruption
abcf1d589f introduced a crasher because
the 'point' variable points to a piece of memory that is being
reallocated by the begin_gesture (by a g_array_set_size) call 5 lines
before.

https://bugzilla.gnome.org/show_bug.cgi?id=710227
2013-12-05 14:42:21 +00:00
Emmanuele Bassi
41bb03da2d Use the new macros for adding private data 2013-07-03 18:04:32 +01:00
Sjoerd Simons
3bcee2b122 gesture-action: begin gesture as soon as the number of touchpoints is reached
1ddef9576d87c98fafbcefe3108f04866630c2cd had its logic the
wrong way round, a gesture should begin as soon as the requested number
of touchpoints is reached. Correcting this fixes tap events

https://bugzilla.gnome.org/show_bug.cgi?id=700980
2013-06-12 11:19:08 +01:00
Lionel Landwerlin
5a7a6ebfc4 gesture-action: refactor event handling function
https://bugzilla.gnome.org/show_bug.cgi?id=698671
2013-04-23 17:36:47 +01:00
Lionel Landwerlin
321553b139 gesture-action: fix trigger edge after behavior with more than 1 point
https://bugzilla.gnome.org/show_bug.cgi?id=698669
2013-04-23 17:36:47 +01:00
Lionel Landwerlin
fda406b4a8 gesture-action: add n-touch-points property
https://bugzilla.gnome.org/show_bug.cgi?id=698668
2013-04-23 17:36:47 +01:00
Lionel Landwerlin
82e5634117 gesture-action: avoid shadowing time() syscall function
https://bugzilla.gnome.org/show_bug.cgi?id=698668
2013-04-23 17:28:41 +01:00
Emanuele Aina
7204f51643 gesture-action: Rename 'device' parameter to 'point' and fix docs
The parameter is now used to index the touch/mouse pointer tracked
in the gesture array, rename accordingly and update the docs.
2012-11-29 10:20:11 +01:00
Emanuele Aina
ccdbd36234 gesture-action: Add clutter_gesture_action_get_last_event()
Export the last event received for each touch point in its entirety,
instead of duplicating ClutterEvent accessors one at a time.

examples/pan-action.c has been updated to show the type of the event
that's causing the panning.

https://bugzilla.gnome.org/show_bug.cgi?id=685737
2012-10-19 14:13:17 +02:00
Emanuele Aina
bd1febb2ea gesture-action: Unregister all tracked points on cancel
Ensure that when cancelling a gesture, either because a callback
has returned FALSE or because clutter_gesture_action_cancel() has
been called, the array tracking touch points is emptied and a whole
new set of touch points is needed before restarting the gesture.

https://bugzilla.gnome.org/show_bug.cgi?id=685221
2012-10-19 13:41:25 +02:00
Emanuele Aina
abcf1d589f gesture-action: Let subclasses override the GestureTriggerEdge handling
Let gesture subclasses override how the drag threshold should
be handled:

• CLUTTER_GESTURE_TRIGGER_NONE tells GestureAction that the gesture
  must begin immediately and there's no drag limit that will cause
  its cancellation;
• CLUTTER_GESTURE_TRIGGER_AFTER is the default GestureAction behaviour,
  where it needs to wait until the drag threshold has been exceeded
  before considering the gesture valid;
• CLUTTER_GESTURE_TRIGGER_BEFORE will make GestureAction cancel
  the gesture once the drag exceed the configured threshold.

For example, ZoomAction and RotateAction could set
CLUTTER_GESTURE_TRIGGER_NONE since the use of two fingers makes the
begin of the action more self-evident, while an hypothetical Tap
gesture may use CLUTTER_GESTURE_TRIGGER_BEFORE to cancel the tap if
the pointer moves too much.

https://bugzilla.gnome.org/show_bug.cgi?id=685028
2012-10-19 11:27:35 +02:00
Emanuele Aina
1eaa577883 gesture-action: Make _cancel() callable after the gesture has started
https://bugzilla.gnome.org/show_bug.cgi?id=685554
2012-10-10 20:50:29 +02:00
Emmanuele Bassi
65bedbe42c docs: Fix typo in closing tag 2012-09-24 17:21:36 +01:00
Emmanuele Bassi
8d53bbd34f docs: Document the states of a GestureAction
Useful notes for developers writing gesture recognizers.
2012-09-17 12:05:39 +01:00
Emanuele Aina
9caf9ffbbb gesture-action: unregister point on missed release events
When we miss button release events (eg. when they happen outside
of our window) we must ensure that the corresponding point is
removed from the array of tracked points, otherwise GestureAction
will get very confused and will cancel all subsequent gestures.

https://bugzilla.gnome.org/show_bug.cgi?id=683471
2012-09-06 12:16:24 +01:00
Emanuele Aina
2001cd7a2c gesture-action: add gesture_prepare() virtual function
The gesture_prepare() virtual function is called before the
::gesture-begin signal is emitted, and allows a subclass to reset
its state.

https://bugzilla.gnome.org/show_bug.cgi?id=683431
2012-09-06 12:16:08 +01:00
Emmanuele Bassi
df0ab34499 docs: Fix GestureAction.get_velocity()
The velocity is in pixels per milliseconds, not microseconds.

https://bugzilla.gnome.org/show_bug.cgi?id=683113
2012-09-03 21:56:39 +01:00
Tomeu Vizoso
2ef148a2c9 gesture-action: Add API for cancelling a gesture
and getters for sequences and devices of current points. It can be
used for accepting and rejecting sequences for system-wide gestures.

https://bugzilla.gnome.org/show_bug.cgi?id=683090
2012-09-03 10:21:24 +02:00
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
Emmanuele Bassi
08da111f5e Fix compiler warning
Mark a variable as unused.
2012-07-18 17:14:17 -04: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
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
0b76ba332d Fixes for the API reference
Typos, missing symbols, and missing documentation.
2012-04-27 12:30:48 +01:00
Emmanuele Bassi
0c365f9f4c gesture-action: Protect against NULL pointers 2012-01-12 10:49:16 +00:00
Emmanuele Bassi
3b9b69ef54 gesture-action: Use the event propagation macros 2012-01-12 10:49:02 +00:00
Emmanuele Bassi
a9a104e109 docs: Fixes for cross-references 2011-09-12 13:12:14 +01:00
Tomeu Vizoso
01cf70594d Make sure the gesture is cancelled even if we miss the release event 2011-07-14 13:11:12 +02:00
Tomeu Vizoso
439c7e6ee7 Remove unneeded class closure 2011-07-14 11:46:12 +02:00
Tomeu Vizoso
c8e3db105c Add default closures for the signals in ClutterGestureAction
Also make sure we cancel the gesture as soon as we know we have to
2011-07-13 19:15:20 +02:00
Emmanuele Bassi
e4756fd764 docs: Fix up the API reference 2011-06-20 14:26:57 +01:00
Emmanuele Bassi
2c791da70a gesture-action: Remove the multi-device entry points
GestureAction supports a single device/touch point. We'll need touch
events supported in Clutter before adding the ability to set required
device/touch points on gestures.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
2011-06-10 15:15:15 +01:00
Emmanuele Bassi
0058c78b79 gesture-action: Clean up
The GestureAction is marked as abstract, but it has a constructor. It
should be possible to create simple gesture recognizers through signal
handling alone, so we might as well have GestureAction be a concrete
class from the start.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
2011-06-10 15:15:15 +01:00
Tomeu Vizoso
ba72235b66 Add ClutterSwipeAction and ClutterGestureAction
To allow actors to handle gestures in a more organized way.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
2011-06-10 14:02:17 +01:00