support the server grab mode 79/148879/3 accepted/tizen/unified/20170914.065719 submit/tizen/20170914.015335
authorJengHyun Kang <jhyuni.kang@samsung.com>
Mon, 11 Sep 2017 05:33:57 +0000 (14:33 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Mon, 11 Sep 2017 07:31:16 +0000 (16:31 +0900)
Change-Id: I60ad06185affb2d41e11dd24fa5929e54da24623

src/e_mod_gesture_events.c
src/e_mod_main.c
src/e_mod_main.h

index 13f2b36..c32b449 100644 (file)
@@ -297,6 +297,7 @@ _e_gesture_send_edge_swipe(int fingers, int x, int y, int edge)
    E_Gesture_Event_Edge_Finger_Edge *edata;
    E_Gesture_Event_Edge_Swipe *edge_swipes = &gesture->gesture_events.edge_swipes;
    int bp = -1;
+   E_Event_Gesture_Edge_Swipe *ev_swipe;
 
    if (gesture->gesture_events.event_keep)
      {
@@ -337,7 +338,20 @@ _e_gesture_send_edge_swipe(int fingers, int x, int y, int edge)
         if (bp >= edata->sp && bp <= edata->ep)
           {
              GTINF("Send edge_swipe gesture (fingers: %d, edge: %d) to client: %p\n", fingers, edge, edata->client);
-             tizen_gesture_send_edge_swipe(edata->res, TIZEN_GESTURE_MODE_DONE, fingers, x, y, edge);
+             if (edata->client == E_GESTURE_SERVER_CLIENT)
+               {
+                  ev_swipe = E_NEW(E_Event_Gesture_Edge_Swipe, 1);
+                  EINA_SAFETY_ON_NULL_RETURN(ev_swipe);
+
+                  ev_swipe->mode = E_GESTURE_MODE_DONE;
+                  ev_swipe->edge = edge;
+                  ev_swipe->fingers = fingers;
+                  ev_swipe->sx = x;
+                  ev_swipe->sy = y;
+                  ecore_event_add(E_EVENT_GESTURE_EDGE_SWIPE, ev_swipe, NULL, NULL);
+               }
+             else
+               tizen_gesture_send_edge_swipe(edata->res, TIZEN_GESTURE_MODE_DONE, fingers, x, y, edge);
              break;
           }
      }
@@ -628,6 +642,7 @@ _e_gesture_send_edge_drag(int fingers, int x, int y, int edge, int mode)
    E_Gesture_Event_Edge_Finger_Edge *edata;
    E_Gesture_Event_Edge_Drag *edge_drags = &gesture->gesture_events.edge_drags;
    int bp = -1;
+   E_Event_Gesture_Edge_Drag *ev_drag;
 
    if (gesture->gesture_events.event_keep)
      {
@@ -660,6 +675,19 @@ _e_gesture_send_edge_drag(int fingers, int x, int y, int edge, int mode)
         if (bp >= edata->sp && bp <= edata->ep)
           {
              GTINF("Send edge drag gesture (fingers: %d, edge: %d) to client: %p\n", fingers, edge, edata->client);
+             if (edata->client == E_GESTURE_SERVER_CLIENT)
+               {
+                  ev_drag = E_NEW(E_Event_Gesture_Edge_Drag, 1);
+                  EINA_SAFETY_ON_NULL_RETURN(ev_drag);
+
+                  ev_drag->mode = E_GESTURE_MODE_DONE;
+                  ev_drag->edge = edge;
+                  ev_drag->fingers = fingers;
+                  ev_drag->cx = x;
+                  ev_drag->cy = y;
+                  ecore_event_add(E_EVENT_GESTURE_EDGE_DRAG, ev_drag, NULL, NULL);
+               }
+             else
              tizen_gesture_send_edge_drag(edata->res, mode, fingers, x, y, edge);
              break;
           }
@@ -809,6 +837,7 @@ static void
 _e_gesture_pan_send(int mode, int fingers, int cx, int cy, struct wl_resource *res, struct wl_client *client)
 {
    Ecore_Event_Mouse_Button *ev_cancel;
+   E_Event_Gesture_Pan *ev_pan;
 
    if (mode == TIZEN_GESTURE_MODE_BEGIN)
      {
@@ -822,6 +851,18 @@ _e_gesture_pan_send(int mode, int fingers, int cx, int cy, struct wl_resource *r
      }
 
    GTINF("Send pan gesture %d fingers. (%d, %d) to client: %p, mode: %d\n", fingers, cx, cy, client, mode);
+   if (client == E_GESTURE_SERVER_CLIENT)
+     {
+        ev_pan = E_NEW(E_Event_Gesture_Pan, 1);
+        EINA_SAFETY_ON_NULL_RETURN(ev_pan);
+
+        ev_pan->mode = mode;
+        ev_pan->fingers = fingers;
+        ev_pan->cx = cx;
+        ev_pan->cy = cy;
+
+        ecore_event_add(E_EVENT_GESTURE_PAN, ev_pan, NULL, NULL);
+     }
 
    gesture->gesture_events.recognized_gesture |= E_GESTURE_TYPE_PAN;
 }
@@ -958,6 +999,7 @@ static void
 _e_gesture_pinch_send(int mode, int fingers, double distance, double angle, int cx, int cy, struct wl_resource *res, struct wl_client *client)
 {
    Ecore_Event_Mouse_Button *ev_cancel;
+   E_Event_Gesture_Pinch *ev_pinch;
 
    if (mode == TIZEN_GESTURE_MODE_BEGIN)
      {
@@ -971,6 +1013,20 @@ _e_gesture_pinch_send(int mode, int fingers, double distance, double angle, int
      }
 
    GTINF("Send pinch gesture (fingers: %d, distance: %lf, angle: %lf, cx: %d, cy: %d) to client: %p, mode: %d\n", fingers, distance, angle, cx, cy, client, mode);
+   if (client == E_GESTURE_SERVER_CLIENT)
+     {
+        ev_pinch = E_NEW(E_Event_Gesture_Pinch, 1);
+        EINA_SAFETY_ON_NULL_RETURN(ev_pinch);
+
+        ev_pinch->mode = mode;
+        ev_pinch->fingers = fingers;
+        ev_pinch->distance = distance;
+        ev_pinch->angle = angle;
+        ev_pinch->cx = cx;
+        ev_pinch->cy = cy;
+
+        ecore_event_add(E_EVENT_GESTURE_PINCH, ev_pinch, NULL, NULL);
+     }
 
    gesture->gesture_events.recognized_gesture |= E_GESTURE_TYPE_PINCH;
 }
@@ -1165,8 +1221,22 @@ _e_gesture_tap_cancel(void)
 static void
 _e_gesture_send_tap(int fingers, int repeats, struct wl_client *client, struct wl_resource *res)
 {
+   E_Event_Gesture_Tap *ev_tap;
+
    GTINF("Send Tap gesture. %d fingers %d repeats to client (%p)\n", fingers, repeats, client);
-   tizen_gesture_send_tap(res, TIZEN_GESTURE_MODE_DONE, fingers, repeats);
+   if (client == E_GESTURE_SERVER_CLIENT)
+     {
+        ev_tap = E_NEW(E_Event_Gesture_Tap, 1);
+        EINA_SAFETY_ON_NULL_RETURN(ev_tap);
+
+        ev_tap->mode = E_GESTURE_MODE_DONE;
+        ev_tap->fingers = fingers;
+        ev_tap->repeats = repeats;
+
+        ecore_event_add(E_EVENT_GESTURE_TAP, ev_tap, NULL, NULL);
+     }
+   else
+     tizen_gesture_send_tap(res, TIZEN_GESTURE_MODE_DONE, fingers, repeats);
    _e_gesture_event_drop();
    gesture->gesture_events.recognized_gesture |= E_GESTURE_TYPE_TAP;
 
@@ -1629,6 +1699,7 @@ _e_gesture_send_palm_cover(void)
    struct wl_resource *surface = NULL, *res = NULL, *focus_surface = NULL;
    Eina_List *l;
    E_Gesture_Select_Surface *sdata;
+   E_Event_Gesture_Palm_Cover *ev_palm_cover;
 
    time = (int)(ecore_time_get()*1000);
 
@@ -1651,30 +1722,57 @@ _e_gesture_send_palm_cover(void)
 
    GTINF("Send palm_cover gesture to client: %p\n", palm_covers->client_info.client);
 
-   pressure = wl_fixed_from_double(0.0);
+   if (palm_covers->client_info.client == E_GESTURE_SERVER_CLIENT)
+     {
+        ev_palm_cover = E_NEW(E_Event_Gesture_Palm_Cover, 1);
+        EINA_SAFETY_ON_NULL_RETURN(ev_palm_cover);
+
+        ev_palm_cover->mode = E_GESTURE_MODE_BEGIN;
+        ev_palm_cover->duration = duration;
+        ev_palm_cover->cx = cx;
+        ev_palm_cover->cy = cy;
+        ev_palm_cover->size = size;
+        ev_palm_cover->pressure = 0.0;
+        ecore_event_add(E_EVENT_GESTURE_PALM_COVER, ev_palm_cover, NULL, NULL);
+
+        ev_palm_cover = E_NEW(E_Event_Gesture_Palm_Cover, 1);
+        EINA_SAFETY_ON_NULL_RETURN(ev_palm_cover);
 
-   focus_surface = _e_gesture_util_eclient_surface_get(e_client_focused_get());
-   if (focus_surface)
+        ev_palm_cover->mode = E_GESTURE_MODE_END;
+        ev_palm_cover->duration = duration;
+        ev_palm_cover->cx = cx;
+        ev_palm_cover->cy = cy;
+        ev_palm_cover->size = size;
+        ev_palm_cover->pressure = 0.0;
+        ecore_event_add(E_EVENT_GESTURE_PALM_COVER, ev_palm_cover, NULL, NULL);
+     }
+   else
      {
-        EINA_LIST_FOREACH(palm_covers->select_surface_list, l, sdata)
+        pressure = wl_fixed_from_double(0.0);
+
+        focus_surface = _e_gesture_util_eclient_surface_get(e_client_focused_get());
+        if (focus_surface)
           {
-             if (focus_surface == sdata->surface)
+             EINA_LIST_FOREACH(palm_covers->select_surface_list, l, sdata)
                {
-                  surface = sdata->surface;
-                  res = sdata->res;
-                  break;
+                  if (focus_surface == sdata->surface)
+                    {
+                       surface = sdata->surface;
+                       res = sdata->res;
+                       break;
+                    }
                }
           }
-     }
 
-   if (!surface || !res)
-     {
-        res = palm_covers->client_info.res;
-        surface = NULL;
-     }
+        if (!surface || !res)
+          {
+             res = palm_covers->client_info.res;
+             surface = NULL;
+          }
 
-   tizen_gesture_send_palm_cover(palm_covers->client_info.res, surface, TIZEN_GESTURE_MODE_BEGIN, duration, size, pressure, cx, cy);
-   tizen_gesture_send_palm_cover(palm_covers->client_info.res, surface, TIZEN_GESTURE_MODE_END, duration, size, pressure, cx, cy);
+        tizen_gesture_send_palm_cover(palm_covers->client_info.res, surface, TIZEN_GESTURE_MODE_BEGIN, duration, size, pressure, cx, cy);
+        tizen_gesture_send_palm_cover(palm_covers->client_info.res, surface, TIZEN_GESTURE_MODE_END, duration, size, pressure, cx, cy);
+     }
 
    gesture->event_state = E_GESTURE_EVENT_STATE_IGNORE;
    gesture->gesture_events.recognized_gesture |= E_GESTURE_TYPE_PALM_COVER;
index e585a53..9233cd1 100644 (file)
@@ -73,6 +73,26 @@ _e_gesture_set_client_to_list(E_Gesture_Grabbed_Client *gclient, struct wl_clien
    gclient->grabbed_gesture |= mode;
 }
 
+static char *
+_e_gesture_util_type_to_string(unsigned int type)
+{
+   switch (type)
+     {
+        case E_GESTURE_TYPE_EDGE_SWIPE:
+          return "edge_swipe";
+        case E_GESTURE_TYPE_TAP:
+          return "tap";
+        case E_GESTURE_TYPE_PALM_COVER:
+          return "palm_cover";
+        case E_GESTURE_TYPE_PAN:
+          return "pan";
+        case E_GESTURE_TYPE_PINCH:
+          return "pinch";
+        default:
+          return "unknown";
+     }
+}
+
 /* Function for registering wl_client destroy listener */
 int
 e_gesture_add_client_destroy_listener(struct wl_client *client, int mode, int fingers, unsigned int edge, unsigned int repeat, int sp, int ep)
@@ -81,6 +101,8 @@ e_gesture_add_client_destroy_listener(struct wl_client *client, int mode, int fi
    Eina_List *l;
    E_Gesture_Grabbed_Client *grabbed_client, *data;
 
+   if (client == E_GESTURE_SERVER_CLIENT) return TIZEN_GESTURE_ERROR_NONE;
+
    EINA_LIST_FOREACH(gesture->grab_client_list, l, data)
      {
         if (data->client == client)
@@ -229,6 +251,40 @@ _e_gesture_pinch_current_list_check(void)
      }
 }
 
+static int
+_e_gesture_add_surface_destroy_listener(struct wl_resource *surface, int type)
+{
+   struct wl_listener *destroy_listener = NULL;
+   Eina_List *l;
+   struct wl_resource *surface_data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, TIZEN_GESTURE_ERROR_INVALID_DATA);
+   if (type != E_GESTURE_TYPE_PALM_COVER)
+     return TIZEN_GESTURE_ERROR_INVALID_DATA;
+
+   EINA_LIST_FOREACH(gesture->select_surface_list, l, surface_data)
+     {
+        if (surface_data == surface)
+          {
+             return TIZEN_GESTURE_ERROR_NONE;
+          }
+     }
+
+   destroy_listener = E_NEW(struct wl_listener, 1);
+   if (!destroy_listener)
+     {
+        GTERR("Failed to allocate memory for wl_client destroy listener !\n");
+        return TIZEN_GESTURE_ERROR_NO_SYSTEM_RESOURCES;
+     }
+
+   destroy_listener->notify = _e_gesture_wl_surface_cb_destroy;
+   wl_resource_add_destroy_listener(surface, destroy_listener);
+
+   gesture->select_surface_list = eina_list_append(gesture->select_surface_list, surface);
+
+   return TIZEN_GESTURE_ERROR_NONE;
+}
+
 static void
 _e_gesture_remove_client_destroy_listener(struct wl_client *client, unsigned int mode, unsigned int fingers, unsigned int edge, unsigned int repeat, int sp, int ep)
 {
@@ -321,883 +377,1063 @@ _e_gesture_remove_client_destroy_listener(struct wl_client *client, unsigned int
      }
 }
 
-#if 0
-static int
-_e_gesture_grab_pan(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
+static void
+_e_gesture_remove_surface_destroy_listener(struct wl_resource *surface, int type)
 {
-   E_Gesture_Event *gev;
-   int ret = TIZEN_GESTURE_ERROR_NONE;
+   Eina_List *l, *l_next;
+   struct wl_resource *surface_data;
+   struct wl_listener *destroy_listener;
 
-   GTINF("The client %p request to grab pan gesture, fingers: %d\n", client, fingers);
+   EINA_SAFETY_ON_NULL_RETURN(surface);
+   if (type != E_GESTURE_TYPE_PALM_COVER) return;
 
-   if (fingers > E_GESTURE_FINGER_MAX)
+   destroy_listener = wl_resource_get_destroy_listener(surface, _e_gesture_wl_surface_cb_destroy);
+   if (!destroy_listener)
      {
-        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto finish;
+        GTWRN("surface(%p) is not gesture selected surface\n", surface);
      }
 
-   gev = &gesture->gesture_events;
-
-   if (gev->pans.fingers[fingers].client)
+   EINA_LIST_FOREACH_SAFE(gesture->select_surface_list, l, l_next, surface_data)
      {
-        GTWRN("%d finger is already grabbed by %p client\n", fingers, gev->pans.fingers[fingers].client);
-        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
-        goto finish;
+        if (surface_data == surface)
+          {
+             gesture->select_surface_list = eina_list_remove_list(gesture->select_surface_list, l);
+             break;
+          }
      }
 
-   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_PAN, fingers, 0, 0);
+   wl_list_remove(&destroy_listener->link);
+   E_FREE(destroy_listener);
+}
 
-   gev->pans.fingers[fingers].client = client;
-   gev->pans.fingers[fingers].res = resource;
-   gev->pans.state = E_GESTURE_PANPINCH_STATE_READY;
+static Eina_Bool
+_e_gesture_edge_grabbed_client_check(struct wl_client *client)
+{
+   Eina_List *l;
+   E_Gesture_Event *gev;
+   int i, j;
+   E_Gesture_Event_Edge_Finger_Edge *edata;
 
-   gesture->grabbed_gesture |= E_GESTURE_TYPE_PAN;
-   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
+   gev = &gesture->gesture_events;
 
-finish:
-   return ret;
+   for (i = 1; i < E_GESTURE_FINGER_MAX + 1; i++)
+     {
+        for (j = 1; j < E_GESTURE_EDGE_MAX + 1; j++)
+          {
+             EINA_LIST_FOREACH(gev->edge_swipes.base.fingers[i].edge[j], l, edata)
+               {
+                  if (edata->client == client) return EINA_TRUE;
+               }
+          }
+     }
+   return EINA_FALSE;
 }
 
 static int
-_e_gesture_ungrab_pan(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
+_e_gesture_grab_edge_swipe(struct wl_client *client,
+                           struct wl_resource *resource,
+                           uint32_t fingers, uint32_t edge, uint32_t edge_size,
+                           uint32_t start_point, uint32_t end_point)
 {
    E_Gesture_Event *gev;
+   int sp = 0, ep = 0;
    int ret = TIZEN_GESTURE_ERROR_NONE;
+   E_Gesture_Conf_Edd *conf = gesture->config->conf;
 
-   GTINF("The client %p request to ungrab pan gesture, fingers: %d\n", client, fingers);
-
+   GTINF("client %p is request grab gesture, fingers: %d, edge: 0x%x, edge_size: %d, point( %d - %d)\n", client, fingers, edge, edge_size, start_point, end_point);
    if (fingers > E_GESTURE_FINGER_MAX)
      {
         GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
         ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto finish;
+        return ret;
      }
 
    gev = &gesture->gesture_events;
 
-   if (gev->pans.fingers[fingers].client == client)
+   if (edge < TIZEN_GESTURE_EDGE_TOP || edge > TIZEN_GESTURE_EDGE_LEFT)
      {
-        gev->pans.fingers[fingers].client = NULL;
-        gev->pans.fingers[fingers].res = NULL;
+        GTWRN("Invalid edge(%d)\n", edge);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        return ret;
      }
 
-   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_PAN, fingers, 0, 0);
-   _e_gesture_pan_current_list_check();
-
-finish:
-   return ret;
-}
-
-static int
-_e_gesture_grab_pinch(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
-{
-   E_Gesture_Event *gev;
-   int ret = TIZEN_GESTURE_ERROR_NONE;
-
-   GTINF("The client %p request to grab pinch gesture, fingers: %d\n", client, fingers);
-
-   if (fingers > E_GESTURE_FINGER_MAX)
+   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
      {
-        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
+        sp = start_point;
+        ep = end_point;
+        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
+            (ep > e_comp->w))
+          ep = e_comp->w;
+        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
+                 (ep > e_comp->h))
+          ep = e_comp->h;
+     }
+   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
+     {
+        sp = 0;
+        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
+          ep = e_comp->w;
+        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
+          ep = e_comp->h;
+     }
+   else
+     {
+        GTWRN("Invalid edge_size(%d)\n", edge_size);
         ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto finish;
+        return ret;
      }
 
-   gev = &gesture->gesture_events;
-
-   if (gev->pinchs.fingers[fingers].client)
+   if ((conf->edge_swipe.default_enable_back) &&
+       (edge == E_GESTURE_EDGE_TOP))
      {
-        GTWRN("%d finger is already grabbed by %p client\n", fingers, gev->pinchs.fingers[fingers].client);
         ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
-        goto finish;
      }
+   else if (_e_gesture_edge_boundary_check(&gev->edge_swipes.base.fingers[fingers], edge, sp, ep))
+     {
+        _e_gesture_edge_grab_add(&gev->edge_swipes.base.fingers[fingers], client, resource, edge, sp, ep);
 
-   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_PINCH, fingers, 0, 0);
+        e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_SWIPE, fingers, edge, 0, sp, ep);
 
-   gev->pinchs.fingers[fingers].client = client;
-   gev->pinchs.fingers[fingers].res = resource;
+        gesture->grabbed_gesture |= E_GESTURE_TYPE_EDGE_SWIPE;
+        gev->edge_swipes.base.fingers[fingers].enabled = EINA_TRUE;
+        if (gev->event_keep) gesture->event_state = E_GESTURE_EVENT_STATE_KEEP;
+        gev->edge_swipes.base.enabled_edge |= (1 << edge);
 
-   gev->pinchs.state = E_GESTURE_PANPINCH_STATE_READY;
-   gesture->grabbed_gesture |= E_GESTURE_TYPE_PINCH;
-   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
+        ret = TIZEN_GESTURE_ERROR_NONE;
+     }
+   else
+     {
+        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
+     }
 
-finish:
    return ret;
 }
 
 static int
