Page MenuHomePhabricator

Efl.Canvas.Gesture
Open, NormalPublic

Description

Base abstract class to support gesture-specific classes.                                  
                                                                                          
A gesture object holds the current state of that gesture (i.e. whether the gesture has    
just been started, it is in progress or it has finished) along with any gesture-specific  
information it needs (like the number of taps so far, to detect triple-taps, for example).
                                                                                          
Typically this class is not used directly, instead, some sub-class of it (like            
@Efl.Canvas.Gesture_Tap or @Efl.Canvas.Gesture_Zoom) is retrieved from gesture events     
(like @[Efl.Gesture.Events.gesture,tap] or @[Efl.Gesture.Events.gesture,zoom]).           

(P) state
(P) hotspot
(P) timestamp

Let's use this task to track also all derived classes:

  • momentum
  • flick
  • double_tap
  • zoom
  • tap
  • long_tap
  • triple_tap
segfaultxavi updated the task description. (Show Details)Dec 3 2019, 9:06 AM

Documentation is detailed and precise. I see no problem with the API (I am no expert on gestures).

BUT the Gestures Elm_test has detection issues.

segfaultxavi moved this task from Backlog to Evaluating on the efl: api board.Dec 3 2019, 9:06 AM

Efl.Gesture.Events.gesture,flick needs better docs. I need somebody to explain me what is a "flick gesture" in EFL.

zmike added a comment.Dec 24 2019, 6:32 AM

So this is just for objects passed in gesture events? For example, is this the type of (derived) object that I should reasonably be expected to know how to create and manage in my app? The documentation could perhaps use some slight clarifying in this regard.

I am not sure if i understand your question. In general:

  • From the App POV, Efl.Gesture.Events is what you want to deal with, you listen to these events, they are emitted on all Efl.Canvas.Objects Objects. The Event objects that get passed do contain the information about the gesture (obviously, depending on the type)
  • From the recognizer POV you want to inherit Efl.Canvas.Gesture_Recognizer, and then create & pass your own recognizer into Efl.Canvas.Gesture_Manager.
zmike added a comment.Jan 6 2020, 7:10 AM

My question was with regard to whether an app developer would need to be efl_adding these classes at any point, which it seems would not be the case. That distinction should be specified in docs.

bu5hm4n updated the task description. (Show Details)Jan 7 2020, 12:37 AM

It is true that this sentence was missing from the docs. I hope the above commit fixes that.

CHAN added a subscriber: CHAN.EditedJan 29 2020, 10:59 PM

@zmike @bu5hm4n @segfaultxavi

Shouldn't we add a property that can set / get touch count?
Or consider passing the touch count information as the data of the gesture event.

Efl.Canvas.GestureManager gm = (Efl.Canvas.GestureManager)rect.GetGestureManager();
Efl.Canvas.GestureRecognizerLongTap glt = (Efl.Canvas.GestureRecognizerLongTap)gm.GetRecognizer(Efl.Canvas.GestureRecognizerType.LongTap);
glt.SetTapcount(2);

otherwise,

rect.GestureLongTapEvt += (object sender, Efl.Gesture.IEventsGestureLongTapEvt_Args e) => {
 if (e.arg.GetState() == Efl.Canvas.GestureState.Started)
   {
       int TapCount = e.arg.GetTapcount();
   }

Hi,

The first one has the problem of having a side effect on other users of the gesture recognizer, so i think the second solution you proposed here sounds better than the first one.

However, is there really a need to have multiple long tap recognizions ? I cannot imagine a usecase right now.

zmike added a comment.Jan 31 2020, 7:06 AM
In T8502#150210, @CHAN wrote:

@zmike @bu5hm4n @segfaultxavi

Shouldn't we add a property that can set / get touch count?
Or consider passing the touch count information as the data of the gesture event.

This is already added in D11126.

The current state:

abstract Efl.Canvas.Gesture
├ (P) state
├ (P) hotspot
├ (P) timestamp
├ (P) touch_count :: set@protected
CHAN added a comment.EditedFeb 4 2020, 11:56 PM

@zmike Great.

@bu5hm4n I just mentioned that bcz we supported that kidna property in legacy. (elm_gesture_layer.) But.. i agree with you i dont see the use case... though...