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... | |
void | elm_gesture_layer_zoom_step_set (Elm_Gesture_Layer *obj, double step) |
Control step value for zoom action. More... | |
double | elm_gesture_layer_zoom_step_get (const Elm_Gesture_Layer *obj) |
Control step value for zoom action. More... | |
void | elm_gesture_layer_tap_finger_size_set (Elm_Gesture_Layer *obj, int sz) |
This function sets the gesture layer finger-size for taps. More... | |
int | elm_gesture_layer_tap_finger_size_get (const Elm_Gesture_Layer *obj) |
This function returns the gesture layer finger-size for taps. More... | |
void | elm_gesture_layer_hold_events_set (Elm_Gesture_Layer *obj, Eina_Bool hold_events) |
This function makes gesture-layer repeat events. More... | |
Eina_Bool | elm_gesture_layer_hold_events_get (const Elm_Gesture_Layer *obj) |
Get the repeat-events setting. More... | |
void | elm_gesture_layer_rotate_step_set (Elm_Gesture_Layer *obj, double step) |
This function returns step-value for rotate action. More... | |
double | elm_gesture_layer_rotate_step_get (const Elm_Gesture_Layer *obj) |
This function returns step-value for rotate action. More... | |
void | elm_gesture_layer_cb_set (Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data) |
Set the gesture state change callback. More... | |
Eina_Bool | elm_gesture_layer_attach (Elm_Gesture_Layer *obj, Efl_Canvas_Object *target) |
Attach a gesture layer widget to an Evas object (setting the widget's target). More... | |
void | elm_gesture_layer_cb_del (Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data) |
Remove a gesture callback. More... | |
void | elm_gesture_layer_cb_add (Elm_Gesture_Layer *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data) |
Add a gesture state change callback. More... | |
Evas_Object * | elm_gesture_layer_add (Evas_Object *parent) |
Call this function to construct a new gesture-layer object. More... | |
void | elm_gesture_layer_tap_longpress_cb_add (Evas_Object *obj, Elm_Gesture_State state, Elm_Gesture_Event_Cb cb, void *data) |
This function adds a callback called during Tap + Long Tap sequence. More... | |
void | elm_gesture_layer_tap_longpress_cb_del (Evas_Object *obj, Elm_Gesture_State state, Elm_Gesture_Event_Cb cb, void *data) |
This function removes a callback called during Tap + Long Tap sequence. More... | |
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 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 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.
double elm_config_glayer_long_tap_start_timeout_get | ( | void | ) |
Get the duration for occurring long tap event of gesture layer.
void elm_config_glayer_long_tap_start_timeout_set | ( | double | long_tap_timeout | ) |
Set the duration for occurring long tap event of gesture layer.
long_tap_timeout | Timeout for long tap event of gesture layer. |
References EINA_TRUE.
double elm_config_glayer_double_tap_timeout_get | ( | void | ) |
Get the duration for occurring double tap event of gesture layer.
void elm_config_glayer_double_tap_timeout_set | ( | double | double_tap_timeout | ) |
Set the duration for occurring double tap event of gesture layer.
double_tap_timeout | Timeout for double tap event of gesture layer. |
References EINA_TRUE.
void elm_gesture_layer_zoom_step_set | ( | Elm_Gesture_Layer * | obj, |
double | step | ||
) |
Control step value for zoom action.
When recognizing the zoom gesture, it should be recognized as zooming larger than step.
[in] | obj | The object. |
[in] | step | The zoom step value. |
References elm_obj_gesture_layer_zoom_step_set().
double elm_gesture_layer_zoom_step_get | ( | const Elm_Gesture_Layer * | obj | ) |
Control step value for zoom action.
[in] | obj | The object. |
References elm_obj_gesture_layer_zoom_step_get().
void elm_gesture_layer_tap_finger_size_set | ( | Elm_Gesture_Layer * | obj, |
int | sz | ||
) |
This function sets the gesture layer finger-size for taps.
If not set, it's taken from elm_config. Set to 0 if you want GLayer to use the system finger size value (default).
[in] | obj | The object. |
[in] | sz | The finger size. |
This function sets the gesture layer finger-size for taps.
Set to ZERO if you want GLayer to use system finger size value (default)
obj | gesture-layer. |
sz | Finger size |
int elm_gesture_layer_tap_finger_size_get | ( | const Elm_Gesture_Layer * | obj | ) |
This function returns the gesture layer finger-size for taps.
[in] | obj | The object. |
obj | gesture-layer. |
void elm_gesture_layer_hold_events_set | ( | Elm_Gesture_Layer * | obj, |
Eina_Bool | hold_events | ||
) |
This function makes gesture-layer repeat events.
Set this if you like to get the raw events only if gestures were not detected.
Clear this if you like gesture layer to forward events as testing gestures.
[in] | obj | The object. |
[in] | hold_events | If true get events only if gesture was not detected, false otherwise |
References elm_obj_gesture_layer_hold_events_set().
Eina_Bool elm_gesture_layer_hold_events_get | ( | const Elm_Gesture_Layer * | obj | ) |
Get the repeat-events setting.
[in] | obj | The object. |
true
get events only if gesture was not detected, false
otherwise References elm_obj_gesture_layer_hold_events_get().
void elm_gesture_layer_rotate_step_set | ( | Elm_Gesture_Layer * | obj, |
double | step | ||
) |
This function returns step-value for rotate action.
Set to 0 to cancel step setting.
When recognizing the rotate gesture, the rotated size must be larger than step.
[in] | obj | The object. |
[in] | step | New rotate step value. |
References elm_obj_gesture_layer_rotate_step_set().
double elm_gesture_layer_rotate_step_get | ( | const Elm_Gesture_Layer * | obj | ) |
This function returns step-value for rotate action.
[in] | obj | The object. |
References elm_obj_gesture_layer_rotate_step_get().
void elm_gesture_layer_cb_set | ( | Elm_Gesture_Layer * | obj, |
Elm_Gesture_Type | idx, | ||
Elm_Gesture_State | cb_type, | ||
Elm_Gesture_Event_Cb | cb, | ||
void * | data | ||
) |
Set the gesture state change callback.
When all callbacks for the gesture are set to null
, it means this gesture is disabled.
[in] | obj | The object. |
[in] | idx | The gesture you want to track state of. |
[in] | cb_type | The event the callback tracks (START, MOVE, END, ABORT). |
[in] | cb | The callback itself. |
[in] | data | Custom data to be passed. |
References elm_obj_gesture_layer_cb_set().
Eina_Bool elm_gesture_layer_attach | ( | Elm_Gesture_Layer * | obj, |
Efl_Canvas_Object * | target | ||
) |
Attach a gesture layer widget to an Evas object (setting the widget's target).
A gesture layer's target may be any Evas object. This object will be used to listen to mouse and key events.
[in] | obj | The object. |
[in] | target | The object to attach. |
true
on success, false
otherwise. References elm_obj_gesture_layer_attach().
void elm_gesture_layer_cb_del | ( | Elm_Gesture_Layer * | obj, |
Elm_Gesture_Type | idx, | ||
Elm_Gesture_State | cb_type, | ||
Elm_Gesture_Event_Cb | cb, | ||
void * | data | ||
) |
Remove a gesture callback.
[in] | obj | The object. |
[in] | idx | The gesture you want to track state of. |
[in] | cb_type | The event the callback tracks (START, MOVE, END, ABORT). |
[in] | cb | The callback itself. |
[in] | data | Custom callback data. |
References elm_obj_gesture_layer_cb_del().
void elm_gesture_layer_cb_add | ( | Elm_Gesture_Layer * | obj, |
Elm_Gesture_Type | idx, | ||
Elm_Gesture_State | cb_type, | ||
Elm_Gesture_Event_Cb | cb, | ||
void * | data | ||
) |
Add a gesture state change callback.
When all callbacks for the gesture are set to null
, it means this gesture is disabled.
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_gesture_layer_cb_add will be removed. It is recommended to use only one of these functions for a gesture object.
[in] | obj | The object. |
[in] | idx | The gesture you want to track state of. |
[in] | cb_type | The event the callback tracks (START, MOVE, END, ABORT). |
[in] | cb | The callback itself. |
[in] | data | Custom data to be passed. |
References elm_obj_gesture_layer_cb_add().
Evas_Object * elm_gesture_layer_add | ( | Evas_Object * | parent | ) |
Call this function to construct a new gesture-layer object.
parent | The gesture layer's parent widget. |
This does not activate the gesture layer. You have to call elm_gesture_layer_attach() in order to 'activate' gesture-layer.
References EINA_SAFETY_ON_NULL_RETURN_VAL.
void elm_gesture_layer_tap_longpress_cb_add | ( | Evas_Object * | obj, |
Elm_Gesture_State | state, | ||
Elm_Gesture_Event_Cb | cb, | ||
void * | data | ||
) |
This function adds a callback called during Tap + Long Tap sequence.
state | state for the callback to add. |
cb | callback pointer |
data | user data for the callback. |
The callbacks will be called as followed:
You can remove the callbacks by using elm_gesture_layer_tap_longpress_cb_del.
void elm_gesture_layer_tap_longpress_cb_del | ( | Evas_Object * | obj, |
Elm_Gesture_State | state, | ||
Elm_Gesture_Event_Cb | cb, | ||
void * | data | ||
) |
This function removes a callback called during Tap + Long Tap sequence.
state | state for the callback to add. |
cb | callback pointer |
data | user data for the callback. |
The internal data used for the sequence will be freed ONLY when all the callbacks added via elm_gesture_layer_tap_longpress_cb_add are removed by this function.