-_e_gesture_ungrab_pinch(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
+_e_gesture_ungrab_edge_swipe(struct wl_client *client,
+                             struct wl_resource *resource,
+                             uint32_t fingers, uint32_t edge, uint32_t edge_size,
+                             uint32_t start_point, uint32_t end_point)
 {
    E_Gesture_Event *gev;
    int ret = TIZEN_GESTURE_ERROR_NONE;
+   int i;
+   Eina_List *l, *l_next;
+   E_Gesture_Event_Edge_Finger_Edge *edata;
+   Eina_Bool flag_removed = EINA_FALSE;
+   int sp = 0, ep = 0;
 
-   GTINF("The client %p request to ungrab pinch gesture, fingers: %d\n", client, fingers);
+   GTINF("client %p is request ungrab edge swipe gesture, fingers: %d, edge: 0x%x, edge_size: %d, (%d ~ %d)\n", client, fingers, edge, edge_size, start_point, end_point);
 
    if (fingers > E_GESTURE_FINGER_MAX)
      {
         GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
         ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto finish;
+        return ret;
      }
 
    gev = &gesture->gesture_events;
 
-   if (gev->pinchs.fingers[fingers].client == client)
+   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
      {
-        gev->pinchs.fingers[fingers].client = NULL;
-        gev->pinchs.fingers[fingers].res = NULL;
+        sp = start_point;
+        ep = end_point;
+        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
+            (ep > e_comp->w))
+          ep = e_comp->w;
+        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
+                 (ep > e_comp->h))
+          ep = e_comp->h;
      }
