- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Macros | Functions
Gesture Layer

## Macros
#define | elm_obj_gesture_layer_hold_events_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_gesture_layer_hold_events_set(hold_events) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET), EO_TYPECHECK(Eina_Bool, hold_events)
#define | elm_obj_gesture_layer_zoom_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET), EO_TYPECHECK(double *, ret)
#define | elm_obj_gesture_layer_zoom_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET), EO_TYPECHECK(double, step)
#define | elm_obj_gesture_layer_rotate_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET), EO_TYPECHECK(double *, ret)
#define | elm_obj_gesture_layer_rotate_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET), EO_TYPECHECK(double, step)
#define | elm_obj_gesture_layer_attach(target, ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH), EO_TYPECHECK(Evas_Object *, target), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_gesture_layer_cb_set(idx, cb_type, cb, data) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data)
#define | elm_obj_gesture_layer_cb_add(idx, cb_type, cb, data) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_ADD), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data)
#define | elm_obj_gesture_layer_cb_del(idx, cb_type, cb, data) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_DEL), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data)
#define | elm_obj_gesture_layer_tap_finger_size_set(sz) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_TAP_FINGER_SIZE_SET), EO_TYPECHECK(Evas_Coord, sz)
#define | elm_obj_gesture_layer_tap_finger_size_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_TAP_FINGER_SIZE_GET), EO_TYPECHECK(Evas_Coord *, ret)

## Functions
double | elm_config_glayer_long_tap_start_timeout_get (void)
| Get the duration for occurring long tap event of gesture layer. More...
void | elm_config_glayer_long_tap_start_timeout_set (double long_tap_timeout)
| Set the duration for occurring long tap event of gesture layer. More...
double | elm_config_glayer_double_tap_timeout_get (void)
| Get the duration for occurring double tap event of gesture layer. More...
void | elm_config_glayer_double_tap_timeout_set (double double_tap_timeout)
| Set the duration for occurring double tap event of gesture layer. More...

## Detailed Description

Gesture Layer Usage:

Use Gesture Layer to detect gestures. The advantage is that you don't have to implement gesture detection, just set callbacks of gesture state. By using gesture layer we make standard interface.

In order to use Gesture Layer you start with elm_gesture_layer_add with a parent object parameter. Next 'activate' gesture layer with a elm_gesture_layer_attach call. Usually with same object as target (2nd parameter).

Now you need to tell gesture layer what gestures you follow. This is done with elm_gesture_layer_cb_set call. By setting the callback you actually saying to gesture layer: I would like to know when the gesture Elm_Gesture_Type switches to state Elm_Gesture_State.

Next, you need to implement the actual action that follows the input in your callback.

Note that if you like to stop being reported about a gesture, just set all callbacks referring this gesture to NULL. (again with elm_gesture_layer_cb_set)

The information reported by gesture layer to your callback is depending on Elm_Gesture_Type : Elm_Gesture_Taps_Info is the info reported for tap gestures: ELM_GESTURE_N_TAPS, ELM_GESTURE_N_LONG_TAPS, ELM_GESTURE_N_DOUBLE_TAPS, ELM_GESTURE_N_TRIPLE_TAPS.

Elm_Gesture_Momentum_Info is info reported for momentum gestures: ELM_GESTURE_MOMENTUM.

Elm_Gesture_Line_Info is the info reported for line gestures: (this also contains Elm_Gesture_Momentum_Info internal structure) ELM_GESTURE_N_LINES, ELM_GESTURE_N_FLICKS. Note that we consider a flick as a line-gesture that should be completed in flick-time-limit as defined in Elementary Config.

Elm_Gesture_Zoom_Info is the info reported for ELM_GESTURE_ZOOM gesture.

Elm_Gesture_Rotate_Info is the info reported for ELM_GESTURE_ROTATE gesture.

Gesture Layer Tweaks:

Note that line, flick, gestures can start without the need to remove fingers from surface. When user fingers rests on same-spot gesture is ended and starts again when fingers moved.

Setting glayer_continues_enable to false in Elementary Config will change this behavior so gesture starts when user touches (a *DOWN event) touch-surface and ends when no fingers touches surface (a *UP event).

Supported elm_object common APIs.

- elm_object_disabled_set
- elm_object_disabled_get

## Macro Definition Documentation

#define elm_obj_gesture_layer_attach | ( |  | target,
|  |  | ret
| ) |  | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH), EO_TYPECHECK(Evas_Object *, target), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Attach a given gesture layer widget to an Evas object, thus setting the widget's target.

Parameters

  [in] | target |
  [out] | ret |

See Also
  elm_gesture_layer_attach

#define elm_obj_gesture_layer_cb_add | ( |  | idx,
|  |  | cb_type,
|  |  | cb,
|  |  | data
| ) |  | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_ADD), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data)

Since
  1.8

