static void _e_gesture_wl_client_cb_destroy(struct wl_listener *l, void *data);
static void _e_gesture_wl_surface_cb_destroy(struct wl_listener *l, void *data);
+
+static Eina_Bool
+_e_gesture_privilege_check(struct wl_client *client, const char *privilege)
+{
+ Eina_Bool res;
+ pid_t pid = 0;
+ uid_t uid = 0;
+
+ wl_client_get_credentials(client, &pid, &uid, NULL);
+ res = e_security_privilege_check(pid, uid, privilege);
+
+ return res;
+}
+
static Eina_Bool
_e_gesture_edge_boundary_check(E_Gesture_Event_Edge_Finger *fingers, unsigned int edge, int sp, int ep)
{
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_grab_edge_swipe(client, resource, fingers, edge, edge_size, start_point, end_point);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_grab_edge_swipe(client, resource, fingers, edge, edge_size, start_point, end_point);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, edge_size, start_point, end_point, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_ungrab_edge_swipe(client, resource, fingers, edge, edge_size, start_point, end_point);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_ungrab_edge_swipe(client, resource, fingers, edge, edge_size, start_point, end_point);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, edge_size, start_point, end_point, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_grab_edge_drag(client, resource, fingers, edge, edge_size, start_point, end_point);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_grab_edge_drag(client, resource, fingers, edge, edge_size, start_point, end_point);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, edge_size, start_point, end_point, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_ungrab_edge_drag(client, resource, fingers, edge, edge_size, start_point, end_point);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_ungrab_edge_drag(client, resource, fingers, edge, edge_size, start_point, end_point);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, edge_size, start_point, end_point, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_grab_tap(client, resource, fingers, repeats);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_grab_tap(client, resource, fingers, repeats);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_tap_notify(resource, fingers, repeats, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_ungrab_tap(client, resource, fingers, repeats);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_ungrab_tap(client, resource, fingers, repeats);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_tap_notify(resource, fingers, repeats, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_grab_palm_cover(client, resource);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_grab_palm_cover(client, resource);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_palm_cover_notify(resource, NULL, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
- ret = _e_gesture_ungrab_palm_cover(client, resource);
+ if (_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_GRAB))
+ {
+ ret = _e_gesture_ungrab_palm_cover(client, resource);
+ }
+ else
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
tizen_gesture_send_palm_cover_notify(resource, NULL, ret);
}
{
int ret = TIZEN_GESTURE_ERROR_NONE;
+ if (!surface)
+ {
+ if (!_e_gesture_privilege_check(client, E_PRIVILEGE_GESTURE_ACTIVATE))
+ {
+ ret = TIZEN_GESTURE_ERROR_NO_PERMISSION;
+ goto notify;
+ }
+ }
+
if (!active)
ret = _e_gesture_deactivate_set(client, resource, surface, type);
else
ret = _e_gesture_deactivate_unset(client, resource, surface, type);
+notify:
tizen_gesture_send_activate_notify(resource, surface, type, active, ret);
}