-
-   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_PINCH, fingers, 0, 0);
-   _e_gesture_pinch_current_list_check();
-
-finish:
-   return ret;
-}
-#endif
-
-static int
-_e_gesture_grab_palm_cover(struct wl_client *client, struct wl_resource *resource)
-{
-   E_Gesture_Event *gev;
-   int ret = TIZEN_GESTURE_ERROR_NONE;
-
-   gev = &gesture->gesture_events;
-
-   GTINF("The client %p request to grab palm hover gesture\n", client);
-
-   if (gev->palm_covers.client_info.client)
+   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
      {
-        GTWRN("Palm hover is already grabbed by %p client\n", gev->palm_covers.client_info.client);
-        goto finish;
+        sp = 0;
+        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
+          ep = e_comp->w;
+        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
+          ep = e_comp->h;
+     }
+   else
+     {
+        GTWRN("Invalid edge_size(%d)\n", edge_size);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        return ret;
      }
 
-   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_PALM_COVER, 0, 0, 0, 0, 0);
-
-   gev->palm_covers.client_info.client = client;
-   gev->palm_covers.client_info.res = resource;
-
-   gesture->grabbed_gesture |= E_GESTURE_TYPE_PALM_COVER;
-   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
-
-finish:
-   return ret;
-}
-
-static int
-_e_gesture_ungrab_palm_cover(struct wl_client *client, struct wl_resource *resource)
-{
-   E_Gesture_Event *gev;
-   int ret = TIZEN_GESTURE_ERROR_NONE;
-
-   GTINF("The client %p request to ungrab palm hover gesture\n", client);
-
-   gev = &gesture->gesture_events;
-
-   if (gev->palm_covers.client_info.client == client)
+   EINA_LIST_FOREACH_SAFE(gev->edge_swipes.base.fingers[fingers].edge[edge], l, l_next, edata)
      {
-        gev->palm_covers.client_info.client = NULL;
-        gev->palm_covers.client_info.client = NULL;
+        if ((edata->client == client) && (edata->sp == sp) && (edata->ep == ep))
+          {
+             gev->edge_swipes.base.fingers[fingers].edge[edge] = eina_list_remove_list(
+                gev->edge_swipes.base.fingers[fingers].edge[edge], l);
+             E_FREE(edata);
+             flag_removed = EINA_TRUE;
+          }
      }
 
-   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_PALM_COVER, 0, 0, 0, 0, 0);
-   gesture->grabbed_gesture &= ~E_GESTURE_TYPE_PALM_COVER;
-   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
-
-   return ret;
-}
-
-static int
-_e_gesture_add_surface_destroy_listener(struct wl_resource *surface, int type)
-{
-   struct wl_listener *destroy_listener = NULL;
-   Eina_List *l;
-   struct wl_resource *surface_data;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, TIZEN_GESTURE_ERROR_INVALID_DATA);
-   if (type != E_GESTURE_TYPE_PALM_COVER)
-     return TIZEN_GESTURE_ERROR_INVALID_DATA;
-
-   EINA_LIST_FOREACH(gesture->select_surface_list, l, surface_data)
+   if (flag_removed)
      {
-        if (surface_data == surface)
+        if (!_e_gesture_edge_grabbed_client_check(client))
           {
-             return TIZEN_GESTURE_ERROR_NONE;
+             _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_SWIPE, fingers, edge, 0, sp, ep);
+             _e_gesture_edge_swipe_current_list_check();
           }
      }
 
-   destroy_listener = E_NEW(struct wl_listener, 1);
-   if (!destroy_listener)
+   gev->edge_swipes.base.enabled_edge &= ~( 1 << edge);
+   for (i = 0; i < E_GESTURE_FINGER_MAX+1; i++)
      {
-        GTERR("Failed to allocate memory for wl_client destroy listener !\n");
-        return TIZEN_GESTURE_ERROR_NO_SYSTEM_RESOURCES;
+        if (eina_list_count(gev->edge_swipes.base.fingers[i].edge[edge]) > 0)
+          {
+             gev->edge_swipes.base.enabled_edge |= (1 << edge);
+             break;
+          }
      }
 
-   destroy_listener->notify = _e_gesture_wl_surface_cb_destroy;
-   wl_resource_add_destroy_listener(surface, destroy_listener);
-
-   gesture->select_surface_list = eina_list_append(gesture->select_surface_list, surface);
-
-   return TIZEN_GESTURE_ERROR_NONE;
+   return ret;
 }
 
-
 static int
-_e_gesture_select_palm_cover(struct wl_client *client, struct wl_resource *resource,
-                             struct wl_resource *surface)
+_e_gesture_grab_edge_drag(struct wl_client *client,
+                          struct wl_resource *resource,
+                          uint32_t fingers, uint32_t edge, uint32_t edge_size,
+                          uint32_t start_point, uint32_t end_point)
 {
+   E_Gesture_Event *gev;
+   int sp = 0, ep = 0;
    int ret = TIZEN_GESTURE_ERROR_NONE;
-   Eina_List *l;
-   E_Gesture_Event_Palm_Cover *palm_covers = &gesture->gesture_events.palm_covers;
-   E_Gesture_Select_Surface *sdata;
 
-   EINA_LIST_FOREACH(palm_covers->select_surface_list, l, sdata)
+   GTINF("client %p is request edge_drag grab, fingers: %d, edge: 0x%x, edge_size: %d, point( %d - %d)\n", client, fingers, edge, edge_size, start_point, end_point);
+   if (fingers > E_GESTURE_FINGER_MAX)
      {
-        if (sdata->surface == surface)
-          {
-             ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
-             goto out;
-          }
+        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        goto out;
      }
 
-   sdata = E_NEW(E_Gesture_Select_Surface, 1);
-   if (!sdata)
+   if (edge < TIZEN_GESTURE_EDGE_TOP || edge > TIZEN_GESTURE_EDGE_LEFT)
      {
-        ret = TIZEN_GESTURE_ERROR_NO_SYSTEM_RESOURCES;
+        GTWRN("Invalid edge(%d)\n", edge);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
         goto out;
      }
 
-   sdata->surface = surface;
-   sdata->res = resource;
+   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
+     {
+        sp = start_point;
+        ep = end_point;
+        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
+            (ep > e_comp->w))
+          ep = e_comp->w;
+        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
+                 (ep > e_comp->h))
+          ep = e_comp->h;
+     }
+   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
+     {
+        sp = 0;
+        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
+          ep = e_comp->w;
+        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
+          ep = e_comp->h;
+     }
+   else
+     {
+        GTWRN("Invalid edge_size(%d)\n", edge_size);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        goto out;
+     }
 
