Page MenuHomePhabricator

Pending work on gesture event structs
Open, HighPublic

Description

The gesture event information structures that we currently emit with the gesture events (like Efl.Canvas.Gesture_Flick) need some love:

  • Their fields should be read-only properties instead of methods. This is more natural for bindings.
  • All units should be documented (pixels, degrees, radians...)
  • For completeness, Efl.Canvas.Gesture_Momentum could include the angle, just like Efl.Canvas.Gesture_Flick.

Add your own tasks to this list!

segfaultxavi triaged this task as High priority.

Their fields should be read-only properties instead of methods. This is more natural for bindings.

Do you mean that EITHER Efl.Canvas.Gesture provides read-only properties OR Efl.Canvas.Gesture's setter methods / writable properties should not be public?

If so, we need to consider and figure out that Efl.Canvas.Gesture's properties are used outside of Efl.Canvas.Gesture.
e.g. efl_gesture_state_set() is called in efl_canvas_gesture_manager.c

Maybe we have another option that each gesture event contains read-only fields instead of gesture class instance.
e.g. Efl.Gesture.EventsGestureTapEventArgs e;

  • NOW : e.arg is Efl.Canvas.GestureTap instance.
  • TODO: e.arg is a struct which contains read-only values. i.e. state(Efl.Canvas.Gesture_State), hotspot(Eina.Position2D), timestamp(uint)

I'm not talking about Efl.Canvas.Gesture. This one is OK. I'm talking about the derived classes: Efl.Canvas.Gesture_Flick, Efl.Canvas.Gesture_Zoom, etc.
Some of these derived classes have methods called *_get, which look to me like they should be readonly properties.

Thank you for your reply! Now I understand your point and I agree with you.

  • NOW : radius_get { } for Efl.Canvas.Gesture_Zoom
  • TODO : @property radius { get { } } for Efl.Canvas.Gesture_Zoom