Use function to add a callback to be notified about change of state of gesture.

Parameters

  [in] | idx |
  [in] | cb_type |
  [in] | cb |
  [in] | data |

See Also
  elm_gesture_layer_cb_add

#define elm_obj_gesture_layer_cb_del | ( |  | idx,
|  |  | cb_type,
|  |  | cb,
|  |  | data
| ) |  | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_DEL), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data)

Since
  1.8

Use function to remove a callback that has been added to be notified about change of state of gesture.

Parameters

  [in] | idx |
  [in] | cb_type |
  [in] | cb |
  [in] | data |

See Also
  elm_gesture_layer_cb_del

#define elm_obj_gesture_layer_cb_set | ( |  | idx,
|  |  | cb_type,
|  |  | cb,
|  |  | data
| ) |  | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data)

Since
  1.8

Use function to set callbacks to be notified about change of state of gesture. If a function was already set for this gesture/type/state, it will be replaced by the new one. For ABI compat, callbacks added by elm_obj_gesture_layer_cb_add will be removed. It is recommended to use only one of these functions for a gesture object.

Parameters

  [in] | idx |
  [in] | cb_type |
  [in] | cb |
  [in] | data |

See Also
  elm_gesture_layer_cb_set
  elm_gesture_layer_cb_add

#define elm_obj_gesture_layer_hold_events_get | ( |  | ret | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Call this function to get repeat-events settings.

Parameters

  [out] | ret |

See Also
  elm_gesture_layer_hold_events_get

#define elm_obj_gesture_layer_hold_events_set | ( |  | hold_events | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET), EO_TYPECHECK(Eina_Bool, hold_events)

Since
  1.8

This function is to make gesture-layer repeat events.

Parameters

  [in] | hold_events |

See Also
  elm_gesture_layer_hold_events_set

#define elm_obj_gesture_layer_rotate_step_get | ( |  | ret | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET), EO_TYPECHECK(double *, ret)

Since
  1.8

This function returns step-value for rotate action.

Parameters

  [out] | ret |

See Also
  elm_gesture_layer_rotate_step_get

#define elm_obj_gesture_layer_rotate_step_set | ( |  | step | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET), EO_TYPECHECK(double, step)

Since
  1.8

This function sets step-value for rotate action.

Parameters

  [in] | step |

See Also
  elm_gesture_layer_rotate_step_set

#define elm_obj_gesture_layer_tap_finger_size_get | ( |  | ret | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_TAP_FINGER_SIZE_GET), EO_TYPECHECK(Evas_Coord *, ret)

Since
  1.8

This function returns the gesture layer finger-size for taps

Parameters

  [out] | ret |

Returns
  Finger size that is currently used by Gesture Layer for taps.

See Also
  elm_gesture_layer_tap_finger_size_set

#define elm_obj_gesture_layer_tap_finger_size_set | ( |  | sz | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_TAP_FINGER_SIZE_SET), EO_TYPECHECK(Evas_Coord, sz)

Since
  1.8

This function sets the gesture layer finger-size for taps If not set, this size is taken from elm_config. Set to ZERO if you want GLayer to use system finger size value (default) It is recommended to not set a too much big or little value to avoid weird behaviors.

Parameters

  [in] | fsize | Finger size

See Also
  elm_gesture_layer_tap_finger_size_get

#define elm_obj_gesture_layer_zoom_step_get | ( |  | ret | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET), EO_TYPECHECK(double *, ret)

Since
  1.8

This function returns step-value for zoom action.

Parameters

  [out] | ret |

See Also
  elm_gesture_layer_zoom_step_get

#define elm_obj_gesture_layer_zoom_step_set | ( |  | step | ) | ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET), EO_TYPECHECK(double, step)

Since
  1.8

This function sets step-value for zoom action.

Parameters

  [in] | step |

See Also
  elm_gesture_layer_zoom_step_set

## Function Documentation

double elm_config_glayer_double_tap_timeout_get | ( | void |  | ) |

Get the duration for occurring double tap event of gesture layer.

Returns
  Timeout for double tap event of gesture layer.

Since
  1.8

void elm_config_glayer_double_tap_timeout_set | ( | double | double_tap_timeout | ) |

Set the duration for occurring double tap event of gesture layer.

Parameters

  long_tap_timeout | Timeout for double tap event of gesture layer.

Since
  1.8

double elm_config_glayer_long_tap_start_timeout_get | ( | void |  | ) |

Get the duration for occurring long tap event of gesture layer.

Returns
  Timeout for long tap event of gesture layer.

Since
  1.8

void elm_config_glayer_long_tap_start_timeout_set | ( | double | long_tap_timeout | ) |

Set the duration for occurring long tap event of gesture layer.

Parameters

  long_tap_timeout | Timeout for long tap event of gesture layer.

Since
  1.8

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:13