-   palm_covers->select_surface_list = eina_list_append(palm_covers->select_surface_list, sdata);
+   gev = &gesture->gesture_events;
 
-   _e_gesture_add_surface_destroy_listener(surface, E_GESTURE_TYPE_PALM_COVER);
+   if (_e_gesture_edge_boundary_check(&gev->edge_drags.base.fingers[fingers], edge, sp, ep))
+     {
+        _e_gesture_edge_grab_add(&gev->edge_drags.base.fingers[fingers], client, resource, edge, sp, ep);
+
+        e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_DRAG, fingers, edge, 0, sp, ep);
+
+        gesture->grabbed_gesture |= E_GESTURE_TYPE_EDGE_DRAG;
+        gev->edge_drags.base.fingers[fingers].enabled = EINA_TRUE;
+        if (gev->event_keep) gesture->event_state = E_GESTURE_EVENT_STATE_KEEP;
+        gev->edge_drags.base.enabled_edge |= (1 << edge);
+
+        ret = TIZEN_GESTURE_ERROR_NONE;
+     }
+   else
+     {
+        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
+     }
 
 out:
    return ret;
 }
 
-static void
-_e_gesture_remove_surface_destroy_listener(struct wl_resource *surface, int type)
+static int
+_e_gesture_ungrab_edge_drag(struct wl_client *client,
+                       struct wl_resource *resource,
+                       uint32_t fingers, uint32_t edge, uint32_t edge_size,
+                       uint32_t start_point, uint32_t end_point)
 {
+   E_Gesture_Event *gev;
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+   int i;
    Eina_List *l, *l_next;
-   struct wl_resource *surface_data;
-   struct wl_listener *destroy_listener;
+   E_Gesture_Event_Edge_Finger_Edge *edata;
+   Eina_Bool flag_removed = EINA_FALSE;
+   int sp = 0, ep = 0;
 
-   EINA_SAFETY_ON_NULL_RETURN(surface);
-   if (type != E_GESTURE_TYPE_PALM_COVER) return;
+   GTINF("client %p is request ungrab edge drag gesture, fingers: %d, edge: 0x%x, edge_size: %d, (%d ~ %d)\n", client, fingers, edge, edge_size, start_point, end_point);
 
-   destroy_listener = wl_resource_get_destroy_listener(surface, _e_gesture_wl_surface_cb_destroy);
-   if (!destroy_listener)
+   if (fingers > E_GESTURE_FINGER_MAX)
      {
-        GTWRN("surface(%p) is not gesture selected surface\n", surface);
+        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        goto out;
      }
 
-   EINA_LIST_FOREACH_SAFE(gesture->select_surface_list, l, l_next, surface_data)
+   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
      {
-        if (surface_data == surface)
+        sp = start_point;
+        ep = end_point;
+        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
+            (ep > e_comp->w))
+          ep = e_comp->w;
+        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
+                 (ep > e_comp->h))
+          ep = e_comp->h;
+     }
+   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
+     {
+        sp = 0;
+        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
+          ep = e_comp->w;
+        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
+          ep = e_comp->h;
+     }
+   else
+     {
+        GTWRN("Invalid edge_size(%d)\n", edge_size);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        goto out;
+     }
+
+   gev = &gesture->gesture_events;
+
+   EINA_LIST_FOREACH_SAFE(gev->edge_drags.base.fingers[fingers].edge[edge], l, l_next, edata)
+     {
+        if ((edata->client == client) && (edata->sp == sp) && (edata->ep == ep))
           {
-             gesture->select_surface_list = eina_list_remove_list(gesture->select_surface_list, l);
-             break;
+             gev->edge_drags.base.fingers[fingers].edge[edge] = eina_list_remove_list(
+                gev->edge_drags.base.fingers[fingers].edge[edge], l);
+             E_FREE(edata);
+             flag_removed = EINA_TRUE;
           }
      }
 
-   wl_list_remove(&destroy_listener->link);
-   E_FREE(destroy_listener);
-}
-
-static int
-_e_gesture_deselect_palm_cover(struct wl_client *client, struct wl_resource *resource,
-                             struct wl_resource *surface)
-{
-   int ret = TIZEN_GESTURE_ERROR_NONE;
-   Eina_List *l, *l_next;
-   E_Gesture_Event_Palm_Cover *palm_covers = &gesture->gesture_events.palm_covers;
-   E_Gesture_Select_Surface *sdata;
+   if (flag_removed)
+     {
+        if (!_e_gesture_edge_grabbed_client_check(client))
+          {
+             _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_DRAG, fingers, edge, 0, sp, ep);
+             _e_gesture_edge_drag_current_list_check();
+          }
+     }
 
-   EINA_LIST_FOREACH_SAFE(palm_covers->select_surface_list, l, l_next, sdata)
+   gev->edge_drags.base.enabled_edge &= ~( 1 << edge);
+   for (i = 0; i < E_GESTURE_FINGER_MAX+1; i++)
      {
-        if (sdata->surface == surface)
+        if (eina_list_count(gev->edge_drags.base.fingers[i].edge[edge]) > 0)
           {
-             palm_covers->select_surface_list = eina_list_remove_list(palm_covers->select_surface_list, l);
-             E_FREE(sdata);
+             gev->edge_drags.base.enabled_edge |= (1 << edge);
              break;
           }
      }
 
-   _e_gesture_remove_surface_destroy_listener(surface, E_GESTURE_TYPE_PALM_COVER);
-
+out:
    return ret;
 }
 
-static Eina_Bool
-_e_gesture_deactivate_find_surface(Eina_List *list, struct wl_resource *surface)
+static int
+_e_gesture_grab_tap(struct wl_client *client,
+                    struct wl_resource *resource,
+                    uint32_t fingers, uint32_t repeats)
 {
-   Eina_List *l;
-   E_Gesture_Activate_Surface_Info *idata;
+   E_Gesture_Event *gev;
+   int ret = TIZEN_GESTURE_ERROR_NONE;
 
-   EINA_LIST_FOREACH(list, l, idata)
+   GTINF("client %p requested to grab tap gesture (fingers: %d, repeats: %d)\n", client, fingers, repeats);
+
+   if (fingers > E_GESTURE_FINGER_MAX || repeats > E_GESTURE_TAP_REPEATS_MAX)
      {
-        if (surface == idata->surface)
-          {
-             return EINA_TRUE;
-          }
+        GTWRN("Not supported fingers /repeats bigger than their maximum values\n");
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        return ret;
      }
-   return EINA_FALSE;
-}
 
-static char *
-_e_gesture_util_type_to_string(unsigned int type)
-{
-   switch (type)
-     {
-        case E_GESTURE_TYPE_EDGE_SWIPE:
-          return "edge_swipe";
-        case E_GESTURE_TYPE_TAP:
-          return "tap";
-        case E_GESTURE_TYPE_PALM_COVER:
-          return "palm_cover";
-        case E_GESTURE_TYPE_PAN:
-          return "pan";
-        case E_GESTURE_TYPE_PINCH:
-          return "pinch";
-        default:
-          return "unknown";
-     }
-}
-
-static void
-_e_gesture_deactivate_list_unset(struct wl_client *client, struct wl_resource *surface, E_Gesture_Activate_Info *info, unsigned int type)
-{
-   Eina_List *l, *l_next;
-   struct wl_resource *surface_data;
+   gev = &gesture->gesture_events;
 
-   if (surface)
-     {
-        EINA_LIST_FOREACH_SAFE(info->surfaces, l, l_next, surface_data)
-          {
-             if (surface_data == surface)
-               {
-                  info->surfaces = eina_list_remove_list(info->surfaces, l);
-                  break;
-               }
-          }
-     }
-   else if (info->client && (info->client == client))
-     {
-        info->client = NULL;
-        info->active = EINA_TRUE;
-     }
-   else
+   if (gev->taps.fingers[fingers].repeats[repeats].client)
      {
-        GTWRN("Failed to unset %s deactivate. surface: %p, client: %p (already deactivated client: %p)\n", _e_gesture_util_type_to_string(type), surface, client, info->client);
+        GTWRN("%d finger %d repeats is already grabbed by %p client\n", fingers, repeats, gev->taps.fingers[fingers].repeats[repeats].client);
+        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
+        return ret;
      }
-}
 
-static void
-_e_gesture_deactivate_cb_client_listener(struct wl_listener *l, void *data)
-{
-   struct wl_client *client = data;
-
-   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
-   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
-   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
-   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
-   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
+   gev->taps.fingers[fingers].repeats[repeats].client = client;
+   gev->taps.fingers[fingers].repeats[repeats].res = resource;
+   gev->taps.fingers[fingers].enabled = EINA_TRUE;
 
-   wl_list_remove(&l->link);
-   E_FREE(l);
-}
+   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_TAP, fingers, 0, repeats, 0, 0);
 
-static void
-_e_gesture_deactivate_cb_surface_listener(struct wl_listener *l, void *data)
-{
-   struct wl_resource *surface = data;
+   if (gev->taps.max_fingers < fingers)
+     gev->taps.max_fingers = fingers;
+   if (gev->taps.fingers[fingers].max_repeats < repeats)
+     gev->taps.fingers[fingers].max_repeats = repeats;
 
-   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
-   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
-   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
-   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
-   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
+   gesture->grabbed_gesture |= E_GESTURE_TYPE_TAP;
+   gev->taps.state = E_GESTURE_TAP_STATE_READY;
+   gesture->event_state = E_GESTURE_EVENT_STATE_KEEP;
+   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
 
-   wl_list_remove(&l->link);
-   E_FREE(l);
+   return ret;
 }
 
 static int
