Page MenuHomePhabricator

efl/gesture: move Point_Data to eo and add methods to fetch it for recognizers
Needs RevisionPublic

Authored by zmike on Mon, Jan 13, 12:13 PM.

Details

Reviewers
CHAN
segfaultxavi
Summary

this lets gesture framework track two touch points in order to distinguish between
successive presses and e.g., treat a simultaneous two finger tap as a single tap
gesture rather than two

it also simplifies some internal code and removes most hash lookups

Depends on D11084

Diff Detail

Repository
rEFL core/efl
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 15457
zmike created this revision.Mon, Jan 13, 12:13 PM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

CHAN added a subscriber: CHAN.Thu, Jan 16, 9:47 PM

@zmike Thank you for the commit.

Do you wanna make it supports up to two touches? ( It talking about "last_touch[2]")
A three-finger tapping case was supported... but I don't know if it's actually usable;

these two types to be public? (Efl_Gesture_Touch_Point_Info and Efl_Gesture_Touch_Point_Data)? (You moved the struct into .eot file.)

zmike added a comment.Fri, Jan 17, 6:17 AM

This has several benefits:

  • We now have more definite data types for gesture recognizers to access (without needing to access private data)
  • We now have multiple touch points so we can filter out "bad" touch events for gestures which use only a single point (for example, in my testing on other devices, if I tap with one finger and then a second finger very quickly, only the first is used)
  • We can now directly access both touch points for gestures which require multiple points, such as zoom

I considered whether to make this a variable-sized array to be able to count all points, but it seemed like this was a good start which would allow us to begin untangling some of the more difficult bugs. We should continue discussing this, however, since I'm not sure what will be most useful for custom recognizers.

zmike updated this revision to Diff 28264.Fri, Jan 17, 7:42 AM
zmike edited the summary of this revision. (Show Details)
zmike added a reviewer: CHAN.

update

segfaultxavi requested changes to this revision.Fri, Jan 17, 8:40 AM
segfaultxavi added a subscriber: segfaultxavi.

I don't like that the two new structures are called Info and Data. They're synonyms!
Also, it's not clear what "point" and "touch" are. This should be explained.
Is a Point a finger (or mouse pointer)? Is a Touch a gesture being detected, which can be composed of multiple Points? (And which might end up not matching any efl gesture).
Then we definitely need better names... Touch and Point are synonyms too.
Point->Pointer?
Touch->Gesture_Candidate or Candidate?

Does Touch_Point_Data record the movement of a finger (or pointer) over the screen, and Touch_Point_Info represent the position of said finger (or pointer) at one point in time?
If so, I suggest these new names:
Info->Position, Location or Sample.
Data->Pointer since this data simply represents the pointer.

src/lib/evas/gesture/efl_canvas_gesture_types.eot
54

This would need to explain the units and the reference frame (when is time 0?).
Also, why is this useful, is this a global timer, or restarts with each gesture, etc.

This revision now requires changes to proceed.Fri, Jan 17, 8:40 AM
zmike added a comment.Fri, Jan 17, 9:22 AM

Yeah tbh I'm more interested in the conceptual parts of these changes and not the minutiae of docs and naming since it might change anyway. We can do our usual shedsmanship once the functionality and API are reasonably stable.

Data and Info are synonyms precisely because they were originally the same name and I needed something quick to throw in to avoid a conflict.

Understood, but without docs or proper names, I find it very hard to follow what is going on :)
Will try again.