/* LCOV_EXCL_START */
static int
-_efl_util_gesture_grab_edge_swipe(efl_util_gesture_data data)
+_efl_util_gesture_grab_edge_swipe(efl_util_gesture_data data, Eina_Bool grabbed)
{
int ret = EFL_UTIL_ERROR_NONE;
Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
start_point = edge_swipe_data->start_point;
end_point = edge_swipe_data->end_point;
- tizen_gesture_grab_edge_swipe(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
-
- while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
- wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
-
- ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
- _eflutil_defaultqueue.wl.gesture.request_notified = -1;
-
- return ret;
-}
-
-static int
-_efl_util_gesture_ungrab_edge_swipe(efl_util_gesture_data data)
-{
- int ret = EFL_UTIL_ERROR_NONE;
- Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
- Efl_Util_Gesture_Edge_Swipe_Grab_Data *edge_swipe_data = NULL;
- unsigned int fingers = 0;
- unsigned int edge = 0;
- unsigned int edge_size = 0;
- unsigned int start_point = 0;
- unsigned int end_point = 0;
-
- base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_SWIPE,
- EFL_UTIL_ERROR_INVALID_PARAMETER);
-
- edge_swipe_data = (Efl_Util_Gesture_Edge_Swipe_Grab_Data *)data;
-
- fingers = edge_swipe_data->fingers;
- edge = edge_swipe_data->edge;
- edge_size = edge_swipe_data->edge_size;
- start_point = edge_swipe_data->start_point;
- end_point = edge_swipe_data->end_point;
-
- tizen_gesture_ungrab_edge_swipe(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
-
- while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
- wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
-
- ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
- _eflutil_defaultqueue.wl.gesture.request_notified = -1;
-
- return ret;
-}
-
-static int
-_efl_util_gesture_grab_edge_drag(efl_util_gesture_data data)
-{
- int ret = EFL_UTIL_ERROR_NONE;
- Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
- Efl_Util_Gesture_Edge_Drag_Grab_Data *edge_drag_data = NULL;
- unsigned int fingers = 0;
- unsigned int edge = 0;
- unsigned int edge_size = 0;
- unsigned int start_point = 0;
- unsigned int end_point = 0;
-
- base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_DRAG,
- EFL_UTIL_ERROR_INVALID_PARAMETER);
-
- edge_drag_data = (Efl_Util_Gesture_Edge_Drag_Grab_Data *)data;
-
- fingers = edge_drag_data->fingers;
- edge = edge_drag_data->edge;
- edge_size = edge_drag_data->edge_size;
- start_point = edge_drag_data->start_point;
- end_point = edge_drag_data->end_point;
-
- tizen_gesture_grab_edge_drag(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+ if (grabbed)
+ tizen_gesture_grab_edge_swipe(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+ else
+ tizen_gesture_ungrab_edge_swipe(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
}
static int
-_efl_util_gesture_ungrab_edge_drag(efl_util_gesture_data data)
+_efl_util_gesture_grab_edge_drag(efl_util_gesture_data data, Eina_Bool grabbed)
{
int ret = EFL_UTIL_ERROR_NONE;
Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
start_point = edge_drag_data->start_point;
end_point = edge_drag_data->end_point;
- tizen_gesture_ungrab_edge_drag(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
-
- while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
- wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
-
- ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
- _eflutil_defaultqueue.wl.gesture.request_notified = -1;
-
- return ret;
-}
-
-
-static int
-_efl_util_gesture_grab_tap(efl_util_gesture_data data)
-{
- int ret = EFL_UTIL_ERROR_NONE;
- Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
- Efl_Util_Gesture_Tap_Grab_Data *tap_data = NULL;
- unsigned int fingers = 0;
- unsigned int repeats = 0;
-
- base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_TAP,
- EFL_UTIL_ERROR_INVALID_PARAMETER);
-
- tap_data = (Efl_Util_Gesture_Tap_Grab_Data *)data;
-
- fingers = tap_data->fingers;
- repeats = tap_data->repeats;
-
- tizen_gesture_grab_tap(_eflutil_defaultqueue.wl.gesture.proto, fingers, repeats);
+ if (grabbed)
+ tizen_gesture_grab_edge_drag(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+ else
+ tizen_gesture_ungrab_edge_drag(_eflutil_defaultqueue.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
}
static int
-_efl_util_gesture_ungrab_tap(efl_util_gesture_data data)
+_efl_util_gesture_grab_tap(efl_util_gesture_data data, Eina_Bool grabbed)
{
int ret = EFL_UTIL_ERROR_NONE;
Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
fingers = tap_data->fingers;
repeats = tap_data->repeats;
- tizen_gesture_ungrab_tap(_eflutil_defaultqueue.wl.gesture.proto, fingers, repeats);
-
- while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
- wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
-
- ret = _efl_util_gesture_convert_error(_eflutil_defaultqueue.wl.gesture.request_notified);
- _eflutil_defaultqueue.wl.gesture.request_notified = -1;
-
- return ret;
-}
-
-static int
-_efl_util_gesture_grab_palm_cover(efl_util_gesture_data data)
-{
- int ret = EFL_UTIL_ERROR_NONE;
- Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
-
- base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil_defaultqueue.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_PALM_COVER,
- EFL_UTIL_ERROR_INVALID_PARAMETER);
-
- tizen_gesture_grab_palm_cover(_eflutil_defaultqueue.wl.gesture.proto);
+ if (grabbed)
+ tizen_gesture_grab_tap(_eflutil_defaultqueue.wl.gesture.proto, fingers, repeats);
+ else
+ tizen_gesture_ungrab_tap(_eflutil_defaultqueue.wl.gesture.proto, fingers, repeats);
while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
}
static int
-_efl_util_gesture_ungrab_palm_cover(efl_util_gesture_data data)
+_efl_util_gesture_grab_palm_cover(efl_util_gesture_data data, Eina_Bool grabbed)
{
int ret = EFL_UTIL_ERROR_NONE;
Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_PALM_COVER,
EFL_UTIL_ERROR_INVALID_PARAMETER);
- tizen_gesture_ungrab_palm_cover(_eflutil_defaultqueue.wl.gesture.proto);
+ if (grabbed)
+ tizen_gesture_grab_palm_cover(_eflutil_defaultqueue.wl.gesture.proto);
+ else
+ tizen_gesture_ungrab_palm_cover(_eflutil_defaultqueue.wl.gesture.proto);
while (_eflutil_defaultqueue.wl.gesture.request_notified == -1)
wl_display_dispatch(_eflutil_defaultqueue.wl.dpy);
switch (base_data->type)
{
case TIZEN_GESTURE_TYPE_EDGE_SWIPE:
- ret = _efl_util_gesture_grab_edge_swipe(data);
+ ret = _efl_util_gesture_grab_edge_swipe(data, EINA_TRUE);
break;
case TIZEN_GESTURE_TYPE_EDGE_DRAG:
- ret = _efl_util_gesture_grab_edge_drag(data);
+ ret = _efl_util_gesture_grab_edge_drag(data, EINA_TRUE);
break;
case TIZEN_GESTURE_TYPE_TAP:
- ret = _efl_util_gesture_grab_tap(data);
+ ret = _efl_util_gesture_grab_tap(data, EINA_TRUE);
break;
case TIZEN_GESTURE_TYPE_PALM_COVER:
- ret = _efl_util_gesture_grab_palm_cover(data);
+ ret = _efl_util_gesture_grab_palm_cover(data, EINA_TRUE);
break;
default:
return EFL_UTIL_ERROR_INVALID_PARAMETER;
switch (base_data->type)
{
case TIZEN_GESTURE_TYPE_EDGE_SWIPE:
- ret = _efl_util_gesture_ungrab_edge_swipe(data);
+ ret = _efl_util_gesture_grab_edge_swipe(data, EINA_FALSE);
break;
case TIZEN_GESTURE_TYPE_EDGE_DRAG:
- ret = _efl_util_gesture_ungrab_edge_drag(data);
+ ret = _efl_util_gesture_grab_edge_drag(data, EINA_FALSE);
break;
case TIZEN_GESTURE_TYPE_TAP:
- ret = _efl_util_gesture_ungrab_tap(data);
+ ret = _efl_util_gesture_grab_tap(data, EINA_FALSE);
break;
case TIZEN_GESTURE_TYPE_PALM_COVER:
- ret = _efl_util_gesture_ungrab_palm_cover(data);
+ ret = _efl_util_gesture_grab_palm_cover(data, EINA_FALSE);
break;
default:
return EFL_UTIL_ERROR_INVALID_PARAMETER;