-_e_gesture_deactivate_listener_add(struct wl_client *client, struct wl_resource * surface)
+_e_gesture_ungrab_tap(struct wl_client *client,
+                   struct wl_resource *resource,
+                   uint32_t fingers, uint32_t repeats)
 {
-   struct wl_listener *destroy_listener = NULL;
+   int i;
+   E_Gesture_Event *gev;
+   int ret = TIZEN_GESTURE_ERROR_NONE;
 
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(client || surface, TIZEN_GESTURE_ERROR_INVALID_DATA);
+   GTINF("client %p requested to ungrab tap gesture (fingers: %d, repeats: %d)\n", client, fingers, fingers);
 
-   destroy_listener = E_NEW(struct wl_listener, 1);
-   if (!destroy_listener)
+   if (fingers > E_GESTURE_FINGER_MAX || repeats > E_GESTURE_TAP_REPEATS_MAX)
      {
-        GTERR("Failed to allocate memory for deactivate destroy listener !\n");
-        return TIZEN_GESTURE_ERROR_NO_SYSTEM_RESOURCES;
+        GTWRN("Not supported fingers /repeats bigger than their maximum values\n");
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        return ret;
      }
 
-   if (surface)
-     {
-        destroy_listener->notify = _e_gesture_deactivate_cb_surface_listener;
-        wl_resource_add_destroy_listener(surface, destroy_listener);
-     }
-   else
+   gev = &gesture->gesture_events;
+
+   if (gev->taps.fingers[fingers].repeats[repeats].client == client)
      {
-        destroy_listener->notify = _e_gesture_deactivate_cb_client_listener;
-        wl_client_add_destroy_listener(client, destroy_listener);
+        gev->taps.fingers[fingers].repeats[repeats].client = NULL;
+        gev->taps.fingers[fingers].repeats[repeats].res = NULL;
      }
 
-   return TIZEN_GESTURE_ERROR_NONE;
-}
-
-static int
-_e_gesture_deactivate_list_set(struct wl_client *client, struct wl_resource *surface, E_Gesture_Activate_Info *info, unsigned int type)
-{
-   int ret = TIZEN_GESTURE_ERROR_NONE;
-
-   if (surface)
+   gev->taps.fingers[fingers].enabled = EINA_FALSE;
+   for (i = 0; i < E_GESTURE_TAP_REPEATS_MAX; i++)
      {
-        if (!_e_gesture_deactivate_find_surface(info->surfaces, surface))
+        if (gev->taps.fingers[fingers].repeats[i].client)
           {
-             info->surfaces = eina_list_append(info->surfaces, surface);
-             _e_gesture_deactivate_listener_add(client, surface);
+             gev->taps.fingers[fingers].enabled = EINA_TRUE;
+             break;
           }
      }
-   else if (!info->client)
-     {
-        info->client = client;
-        info->active = EINA_FALSE;
-        _e_gesture_deactivate_listener_add(client, surface);
-     }
-   else
-     {
-        GTWRN("Failed to deactivate %s !(request surface: %p, client: %p), already deactivated client: %p\n",
-              _e_gesture_util_type_to_string(type), surface, client, info->client);
-        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
-     }
+   gev->taps.fingers[fingers].max_repeats = e_gesture_util_tap_max_repeats_get(fingers);
+
+   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_TAP, fingers, 0, repeats, 0, 0);
+   _e_gesture_tap_current_list_check();
 
    return ret;
 }
 
 static int
-_e_gesture_deactivate_set(struct wl_client *client,
-                        struct wl_resource *resource,
-                        struct wl_resource *surface,
-                        uint32_t type)
+_e_gesture_grab_pan(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
 {
+   E_Gesture_Event *gev;
    int ret = TIZEN_GESTURE_ERROR_NONE;
 
-   if (type & E_GESTURE_TYPE_EDGE_SWIPE)
-     {
-        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
-     }
-   if (type & E_GESTURE_TYPE_TAP)
-     {
-        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
-     }
-   if (type & E_GESTURE_TYPE_PALM_COVER)
-     {
-        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
-     }
-   if (type & E_GESTURE_TYPE_PAN)
+   GTINF("The client %p request to grab pan gesture, fingers: %d\n", client, fingers);
+
+   if (fingers > E_GESTURE_FINGER_MAX)
      {
-        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
+        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        goto finish;
      }
-   if (type & E_GESTURE_TYPE_PINCH)
+
+   gev = &gesture->gesture_events;
+
+   if (gev->pans.fingers[fingers].client)
      {
-        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
+        GTWRN("%d finger is already grabbed by %p client\n", fingers, gev->pans.fingers[fingers].client);
+        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
+        goto finish;
      }
 
+   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_PAN, fingers, 0, 0, 0, 0);
+
+   gev->pans.fingers[fingers].client = client;
+   gev->pans.fingers[fingers].res = resource;
+   gev->pans.state = E_GESTURE_PANPINCH_STATE_READY;
+
+   gesture->grabbed_gesture |= E_GESTURE_TYPE_PAN;
+   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
+
+finish:
    return ret;
 }
 
 static int
-_e_gesture_deactivate_unset(struct wl_client *client,
-                          struct wl_resource *resource,
-                          struct wl_resource *surface,
-                          uint32_t type)
+_e_gesture_ungrab_pan(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
 {
+   E_Gesture_Event *gev;
    int ret = TIZEN_GESTURE_ERROR_NONE;
 
-   if (type & E_GESTURE_TYPE_EDGE_SWIPE)
-     {
-        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
-     }
-   if (type & E_GESTURE_TYPE_TAP)
-     {
-        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
-     }
-   if (type & E_GESTURE_TYPE_PALM_COVER)
-     {
-        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
-     }
-   if (type & E_GESTURE_TYPE_PAN)
+   GTINF("The client %p request to ungrab pan gesture, fingers: %d\n", client, fingers);
+
+   if (fingers > E_GESTURE_FINGER_MAX)
      {
-        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
+        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        goto finish;
      }
-   if (type & E_GESTURE_TYPE_PINCH)
+
+   gev = &gesture->gesture_events;
+
+   if (gev->pans.fingers[fingers].client == client)
      {
-        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
+        gev->pans.fingers[fingers].client = NULL;
+        gev->pans.fingers[fingers].res = NULL;
      }
 
+   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_PAN, fingers, 0, 0, 0, 0);
+   _e_gesture_pan_current_list_check();
+
+finish:
    return ret;
 }
 
-static void
-_e_gesture_cb_grab_edge_swipe(struct wl_client *client,
-                   struct wl_resource *resource,
-                   uint32_t fingers, uint32_t edge, uint32_t edge_size,
-                   uint32_t start_point, uint32_t end_point)
+static int
+_e_gesture_grab_pinch(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
 {
    E_Gesture_Event *gev;
-   int sp = 0, ep = 0;
-   unsigned int ret = TIZEN_GESTURE_ERROR_NONE;
-   E_Gesture_Conf_Edd *conf = gesture->config->conf;
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   GTINF("The client %p request to grab pinch gesture, fingers: %d\n", client, fingers);
 
-   GTINF("client %p is request grab gesture, fingers: %d, edge: 0x%x, edge_size: %d, point( %d - %d)\n", client, fingers, edge, edge_size, start_point, end_point);
    if (fingers > E_GESTURE_FINGER_MAX)
      {
         GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
         ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
+        goto finish;
      }
 
    gev = &gesture->gesture_events;
 
-   if (edge < TIZEN_GESTURE_EDGE_TOP || edge > TIZEN_GESTURE_EDGE_LEFT)
+   if (gev->pinchs.fingers[fingers].client)
      {
-        GTWRN("Invalid edge(%d)\n", edge);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
+        GTWRN("%d finger is already grabbed by %p client\n", fingers, gev->pinchs.fingers[fingers].client);
+        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
+        goto finish;
      }
 
-   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
-     {
-        sp = start_point;
-        ep = end_point;
-        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
-            (ep > e_comp->w))
-          ep = e_comp->w;
-        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
-                 (ep > e_comp->h))
-          ep = e_comp->h;
-     }
-   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
-     {
-        sp = 0;
-        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
-          ep = e_comp->w;
-        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
-          ep = e_comp->h;
-     }
-   else
-     {
-        GTWRN("Invalid edge_size(%d)\n", edge_size);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
-     }
+   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_PINCH, fingers, 0, 0, 0, 0);
 
-   if ((conf->edge_swipe.default_enable_back) &&
-       (edge == E_GESTURE_EDGE_TOP))
-     {
-        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
-     }
-   else if (_e_gesture_edge_boundary_check(&gev->edge_swipes.base.fingers[fingers], edge, sp, ep))
-     {
-        _e_gesture_edge_grab_add(&gev->edge_swipes.base.fingers[fingers], client, resource, edge, sp, ep);
+   gev->pinchs.fingers[fingers].client = client;
+   gev->pinchs.fingers[fingers].res = resource;
 
-        e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_SWIPE, fingers, edge, 0, sp, ep);
+   gev->pinchs.state = E_GESTURE_PANPINCH_STATE_READY;
+   gesture->grabbed_gesture |= E_GESTURE_TYPE_PINCH;
+   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
 
-        gesture->grabbed_gesture |= E_GESTURE_TYPE_EDGE_SWIPE;
-        gev->edge_swipes.base.fingers[fingers].enabled = EINA_TRUE;
-        if (gev->event_keep) gesture->event_state = E_GESTURE_EVENT_STATE_KEEP;
-        gev->edge_swipes.base.enabled_edge |= (1 << edge);
+finish:
+   return ret;
+}
 
