Tizen Native API
|
This provides basic gesture detection.
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 the gesture state. By using the gesture layer we make a standard interface.
In order to use Gesture Layer you start with elm_gesture_layer_add and a parent object parameter. Next 'activate' the gesture layer with a call to elm_gesture_layer_attach Usually with the same object as target (2nd parameter).
Now you need to tell the gesture layer what gestures you follow. This is done with elm_gesture_layer_cb_set call. By setting the callback you are actually telling the gesture layer: I would like to know when the gesture Elm_Gesture_Type switches to the 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 to this gesture to NULL
. (again with elm_gesture_layer_cb_set)
The information reported by the 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 the info reported for momentum gestures: ELM_GESTURE_MOMENTUM.
Elm_Gesture_Line_Info is the info reported for line gestures: (this also contains the 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 a flick-time-limit as defined in Elementary Config.
Elm_Gesture_Zoom_Info is the info reported for the ELM_GESTURE_ZOOM gesture.
Elm_Gesture_Rotate_Info is the info reported for the ELM_GESTURE_ROTATE gesture.
Gesture Layer Tweaks:
Note that line, flick, gestures can start without the need to remove fingers from the surface. When the user's fingers rest on the same-spot, the gesture ends and starts again when the fingers are moved.
Setting glayer_continues_enable to false
in Elementary Config changes this behavior, so the gesture starts when the user touches (a *DOWN event) touch-surface and ends when no fingers touch the surface (a *UP event).
Supported common elm_object APIs.
Functions | |
void | elm_gesture_layer_cb_set (Evas_Object *obj, Elm_Gesture_Type idx, Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb, void *data) |
Sets callbacks to be notified about the change of state of a gesture. | |
Eina_Bool | elm_gesture_layer_hold_events_get (const Evas_Object *obj) |
Called to get repeat-events settings. | |
void | elm_gesture_layer_hold_events_set (Evas_Object *obj, Eina_Bool hold_events) |
Makes gesture-layer repeat events. | |
void | elm_gesture_layer_zoom_step_set (Evas_Object *obj, double step) |
Sets the step-value for zoom action. | |
double | elm_gesture_layer_zoom_step_get (const Evas_Object *obj) |
Gets the step-value for zoom action. | |
void | elm_gesture_layer_rotate_step_set (Evas_Object *obj, double step) |
Sets the step-value for rotate action. | |
double | elm_gesture_layer_rotate_step_get (const Evas_Object *obj) |
Gets the step-value for rotate action. | |
Eina_Bool | elm_gesture_layer_attach (Evas_Object *obj, Evas_Object *target) |
Attaches a given gesture layer widget to an Evas object, thus setting the widget's target. | |
Evas_Object * | elm_gesture_layer_add (Evas_Object *parent) |
Called to construct a new gesture-layer object. | |
void | elm_gesture_layer_line_min_length_set (Evas_Object *obj, int line_min_length) |
Sets the gesture layer line min length of an object. | |
int | elm_gesture_layer_line_min_length_get (const Evas_Object *obj) |
Gets the gesture layer line min length of an object. | |
void | elm_gesture_layer_zoom_distance_tolerance_set (Evas_Object *obj, Evas_Coord zoom_distance_tolerance) |
Sets the gesture layer zoom distance tolerance of an object. | |
Evas_Coord | elm_gesture_layer_zoom_distance_tolerance_get (const Evas_Object *obj) |
Gets the gesture layer zoom distance tolerance of an object. | |
void | elm_gesture_layer_line_distance_tolerance_set (Evas_Object *obj, Evas_Coord line_distance_tolerance) |
Sets the gesture layer line distance tolerance of an object. | |
Evas_Coord | elm_gesture_layer_line_distance_tolerance_get (const Evas_Object *obj) |
Gets the gesture layer line distance tolerance of an object. | |
void | elm_gesture_layer_line_angular_tolerance_set (Evas_Object *obj, double line_angular_tolerance) |
Sets the gesture layer line angular tolerance of an object. | |
double | elm_gesture_layer_line_angular_tolerance_get (const Evas_Object *obj) |
Gets the gesture layer line angular tolerance of an object. | |
void | elm_gesture_layer_zoom_wheel_factor_set (Evas_Object *obj, double zoom_wheel_factor) |
Sets the gesture layer zoom wheel factor of an object. | |
double | elm_gesture_layer_zoom_wheel_factor_get (const Evas_Object *obj) |
Gets the gesture layer zoom wheel factor of an object. | |
void | elm_gesture_layer_zoom_finger_factor_set (Evas_Object *obj, double zoom_finger_factor) |
Sets the gesture layer zoom finger factor of an object. | |
double | elm_gesture_layer_zoom_finger_factor_get (const Evas_Object *obj) |
Gets the gesture layer zoom finger factor of an object. | |
void | elm_gesture_layer_rotate_angular_tolerance_set (Evas_Object *obj, double rotate_angular_tolerance) |
Sets the gesture layer rotate angular tolerance of an object. | |
double | elm_gesture_layer_rotate_angular_tolerance_get (const Evas_Object *obj) |
Gets the gesture layer rotate angular tolerance of an object. | |
void | elm_gesture_layer_flick_time_limit_ms_set (Evas_Object *obj, unsigned int flick_time_limit_ms) |
Sets the gesture layer flick time limit (in ms) of an object. | |
unsigned int | elm_gesture_layer_flick_time_limit_ms_get (const Evas_Object *obj) |
Gets the gesture layer flick time limit (in ms) of an object. | |
void | elm_gesture_layer_long_tap_start_timeout_set (Evas_Object *obj, double long_tap_start_timeout) |
Sets the gesture layer long tap start timeout of an object. | |
double | elm_gesture_layer_long_tap_start_timeout_get (const Evas_Object *obj) |
Gets the gesture layer long tap start timeout of an object. | |
void | elm_gesture_layer_continues_enable_set (Evas_Object *obj, Eina_Bool continues_enable) |
Sets the gesture layer continues enable of an object. | |
Eina_Bool | elm_gesture_layer_continues_enable_get (const Evas_Object *obj) |
Gets the gesture layer continues enable of an object. | |
void | elm_gesture_layer_double_tap_timeout_set (Evas_Object *obj, double double_tap_timeout) |
Sets the gesture layer double tap timeout of an object. | |
double | elm_gesture_layer_double_tap_timeout_get (const Evas_Object *obj) |
Gets the gesture layer double tap timeout of an object. | |
void | elm_gesture_layer_tap_finger_size_set (Evas_Object *obj, Evas_Coord sz) |
Sets the gesture layer finger-size for taps. | |
Evas_Coord | elm_gesture_layer_tap_finger_size_get (const Evas_Object *obj) |
Gets the gesture layer finger-size for taps. | |
Typedefs | |
typedef enum _Elm_Gesture_Type | Elm_Gesture_Type |
This is a convenient macro around _Elm_Gesture_Type. | |
typedef enum _Elm_Gesture_State | Elm_Gesture_State |
This is a convenient macro around _Elm_Gesture_State. | |
typedef struct _Elm_Gesture_Taps_Info | Elm_Gesture_Taps_Info |
The structure type that holds taps info for the user. | |
typedef struct _Elm_Gesture_Momentum_Info | Elm_Gesture_Momentum_Info |
The structure type that holds momentum info for the user. | |
typedef struct _Elm_Gesture_Line_Info | Elm_Gesture_Line_Info |
The structure type that holds line info for the user. | |
typedef struct _Elm_Gesture_Zoom_Info | Elm_Gesture_Zoom_Info |
The structure type that holds zoom info for the user. | |
typedef struct _Elm_Gesture_Rotate_Info | Elm_Gesture_Rotate_Info |
The structure type that holds rotation info for the user. | |
typedef Evas_Event_Flags(* | Elm_Gesture_Event_Cb )(void *data, void *event_info) |
User callback used to stream gesture info from the gesture layer. |
Typedef Documentation
User callback used to stream gesture info from the gesture layer.
- Remarks:
- You should probably return EVAS_EVENT_FLAG_ON_HOLD if your widget acted upon the event, in an irreversible way.
- Parameters:
-
data The user data event_info The gesture report info
- Returns:
- The flag field to be applied on the causing event
Enumeration Type Documentation
enum _Elm_Gesture_State |
enum _Elm_Gesture_Type |
Enumeration of supported gesture types.
- Enumerator:
Function Documentation
double elm_config_glayer_double_tap_timeout_get | ( | void | ) |
Gets the duration for occurrence of the double tap event of the gesture layer.
- Since :
- 2.3.1
- Returns:
- The timeout for the double tap event of the gesture layer
void elm_config_glayer_double_tap_timeout_set | ( | double | double_tap_timeout | ) |
Sets the duration for occurrence of the double tap event of the gesture layer.
- Since :
- 2.3.1
- Parameters:
-
[in] double_tap_timeout The timeout for the double tap event of the gesture layer
double elm_config_glayer_long_tap_start_timeout_get | ( | void | ) |
Gets the duration for occurrence of the long tap event of the gesture layer.
- Since :
- 2.3.1
- Returns:
- The timeout for the long tap event of the gesture layer
void elm_config_glayer_long_tap_start_timeout_set | ( | double | long_tap_timeout | ) |
Sets the duration for occurrence of the long tap event of the gesture layer.
- Since :
- 2.3.1
- Parameters:
-
[in] long_tap_timeout The timeout for the long tap event of the gesture layer
Evas_Object* elm_gesture_layer_add | ( | Evas_Object * | parent | ) |
Called to construct a new gesture-layer object.
- Since :
- 2.3.1
- Remarks:
- This does not activate the gesture layer. You have to call elm_gesture_layer_attach() in order to 'activate' gesture-layer.
- Parameters:
-
[in] parent The gesture layer's parent widget
- Returns:
- A new gesture layer object
Eina_Bool elm_gesture_layer_attach | ( | Evas_Object * | obj, |
Evas_Object * | target | ||
) |
Attaches a given gesture layer widget to an Evas object, thus setting the widget's target.
- Since :
- 2.3.1
- Remarks:
- A gesture layer target may be whichever Evas object one chooses. This is the object obj that listens to all mouse and key events and reports the gestures made upon it.
- Parameters:
-
[in] obj The gesture layer to attach an object to [in] target The object to attach to obj (target)
- Returns:
EINA_TRUE
on success, otherwiseEINA_FALSE
on failure
void elm_gesture_layer_cb_set | ( | Evas_Object * | obj, |
Elm_Gesture_Type | idx, | ||
Elm_Gesture_State | cb_type, | ||
Elm_Gesture_Event_Cb | cb, | ||
void * | data | ||
) |
Sets callbacks to be notified about the change of state of a gesture.
- Since :
- 2.3.1
- Remarks:
- When a user registers a callback with this function it means this gesture has to be tested.
-
When ALL callbacks for a gesture are set to
NULL
it means the user isn't interested in gesture-state and it is not tested.
- Parameters:
-
[in] obj The gesture-layer [in] idx The gesture whose state is tracked [in] cb The callback function pointer [in] cb_type The event type this callback tracks: START, MOVE, END, ABORT [in] data The user info to be sent to the callback (usually, Smart Data)
Eina_Bool elm_gesture_layer_continues_enable_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer continues enable of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The continues enable
void elm_gesture_layer_continues_enable_set | ( | Evas_Object * | obj, |
Eina_Bool | continues_enable | ||
) |
Sets the gesture layer continues enable of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] continues_enable The continues enable
double elm_gesture_layer_double_tap_timeout_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer double tap timeout of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The double tap timeout
void elm_gesture_layer_double_tap_timeout_set | ( | Evas_Object * | obj, |
double | double_tap_timeout | ||
) |
Sets the gesture layer double tap timeout of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] double_tap_timeout The double tap timeout
unsigned int elm_gesture_layer_flick_time_limit_ms_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer flick time limit (in ms) of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The flick time limit (in ms)
void elm_gesture_layer_flick_time_limit_ms_set | ( | Evas_Object * | obj, |
unsigned int | flick_time_limit_ms | ||
) |
Sets the gesture layer flick time limit (in ms) of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] flick_time_limit_ms The flick time limit (in ms)
Eina_Bool elm_gesture_layer_hold_events_get | ( | const Evas_Object * | obj | ) |
Called to get repeat-events settings.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The repeat events settings
- See also:
- elm_gesture_layer_hold_events_set()
void elm_gesture_layer_hold_events_set | ( | Evas_Object * | obj, |
Eina_Bool | hold_events | ||
) |
Makes gesture-layer repeat events.
- Since :
- 2.3.1
- Remarks:
- Set this if you like to get the raw events only if gestures were not detected.
- Clear this if you like the gesture layer to forward events as testing gestures.
- Parameters:
-
[in] obj The gesture layer [in] hold_events The boolean value that indicates whether events are held
double elm_gesture_layer_line_angular_tolerance_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer line angular tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The line angular tolerance
void elm_gesture_layer_line_angular_tolerance_set | ( | Evas_Object * | obj, |
double | line_angular_tolerance | ||
) |
Sets the gesture layer line angular tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] line_angular_tolerance The line angular tolerance
Evas_Coord elm_gesture_layer_line_distance_tolerance_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer line distance tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The line distance tolerance
void elm_gesture_layer_line_distance_tolerance_set | ( | Evas_Object * | obj, |
Evas_Coord | line_distance_tolerance | ||
) |
Sets the gesture layer line distance tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] line_distance_tolerance The line distance tolerance
int elm_gesture_layer_line_min_length_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer line min length of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The length
void elm_gesture_layer_line_min_length_set | ( | Evas_Object * | obj, |
int | line_min_length | ||
) |
Sets the gesture layer line min length of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] line_min_length The length
double elm_gesture_layer_long_tap_start_timeout_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer long tap start timeout of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The long tap start timeout
void elm_gesture_layer_long_tap_start_timeout_set | ( | Evas_Object * | obj, |
double | long_tap_start_timeout | ||
) |
Sets the gesture layer long tap start timeout of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] long_tap_start_timeout The long tap start timeout
double elm_gesture_layer_rotate_angular_tolerance_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer rotate angular tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The rotate angular tolerance
void elm_gesture_layer_rotate_angular_tolerance_set | ( | Evas_Object * | obj, |
double | rotate_angular_tolerance | ||
) |
Sets the gesture layer rotate angular tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] rotate_angular_tolerance The rotate angular tolerance
double elm_gesture_layer_rotate_step_get | ( | const Evas_Object * | obj | ) |
Gets the step-value for rotate action.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The rotate step value
void elm_gesture_layer_rotate_step_set | ( | Evas_Object * | obj, |
double | step | ||
) |
Sets the step-value for rotate action.
- Since :
- 2.3.1
- Remarks:
- Set the step to any positive value.
-
Cancel the step setting by setting to
0
.
- Parameters:
-
[in] obj The gesture-layer [in] step The new rotate step value
Evas_Coord elm_gesture_layer_tap_finger_size_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer finger-size for taps.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The finger size that is currently used by the Gesture Layer for taps
void elm_gesture_layer_tap_finger_size_set | ( | Evas_Object * | obj, |
Evas_Coord | sz | ||
) |
Sets the gesture layer finger-size for taps.
- Since :
- 2.3.1
- Remarks:
- 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 very big or small value to avoid weird behaviors.
- Parameters:
-
[in] obj The gesture-layer [in] sz The finger size
Evas_Coord elm_gesture_layer_zoom_distance_tolerance_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer zoom distance tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The zoom distance tolerance
void elm_gesture_layer_zoom_distance_tolerance_set | ( | Evas_Object * | obj, |
Evas_Coord | zoom_distance_tolerance | ||
) |
Sets the gesture layer zoom distance tolerance of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] zoom_distance_tolerance The zoom distance tolerance
double elm_gesture_layer_zoom_finger_factor_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer zoom finger factor of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The zoom finger factor
void elm_gesture_layer_zoom_finger_factor_set | ( | Evas_Object * | obj, |
double | zoom_finger_factor | ||
) |
Sets the gesture layer zoom finger factor of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] zoom_finger_factor The zoom finger factor
double elm_gesture_layer_zoom_step_get | ( | const Evas_Object * | obj | ) |
Gets the step-value for zoom action.
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The zoom step value
- See also:
- elm_gesture_layer_zoom_step_set()
void elm_gesture_layer_zoom_step_set | ( | Evas_Object * | obj, |
double | step | ||
) |
Sets the step-value for zoom action.
- Since :
- 2.3.1
- Remarks:
- Set the step to any positive value.
-
Cancel step setting by setting it to
0
.
- Parameters:
-
[in] obj The gesture-layer [in] step The new zoom step value
- See also:
- elm_gesture_layer_zoom_step_get()
double elm_gesture_layer_zoom_wheel_factor_get | ( | const Evas_Object * | obj | ) |
Gets the gesture layer zoom wheel factor of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer
- Returns:
- The zoom wheel factor
void elm_gesture_layer_zoom_wheel_factor_set | ( | Evas_Object * | obj, |
double | zoom_wheel_factor | ||
) |
Sets the gesture layer zoom wheel factor of an object.
- Since (EFL) :
- 1.8
- Since :
- 2.3.1
- Parameters:
-
[in] obj The gesture-layer [in] zoom_wheel_factor The zoom wheel factor