-        ret = TIZEN_GESTURE_ERROR_NONE;
+static int
+_e_gesture_ungrab_pinch(struct wl_client *client, struct wl_resource *resource, uint32_t fingers)
+{
+   E_Gesture_Event *gev;
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   GTINF("The client %p request to ungrab pinch gesture, fingers: %d\n", client, fingers);
+
+   if (fingers > E_GESTURE_FINGER_MAX)
+     {
+        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
+        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
+        goto finish;
      }
-   else
+
+   gev = &gesture->gesture_events;
+
+   if (gev->pinchs.fingers[fingers].client == client)
      {
-        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
+        gev->pinchs.fingers[fingers].client = NULL;
+        gev->pinchs.fingers[fingers].res = NULL;
      }
 
-out:
-   tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, edge_size, start_point, end_point, ret);
-   return;
+   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_PINCH, fingers, 0, 0, 0, 0);
+   _e_gesture_pinch_current_list_check();
+
+finish:
+   return ret;
 }
 
-static Eina_Bool
-_e_gesture_edge_grabbed_client_check(struct wl_client *client)
+static int
+_e_gesture_grab_palm_cover(struct wl_client *client, struct wl_resource *resource)
 {
-   Eina_List *l;
    E_Gesture_Event *gev;
-   int i, j;
-   E_Gesture_Event_Edge_Finger_Edge *edata;
+   int ret = TIZEN_GESTURE_ERROR_NONE;
 
    gev = &gesture->gesture_events;
 
-   for (i = 1; i < E_GESTURE_FINGER_MAX + 1; i++)
+   GTINF("The client %p request to grab palm hover gesture\n", client);
+
+   if (gev->palm_covers.client_info.client)
      {
-        for (j = 1; j < E_GESTURE_EDGE_MAX + 1; j++)
-          {
-             EINA_LIST_FOREACH(gev->edge_swipes.base.fingers[i].edge[j], l, edata)
-               {
-                  if (edata->client == client) return EINA_TRUE;
-               }
-          }
+        GTWRN("Palm hover is already grabbed by %p client\n", gev->palm_covers.client_info.client);
+        goto finish;
      }
-   return EINA_FALSE;
+
+   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_PALM_COVER, 0, 0, 0, 0, 0);
+
+   gev->palm_covers.client_info.client = client;
+   gev->palm_covers.client_info.res = resource;
+
+   gesture->grabbed_gesture |= E_GESTURE_TYPE_PALM_COVER;
+   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
+
+finish:
+   return ret;
 }
 
-static void
-_e_gesture_cb_ungrab_edge_swipe(struct wl_client *client,
-                           struct wl_resource *resouce,
-                           uint32_t fingers, uint32_t edge, uint32_t edge_size,
-                           uint32_t start_point, uint32_t end_point)
+static int
+_e_gesture_ungrab_palm_cover(struct wl_client *client, struct wl_resource *resource)
 {
    E_Gesture_Event *gev;
    int ret = TIZEN_GESTURE_ERROR_NONE;
-   int i;
-   Eina_List *l, *l_next;
-   E_Gesture_Event_Edge_Finger_Edge *edata;
-   Eina_Bool flag_removed = EINA_FALSE;
-   int sp = 0, ep = 0;
-
-   GTINF("client %p is request ungrab edge swipe gesture, fingers: %d, edge: 0x%x, edge_size: %d, (%d ~ %d)\n", client, fingers, edge, edge_size, start_point, end_point);
 
-   if (fingers > E_GESTURE_FINGER_MAX)
-     {
-        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto notify;
-     }
+   GTINF("The client %p request to ungrab palm hover gesture\n", client);
 
    gev = &gesture->gesture_events;
 
-   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
-     {
-        sp = start_point;
-        ep = end_point;
-        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
-            (ep > e_comp->w))
-          ep = e_comp->w;
-        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
-                 (ep > e_comp->h))
-          ep = e_comp->h;
-     }
-   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
-     {
-        sp = 0;
-        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
-          ep = e_comp->w;
-        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
-          ep = e_comp->h;
-     }
-   else
+   if (gev->palm_covers.client_info.client == client)
      {
-        GTWRN("Invalid edge_size(%d)\n", edge_size);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto notify;
+        gev->palm_covers.client_info.client = NULL;
+        gev->palm_covers.client_info.client = NULL;
      }
 
-   EINA_LIST_FOREACH_SAFE(gev->edge_swipes.base.fingers[fingers].edge[edge], l, l_next, edata)
+   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_PALM_COVER, 0, 0, 0, 0, 0);
+   gesture->grabbed_gesture &= ~E_GESTURE_TYPE_PALM_COVER;
+   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
+
+   return ret;
+}
+
+static int
+_e_gesture_select_palm_cover(struct wl_client *client, struct wl_resource *resource,
+                             struct wl_resource *surface)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+   Eina_List *l;
+   E_Gesture_Event_Palm_Cover *palm_covers = &gesture->gesture_events.palm_covers;
+   E_Gesture_Select_Surface *sdata;
+
+   EINA_LIST_FOREACH(palm_covers->select_surface_list, l, sdata)
      {
-        if ((edata->client == client) && (edata->sp == sp) && (edata->ep == ep))
+        if (sdata->surface == surface)
           {
-             gev->edge_swipes.base.fingers[fingers].edge[edge] = eina_list_remove_list(
-                gev->edge_swipes.base.fingers[fingers].edge[edge], l);
-             E_FREE(edata);
-             flag_removed = EINA_TRUE;
+             ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
+             goto out;
           }
      }
 
-   if (flag_removed)
+   sdata = E_NEW(E_Gesture_Select_Surface, 1);
+   if (!sdata)
      {
-        if (!_e_gesture_edge_grabbed_client_check(client))
-          {
-             _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_SWIPE, fingers, edge, 0, sp, ep);
-             _e_gesture_edge_swipe_current_list_check();
-          }
+        ret = TIZEN_GESTURE_ERROR_NO_SYSTEM_RESOURCES;
+        goto out;
      }
 
-   gev->edge_swipes.base.enabled_edge &= ~( 1 << edge);
-   for (i = 0; i < E_GESTURE_FINGER_MAX+1; i++)
+   sdata->surface = surface;
+   sdata->res = resource;
+
+   palm_covers->select_surface_list = eina_list_append(palm_covers->select_surface_list, sdata);
+
+   _e_gesture_add_surface_destroy_listener(surface, E_GESTURE_TYPE_PALM_COVER);
+
+out:
+   return ret;
+}
+
+static int
+_e_gesture_deselect_palm_cover(struct wl_client *client, struct wl_resource *resource,
+                             struct wl_resource *surface)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+   Eina_List *l, *l_next;
+   E_Gesture_Event_Palm_Cover *palm_covers = &gesture->gesture_events.palm_covers;
+   E_Gesture_Select_Surface *sdata;
+
+   EINA_LIST_FOREACH_SAFE(palm_covers->select_surface_list, l, l_next, sdata)
      {
-        if (eina_list_count(gev->edge_swipes.base.fingers[i].edge[edge]) > 0)
+        if (sdata->surface == surface)
           {
-             gev->edge_swipes.base.enabled_edge |= (1 << edge);
+             palm_covers->select_surface_list = eina_list_remove_list(palm_covers->select_surface_list, l);
+             E_FREE(sdata);
              break;
           }
      }
 
-notify:
-   tizen_gesture_send_grab_edge_swipe_notify(resouce, fingers, edge, edge_size, start_point, end_point, ret);
-   return;
+   _e_gesture_remove_surface_destroy_listener(surface, E_GESTURE_TYPE_PALM_COVER);
+
+   return ret;
 }
 
 static int
-_e_gesture_grab_edge_drag(struct wl_client *client,
-                          struct wl_resource *resource,
-                          uint32_t fingers, uint32_t edge, uint32_t edge_size,
-                          uint32_t start_point, uint32_t end_point)
+_e_gesture_server_grab_edge_swipe(unsigned int fingers,
+                                  unsigned int edge, unsigned int edge_size,
+                                  unsigned int start_point, unsigned int end_point)
 {
-   E_Gesture_Event *gev;
-   int sp = 0, ep = 0;
    int ret = TIZEN_GESTURE_ERROR_NONE;
 
-   GTINF("client %p is request edge_drag grab, fingers: %d, edge: 0x%x, edge_size: %d, point( %d - %d)\n", client, fingers, edge, edge_size, start_point, end_point);
-   if (fingers > E_GESTURE_FINGER_MAX)
+   ret = _e_gesture_grab_edge_swipe(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT,
+                                    fingers, edge, edge_size, start_point, end_point);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_ungrab_edge_swipe(unsigned int fingers,
+                                    unsigned int edge, unsigned int edge_size,
+                                    unsigned int start_point, unsigned int end_point)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_ungrab_edge_swipe(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers, edge, edge_size, start_point, end_point);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_grab_edge_drag(unsigned int fingers,
+                        unsigned int edge, unsigned int edge_size,
+                        unsigned int start_point, unsigned int end_point)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_grab_edge_drag(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers, edge, edge_size, start_point, end_point);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_ungrab_edge_drag(unsigned int fingers, unsigned int edge, unsigned int edge_size,
+                          unsigned int start_point, unsigned int end_point)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_ungrab_edge_drag(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers, edge, edge_size, start_point, end_point);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_grab_tap(unsigned int fingers, unsigned int repeats)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_grab_tap(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers, repeats);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_ungrab_tap(unsigned int fingers, unsigned int repeats)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_ungrab_tap(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers, repeats);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_grab_palm_cover(void)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_grab_palm_cover(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_ungrab_palm_cover(void)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_ungrab_palm_cover(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_grab_pan(unsigned int fingers)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_grab_pan(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_ungrab_pan(unsigned int fingers)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_ungrab_pan(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_grab_pinch(unsigned int fingers)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_grab_pinch(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers);
+
+   return ret;
+}
+
+static int
+_e_gesture_server_ungrab_pinch(unsigned int fingers)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_ungrab_pinch(E_GESTURE_SERVER_CLIENT, E_GESTURE_SERVER_CLIENT, fingers);
+
+   return ret;
+}
+
+static Eina_Bool
+_e_gesture_deactivate_find_surface(Eina_List *list, struct wl_resource *surface)
+{
+   Eina_List *l;
+   E_Gesture_Activate_Surface_Info *idata;
+
+   EINA_LIST_FOREACH(list, l, idata)
      {
-        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
+        if (surface == idata->surface)
+          {
+             return EINA_TRUE;
+          }
      }
+   return EINA_FALSE;
+}
 
-   if (edge < TIZEN_GESTURE_EDGE_TOP || edge > TIZEN_GESTURE_EDGE_LEFT)
+static void
+_e_gesture_deactivate_list_unset(struct wl_client *client, struct wl_resource *surface, E_Gesture_Activate_Info *info, unsigned int type)
+{
+   Eina_List *l, *l_next;
+   struct wl_resource *surface_data;
+
+   if (surface)
      {
-        GTWRN("Invalid edge(%d)\n", edge);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
+        EINA_LIST_FOREACH_SAFE(info->surfaces, l, l_next, surface_data)
+          {
+             if (surface_data == surface)
+               {
+                  info->surfaces = eina_list_remove_list(info->surfaces, l);
+                  break;
+               }
+          }
      }
+   else if (info->client && (info->client == client))
+     {
+        info->client = NULL;
+        info->active = EINA_TRUE;
+     }
+   else
+     {
+        GTWRN("Failed to unset %s deactivate. surface: %p, client: %p (already deactivated client: %p)\n", _e_gesture_util_type_to_string(type), surface, client, info->client);
+     }
+}
 
-   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
+static void
+_e_gesture_deactivate_cb_client_listener(struct wl_listener *l, void *data)
+{
+   struct wl_client *client = data;
+
+   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
+   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
+   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
+   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
+   _e_gesture_deactivate_list_unset(client, NULL, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
+
+   wl_list_remove(&l->link);
+   E_FREE(l);
+}
+
+static void
+_e_gesture_deactivate_cb_surface_listener(struct wl_listener *l, void *data)
+{
+   struct wl_resource *surface = data;
+
+   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
+   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
+   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
+   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
+   _e_gesture_deactivate_list_unset(NULL, surface, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
+
+   wl_list_remove(&l->link);
+   E_FREE(l);
+}
+
+static int
+_e_gesture_deactivate_listener_add(struct wl_client *client, struct wl_resource * surface)
+{
+   struct wl_listener *destroy_listener = NULL;
+
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(client || surface, TIZEN_GESTURE_ERROR_INVALID_DATA);
+
+   destroy_listener = E_NEW(struct wl_listener, 1);
+   if (!destroy_listener)
      {
-        sp = start_point;
-        ep = end_point;
-        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
-            (ep > e_comp->w))
-          ep = e_comp->w;
-        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
-                 (ep > e_comp->h))
-          ep = e_comp->h;
+        GTERR("Failed to allocate memory for deactivate destroy listener !\n");
+        return TIZEN_GESTURE_ERROR_NO_SYSTEM_RESOURCES;
      }
-   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
+
+   if (surface)
      {
-        sp = 0;
-        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
-          ep = e_comp->w;
-        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
-          ep = e_comp->h;
+        destroy_listener->notify = _e_gesture_deactivate_cb_surface_listener;
+        wl_resource_add_destroy_listener(surface, destroy_listener);
      }
    else
      {
-        GTWRN("Invalid edge_size(%d)\n", edge_size);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
+        destroy_listener->notify = _e_gesture_deactivate_cb_client_listener;
+        wl_client_add_destroy_listener(client, destroy_listener);
      }
 
-   gev = &gesture->gesture_events;
-
-   if (_e_gesture_edge_boundary_check(&gev->edge_drags.base.fingers[fingers], edge, sp, ep))
-     {
-        _e_gesture_edge_grab_add(&gev->edge_drags.base.fingers[fingers], client, resource, edge, sp, ep);
-
-        e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_DRAG, fingers, edge, 0, sp, ep);
+   return TIZEN_GESTURE_ERROR_NONE;
+}
 
-        gesture->grabbed_gesture |= E_GESTURE_TYPE_EDGE_DRAG;
-        gev->edge_drags.base.fingers[fingers].enabled = EINA_TRUE;
-        if (gev->event_keep) gesture->event_state = E_GESTURE_EVENT_STATE_KEEP;
-        gev->edge_drags.base.enabled_edge |= (1 << edge);
+static int
+_e_gesture_deactivate_list_set(struct wl_client *client, struct wl_resource *surface, E_Gesture_Activate_Info *info, unsigned int type)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
 
-        ret = TIZEN_GESTURE_ERROR_NONE;
+   if (surface)
+     {
+        if (!_e_gesture_deactivate_find_surface(info->surfaces, surface))
+          {
+             info->surfaces = eina_list_append(info->surfaces, surface);
+             _e_gesture_deactivate_listener_add(client, surface);
+          }
+     }
+   else if (!info->client)
+     {
+        info->client = client;
+        info->active = EINA_FALSE;
+        _e_gesture_deactivate_listener_add(client, surface);
      }
    else
      {
+        GTWRN("Failed to deactivate %s !(request surface: %p, client: %p), already deactivated client: %p\n",
+              _e_gesture_util_type_to_string(type), surface, client, info->client);
         ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
      }
 
-out:
    return ret;
 }
 
 static int
-_e_gesture_ungrab_edge_drag(struct wl_client *client,
-                       struct wl_resource *resouce,
-                       uint32_t fingers, uint32_t edge, uint32_t edge_size,
-                       uint32_t start_point, uint32_t end_point)
+_e_gesture_deactivate_set(struct wl_client *client,
+                        struct wl_resource *resource,
+                        struct wl_resource *surface,
+                        uint32_t type)
 {
-   E_Gesture_Event *gev;
    int ret = TIZEN_GESTURE_ERROR_NONE;
-   int i;
-   Eina_List *l, *l_next;
-   E_Gesture_Event_Edge_Finger_Edge *edata;
-   Eina_Bool flag_removed = EINA_FALSE;
-   int sp = 0, ep = 0;
-
-   GTINF("client %p is request ungrab edge drag gesture, fingers: %d, edge: 0x%x, edge_size: %d, (%d ~ %d)\n", client, fingers, edge, edge_size, start_point, end_point);
 
-   if (fingers > E_GESTURE_FINGER_MAX)
+   if (type & E_GESTURE_TYPE_EDGE_SWIPE)
      {
-        GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
+        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
      }
-
-   if (edge_size == TIZEN_GESTURE_EDGE_SIZE_PARTIAL)
+   if (type & E_GESTURE_TYPE_TAP)
      {
-        sp = start_point;
-        ep = end_point;
-        if (((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM)) &&
-            (ep > e_comp->w))
-          ep = e_comp->w;
-        else if (((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT)) &&
-                 (ep > e_comp->h))
-          ep = e_comp->h;
+        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
      }
-   else if (edge_size == TIZEN_GESTURE_EDGE_SIZE_FULL)
+   if (type & E_GESTURE_TYPE_PALM_COVER)
      {
-        sp = 0;
-        if ((edge == TIZEN_GESTURE_EDGE_TOP) || (edge == TIZEN_GESTURE_EDGE_BOTTOM))
-          ep = e_comp->w;
-        else if ((edge == TIZEN_GESTURE_EDGE_RIGHT) || (edge == TIZEN_GESTURE_EDGE_LEFT))
-          ep = e_comp->h;
+        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
      }
-   else
+   if (type & E_GESTURE_TYPE_PAN)
      {
-        GTWRN("Invalid edge_size(%d)\n", edge_size);
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto out;
+        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
+     }
+   if (type & E_GESTURE_TYPE_PINCH)
+     {
+        ret = _e_gesture_deactivate_list_set(client, surface, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
      }
 
-   gev = &gesture->gesture_events;
+   return ret;
+}
 
-   EINA_LIST_FOREACH_SAFE(gev->edge_drags.base.fingers[fingers].edge[edge], l, l_next, edata)
+static int
+_e_gesture_deactivate_unset(struct wl_client *client,
+                          struct wl_resource *resource,
+                          struct wl_resource *surface,
+                          uint32_t type)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   if (type & E_GESTURE_TYPE_EDGE_SWIPE)
      {
-        if ((edata->client == client) && (edata->sp == sp) && (edata->ep == ep))
-          {
-             gev->edge_drags.base.fingers[fingers].edge[edge] = eina_list_remove_list(
-                gev->edge_drags.base.fingers[fingers].edge[edge], l);
-             E_FREE(edata);
-             flag_removed = EINA_TRUE;
-          }
+        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.edge_swipes.base.activation, E_GESTURE_TYPE_EDGE_SWIPE);
      }
-
-   if (flag_removed)
+   if (type & E_GESTURE_TYPE_TAP)
      {
-        if (!_e_gesture_edge_grabbed_client_check(client))
-          {
-             _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_EDGE_DRAG, fingers, edge, 0, sp, ep);
-             _e_gesture_edge_drag_current_list_check();
-          }
+        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.taps.activation, E_GESTURE_TYPE_TAP);
      }
-
-   gev->edge_drags.base.enabled_edge &= ~( 1 << edge);
-   for (i = 0; i < E_GESTURE_FINGER_MAX+1; i++)
+   if (type & E_GESTURE_TYPE_PALM_COVER)
      {
-        if (eina_list_count(gev->edge_drags.base.fingers[i].edge[edge]) > 0)
-          {
-             gev->edge_drags.base.enabled_edge |= (1 << edge);
-             break;
-          }
+        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.palm_covers.activation, E_GESTURE_TYPE_PALM_COVER);
+     }
+   if (type & E_GESTURE_TYPE_PAN)
+     {
+        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.pans.activation, E_GESTURE_TYPE_PAN);
+     }
+   if (type & E_GESTURE_TYPE_PINCH)
+     {
+        _e_gesture_deactivate_list_unset(client, surface, &gesture->gesture_events.pinchs.activation, E_GESTURE_TYPE_PINCH);
      }
 
-out:
    return ret;
 }
 
+static void
+_e_gesture_cb_grab_edge_swipe(struct wl_client *client,
+                   struct wl_resource *resource,
+                   uint32_t fingers, uint32_t edge, uint32_t edge_size,
+                   uint32_t start_point, uint32_t end_point)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_grab_edge_swipe(client, resource, fingers, edge, edge_size, start_point, end_point);
+
+   tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, edge_size, start_point, end_point, ret);
+}
+
+static void
+_e_gesture_cb_ungrab_edge_swipe(struct wl_client *client,
+                           struct wl_resource *resource,
+                           uint32_t fingers, uint32_t edge, uint32_t edge_size,
+                           uint32_t start_point, uint32_t end_point)
+{
+   int ret = TIZEN_GESTURE_ERROR_NONE;
+
+   ret = _e_gesture_ungrab_edge_swipe(client, resource, fingers, edge, edge_size, start_point, end_point);
+
+   tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, edge_size, start_point, end_point, ret);
+}
 
 static void
 _e_gesture_cb_grab_edge_drag(struct wl_client *client,
@@ -1230,44 +1466,10 @@ _e_gesture_cb_grab_tap(struct wl_client *client,
                    struct wl_resource *resource,
                    uint32_t fingers, uint32_t repeats)
 {
-   E_Gesture_Event *gev;
    int ret = TIZEN_GESTURE_ERROR_NONE;
 
-   GTINF("client %p requested to grab tap gesture (fingers: %d, repeats: %d)\n", client, fingers, repeats);
-
-   if (fingers > E_GESTURE_FINGER_MAX || repeats > E_GESTURE_TAP_REPEATS_MAX)
-     {
-        GTWRN("Not supported fingers /repeats bigger than their maximum values\n");
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto finish;
-     }
-
-   gev = &gesture->gesture_events;
-
-   if (gev->taps.fingers[fingers].repeats[repeats].client)
-     {
-        GTWRN("%d finger %d repeats is already grabbed by %p client\n", fingers, repeats, gev->taps.fingers[fingers].repeats[repeats].client);
-        ret = TIZEN_GESTURE_ERROR_GRABBED_ALREADY;
-        goto finish;
-     }
-
-   gev->taps.fingers[fingers].repeats[repeats].client = client;
-   gev->taps.fingers[fingers].repeats[repeats].res = resource;
-   gev->taps.fingers[fingers].enabled = EINA_TRUE;
-
-   e_gesture_add_client_destroy_listener(client, E_GESTURE_TYPE_TAP, fingers, 0, repeats, 0, 0);
-
-   if (gev->taps.max_fingers < fingers)
-     gev->taps.max_fingers = fingers;
-   if (gev->taps.fingers[fingers].max_repeats < repeats)
-     gev->taps.fingers[fingers].max_repeats = repeats;
-
-   gesture->grabbed_gesture |= E_GESTURE_TYPE_TAP;
-   gev->taps.state = E_GESTURE_TAP_STATE_READY;
-   gesture->event_state = E_GESTURE_EVENT_STATE_KEEP;
-   gesture->gesture_filter = E_GESTURE_TYPE_ALL & ~gesture->grabbed_gesture;
+   ret = _e_gesture_grab_tap(client, resource, fingers, repeats);
 
-finish:
    tizen_gesture_send_tap_notify(resource, fingers, repeats, ret);
 }
 
@@ -1276,42 +1478,10 @@ _e_gesture_cb_ungrab_tap(struct wl_client *client,
                    struct wl_resource *resource,
                    uint32_t fingers, uint32_t repeats)
 {
-   int i;
-   E_Gesture_Event *gev;
    int ret = TIZEN_GESTURE_ERROR_NONE;
 
-   GTINF("client %p requested to ungrab tap gesture (fingers: %d, repeats: %d)\n", client, fingers, fingers);
-
-   if (fingers > E_GESTURE_FINGER_MAX || repeats > E_GESTURE_TAP_REPEATS_MAX)
-     {
-        GTWRN("Not supported fingers /repeats bigger than their maximum values\n");
-        ret = TIZEN_GESTURE_ERROR_INVALID_DATA;
-        goto finish;
-     }
-
-   gev = &gesture->gesture_events;
-
-   if (gev->taps.fingers[fingers].repeats[repeats].client == client)
-     {
-        gev->taps.fingers[fingers].repeats[repeats].client = NULL;
-        gev->taps.fingers[fingers].repeats[repeats].res = NULL;
-     }
-
-   gev->taps.fingers[fingers].enabled = EINA_FALSE;
-   for (i = 0; i < E_GESTURE_TAP_REPEATS_MAX; i++)
-     {
-        if (gev->taps.fingers[fingers].repeats[i].client)
-          {
-             gev->taps.fingers[fingers].enabled = EINA_TRUE;
-             break;
-          }
-     }
-   gev->taps.fingers[fingers].max_repeats = e_gesture_util_tap_max_repeats_get(fingers);
-
-   _e_gesture_remove_client_destroy_listener(client, E_GESTURE_TYPE_TAP, fingers, 0, repeats, 0, 0);
-   _e_gesture_tap_current_list_check();
+   ret = _e_gesture_ungrab_tap(client, resource, fingers, repeats);
 
-finish:
    tizen_gesture_send_tap_notify(resource, fingers, repeats, ret);
 }
 
@@ -1562,6 +1732,22 @@ _e_gesture_init_handlers(void)
    gesture->hooks = eina_list_append(gesture->hooks,
                                      e_client_hook_add(E_CLIENT_HOOK_AUX_HINT_CHANGE,
                                                        _e_gesture_cb_aux_hint_change, NULL));
+
+   if (e_gesture)
+     {
+        e_gesture->edge_swipe.grab = _e_gesture_server_grab_edge_swipe;
+        e_gesture->edge_swipe.ungrab = _e_gesture_server_ungrab_edge_swipe;
+        e_gesture->edge_drag.grab = _e_gesture_server_grab_edge_drag;
+        e_gesture->edge_drag.ungrab = _e_gesture_server_ungrab_edge_drag;
+        e_gesture->tap.grab = _e_gesture_server_grab_tap;
+        e_gesture->tap.ungrab = _e_gesture_server_ungrab_tap;
+        e_gesture->palm_cover.grab = _e_gesture_server_grab_palm_cover;
+        e_gesture->palm_cover.ungrab = _e_gesture_server_ungrab_palm_cover;
+        e_gesture->pan.grab = _e_gesture_server_grab_pan;
+        e_gesture->pan.ungrab = _e_gesture_server_ungrab_pan;
+        e_gesture->pinch.grab = _e_gesture_server_grab_pinch;
+        e_gesture->pinch.ungrab = _e_gesture_server_ungrab_pinch;
+     }
 }
 
 static void
@@ -1581,6 +1767,21 @@ _e_gesture_deinit_handlers(void)
      {
         e_client_hook_del(hook);
      }
+   if (e_gesture)
+     {
+        e_gesture->edge_swipe.grab = NULL;
+        e_gesture->edge_swipe.ungrab = NULL;
+        e_gesture->edge_drag.grab = NULL;
+        e_gesture->edge_drag.ungrab = NULL;
+        e_gesture->tap.grab = NULL;
+        e_gesture->tap.ungrab = NULL;
+        e_gesture->palm_cover.grab = NULL;
+        e_gesture->palm_cover.ungrab = NULL;
+        e_gesture->pan.grab = NULL;
+        e_gesture->pan.ungrab = NULL;
+        e_gesture->pinch.grab = NULL;
+        e_gesture->pinch.ungrab = NULL;
+     }
 }
 
 static E_Gesture_Config_Data *
index 07cf14f..890c9f2 100644 (file)
@@ -11,6 +11,8 @@
 #define GTINF(msg, ARG...) INF("[tizen_gesture][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
 #define GTDBG(msg, ARG...) DBG("[tizen_gesture][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
 
+#define E_GESTURE_SERVER_CLIENT (void *)0x1
+
 #define E_GESTURE_TYPE_EDGE_SWIPE TIZEN_GESTURE_TYPE_EDGE_SWIPE
 #define E_GESTURE_TYPE_EDGE_DRAG TIZEN_GESTURE_TYPE_EDGE_DRAG
 #define E_GESTURE_TYPE_TAP TIZEN_GESTURE_TYPE_TAP
@@ -54,7 +56,6 @@
 #define E_GESTURE_PINCH_MOVING_DISTANCE_RANGE 15.0
 
 #define ABS(x) (((x)>0)?(x):-(x))
-
 #define RAD2DEG(x) ((x) * 57.295779513)
 
 typedef struct _E_Gesture E_Gesture;
@@ -97,14 +98,6 @@ extern E_GesturePtr gesture;
 
 #define E_GESTURE_EDGE_MAX 4
 
-enum _E_Gesture_Edge
-{
-   E_GESTURE_EDGE_NONE,
-   E_GESTURE_EDGE_TOP,
-   E_GESTURE_EDGE_RIGHT,
-   E_GESTURE_EDGE_BOTTOM,
-   E_GESTURE_EDGE_LEFT,
-};
 #define E_GESTURE_EDGE_ALL ((1 << E_GESTURE_EDGE_TOP) | (1 << E_GESTURE_EDGE_RIGHT) | (1 << E_GESTURE_EDGE_BOTTOM) | (1 << E_GESTURE_EDGE_LEFT))
 
 enum _E_Gesture_Event_State