[ACR-1004][efl-util] Add new api guide for global gesture 63/144763/8
authorJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 18 Aug 2017 00:29:07 +0000 (09:29 +0900)
committerEditor Lionbridge <TizenEditor.SEL@lionbridge.com>
Thu, 24 Aug 2017 05:07:09 +0000 (08:07 +0300)
PS2: Reviewed
PS5: New image and related text reviewed
PS7: Fixed typo in an image and reviewed the query answers

Change-Id: I1a1be1c9a55bd3c534f8c4abf48fa4f8523913fa

org.tizen.guides/html/images/efl_global_gesture_edge_drag.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_edge_swipe.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_event_propagate.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_life_cycle.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_palm_cover.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_palm_swipe.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_pan.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_pinch.png [new file with mode: 0644]
org.tizen.guides/html/images/efl_global_gesture_tap.png [new file with mode: 0644]
org.tizen.guides/html/native/ui/efl/efl_util_n.htm

diff --git a/org.tizen.guides/html/images/efl_global_gesture_edge_drag.png b/org.tizen.guides/html/images/efl_global_gesture_edge_drag.png
new file mode 100644 (file)
index 0000000..36989d8
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_edge_drag.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_edge_swipe.png b/org.tizen.guides/html/images/efl_global_gesture_edge_swipe.png
new file mode 100644 (file)
index 0000000..67e8fc6
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_edge_swipe.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_event_propagate.png b/org.tizen.guides/html/images/efl_global_gesture_event_propagate.png
new file mode 100644 (file)
index 0000000..0b31dfb
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_event_propagate.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_life_cycle.png b/org.tizen.guides/html/images/efl_global_gesture_life_cycle.png
new file mode 100644 (file)
index 0000000..07bad1a
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_life_cycle.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_palm_cover.png b/org.tizen.guides/html/images/efl_global_gesture_palm_cover.png
new file mode 100644 (file)
index 0000000..601f19e
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_palm_cover.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_palm_swipe.png b/org.tizen.guides/html/images/efl_global_gesture_palm_swipe.png
new file mode 100644 (file)
index 0000000..df4d570
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_palm_swipe.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_pan.png b/org.tizen.guides/html/images/efl_global_gesture_pan.png
new file mode 100644 (file)
index 0000000..0a48c5d
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_pan.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_pinch.png b/org.tizen.guides/html/images/efl_global_gesture_pinch.png
new file mode 100644 (file)
index 0000000..c80e6b6
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_pinch.png differ
diff --git a/org.tizen.guides/html/images/efl_global_gesture_tap.png b/org.tizen.guides/html/images/efl_global_gesture_tap.png
new file mode 100644 (file)
index 0000000..0de91fc
Binary files /dev/null and b/org.tizen.guides/html/images/efl_global_gesture_tap.png differ
index bb62a2d..65f4607 100644 (file)
        <p class="toc-title">Content</p>
          <ul class="toc">
                        <li><a href="#noti">Window Layers and Notification Levels</a></li>
+                       <li><a href="#global_gesture">Global Gestures</a></li>
                        <li><a href="#prerequisites">Prerequisites</a></li>
                        <li><a href="#notiwindows">Managing Notification Windows</a></li>
             <li><a href="#screenshot">Taking Screenshots</a></li>
             <li><a href="#input_gen_key">Generating Key Input Events</a></li>
             <li><a href="#input_gen_touch">Generating Touch Input Events</a></li>
+            <li>Gestures
+                <ul class="toc">
+                    <li><a href="#gesture_grab">Grabbing Gestures</a></li>
+                    <li><a href="#gesture_select">Selecting Gestures</a></li>
+                    <li><a href="#gesture_activate">Deactivating Gestures</a></li>
+                    <li><a href="#gesture_activate_with_win">Deactivating Gestures in a Window</a></li>
+                </ul>
+            </li>
                </ul>
                <p class="toc-title">Related Info</p>
                <ul class="toc">
@@ -55,7 +64,9 @@
     <li>Taking screenshots
 <p>You can <a href="#screenshot">capture screenshots</a> and store the screenshot data as a TBM surface, using the EFL UTIL SCREENSHOT API (for <a href="../../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__SCREENSHOT__MODULE.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/group__CAPI__EFL__UTIL__SCREENSHOT__MODULE.html">wearable</a> applications).</p></li>
     <li>Using the input generator
-<p>You can generate input events using the EFL UTIL INPUT API (for <a href="../../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__INPUT__MODULE.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/group__CAPI__EFL__UTIL__INPUT__MODULE.html">wearable</a> applications). You can generate <a href="#input_gen_key">key input events</a> that emulate various hardware key presses and <a href="#input_gen_touch">touch input events</a> that emulate screen touches.</p></li></ul>
+<p>You can generate input events using the EFL UTIL INPUT API (for <a href="../../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__INPUT__MODULE.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/group__CAPI__EFL__UTIL__INPUT__MODULE.html">wearable</a> applications). You can generate <a href="#input_gen_key">key input events</a> that emulate various hardware key presses and <a href="#input_gen_touch">touch input events</a> that emulate screen touches.</p></li>
+    <li>Handling global gestures
+<p>You can handle <a href="#global_gesture">global gestures</a> using the EFL UTIL GESTURE API (for <a href="../../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__GESTURE__MODULE.html">mobile</a> and <a href="../../../../../org.tizen.native.wearable.apireference/group__CAPI__EFL__UTIL__GESTURE__MODULE.html">wearable</a> applications). You can <a href="#gesture_grab">grab</a> and <a href="#gesture_activate">deactivate</a> global gestures, and <a href="#gesture_select">select</a> and <a href="#gesture_activate_with_win">deactivate</a> them in a window.</p></li></ul>
 
 <h2 id="noti">Window Layers and Notification Levels</h2>
 
 <p align="center"><strong>Figure: Notification levels</strong></p>
 <p align="center"><img alt="Notification levels" src="../../../images/efl_notilevels.png" /></p>
 
+<h2 id="global_gesture">Global Gestures</h2>
+
+<p>Normal touch events are delivered to the active, visible window. Global gestures intercept these touch events and generate gesture events instead of propagating the touch events. Gestures can be recognized and delivered in 2 ways:</p>
+<ul>
+<li>Touch cancel method
+    <p>The server sends all touch events to the client immediately. When the server recognizes a touch event sequence as a global gesture, it sends a touch cancel event to the client. Based on the touch cancel event, the client cancels the already-received touch events.</p></li>
+<li>Keep and drop method
+    <p>The server keeps all touch events until it can determine whether they form a global gesture sequence. If the touch events are recognized as a gesture, the server drops the touch events. If no gesture is recognized, the server flushes and propagates the touch events to the client.</p></li></ul>
+
+<p align="center"><strong>Figure: Global gesture event propagation methods</strong></p>
+<p align="center"><img alt="Global gesture event propagation methods" src="../../../images/efl_global_gesture_event_propagate.png" /></p>
+
+<p>After gesture recognition, the server sends no further touch events until all fingers are released. The server renews the gesture recognition state only after all fingers are released.</p>
+
+<p align="center"><strong>Figure: Global gesture life cycle</strong></p>
+<p align="center"><img alt="Global gesture life cycle" src="../../../images/efl_global_gesture_life_cycle.png" /></p>
+
+<p>Global gesture events are generated based on user touch behavior. Gestures have various states:</p>
+<ul>
+<li><code>EFL_UTIL_GESTURE_MODE_BEGIN</code>: Begin a continuous gesture event.</li>
+<li><code>EFL_UTIL_GESTURE_MODE_UPDATE</code>: Update a continuous gesture event.</li>
+<li><code>EFL_UTIL_GESTURE_MODE_END</code>: End a continuous gesture event.</li>
+<li><code>EFL_UTIL_GESTURE_MODE_DONE</code>: A non-continuous gesture event occurs.</li></ul>
+<p>Continuous gestures generate events in the begin, update, and end states, while non-continuous gestures generate events in the done state.</p>
+<p>You can implement the following gesture types:</p>
+<ul>
+<li id="gesture_edge_swipe"><code>EFL_UTIL_GESTURE_TYPE_EDGE_SWIPE</code>: The user touches near a screen edge and moves the finger quickly toward the opposite side. Edge swipe is a non-continuous gesture.
+
+<p align="center"><strong>Figure: Top edge 1-finger swipe gesture</strong></p>
+<p align="center"><img alt="Edge swipe gesture" src="../../../images/efl_global_gesture_edge_swipe.png" /></p>
+</li>
+<li id="gesture_edge_drag"><code>EFL_UTIL_GESTURE_TYPE_EDGE_DRAG</code>: The user touches near a screen edge and drags the finger toward the opposite side. Edge drag is a continuous gesture.
+
+<p align="center"><strong>Figure: Top edge 1-finger drag gesture</strong></p>
+<p align="center"><img alt="Edge drag gesture" src="../../../images/efl_global_gesture_edge_drag.png" /></p>
+</li>
+<li id="gesture_tap"><code>EFL_UTIL_GESTURE_TYPE_TAP</code>: The user touches the screen with their finger and quickly releases it. Tap is a non-continuous gesture.
+
+<p align="center"><strong>Figure: 2-finger double tap gesture</strong></p>
+<p align="center"><img alt="Tap gesture" src="../../../images/efl_global_gesture_tap.png" /></p>
+</li>
+<li id="gesture_palm_cover"><code>EFL_UTIL_GESTURE_TYPE_PALM_COVER</code>: The user places their palm over the screen. Palm cover is a continuous gesture.
+
+<p align="center"><strong>Figure: Palm cover gesture</strong></p>
+<p align="center"><img alt="Palm cover gesture" src="../../../images/efl_global_gesture_palm_cover.png" /></p>
+</li>
+<li id="gesture_pan"><code>EFL_UTIL_GESTURE_TYPE_PAN</code>: The user touches the screen with 2 or more fingers and moves them in the same direction. Pan is a continuous gesture.
+
+<p align="center"><strong>Figure: 2-finger pan gesture</strong></p>
+<p align="center"><img alt="Pan gesture" src="../../../images/efl_global_gesture_pan.png" /></p></li>
+<li id="gesture_pinch"><code>EFL_UTIL_GESTURE_TYPE_PINCH</code>: The user touches the screen with 2 or more fingers and moves the fingers away from or toward each other. Pinch is a continuous gesture.
+
+
+<p align="center"><strong>Figure: 2-finger pinch gesture</strong></p>
+<p align="center"><img alt="Pinch gesture" src="../../../images/efl_global_gesture_pinch.png" /></p>
+</li>
+<li id="gesture_palm_swipe"><code>EFL_UTIL_GESTURE_TYPE_PALM_SWIPE</code>: The user places their palm at a screen edge and swipes to the opposite side. Palm swipe is a non-continuous gesture.
+
+<p align="center"><strong>Figure: Palm swipe gesture</strong></p>
+<p align="center"><img alt="Palm swipe gesture" src="../../../images/efl_global_gesture_palm_swipe.png" /></p>
+</li>
+</ul>
 
 <h2 id="prerequisites">Prerequisites</h2>
 
@@ -316,6 +389,504 @@ touch_event_generator()
 }
 </pre></li></ol>
 
+<h2 id="gesture_grab">Grabbing Gestures</h2>
+
+<p>To receive global gesture events, you must grab the gestures that you want. You can grab gestures in the background (without a window). Each gesture can only be grabbed by 1 client at a time. For example, if a client grabs a 2-finger double tap gesture, other clients cannot grab the same gesture but can grab a 2-finger triple tap gesture. You can grab edge swipe, edge drag, tap, and palm cover gestures.</p>
+<p>To grab gestures:</p>
+
+ <ol>
+ <li>Create callbacks for gesture events:
+<pre class="prettyprint">
+/* EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE */
+Eina Bool
+_edge_swipe_cb(void *data, int type, void *event)
+{
+    efl_util_event_gesture_edge_swipe_s *ev;
+
+    ev = (efl_util_event_gesture_edge_swipe_s *)event;
+
+    printf("[Edge_Swipe] mode: %d, fingers: %d, start_point: (%d, %d), edge: %d\n",
+           ev->mode, ev->fingers, ev->sx, ev->sy, ev->edge);
+
+    return ECORE_CALLBACK_PASS_ON;
+}
+
+/* EFL_UTIL_EVENT_GESTURE_EDGE_DRAG */
+Eina Bool
+_edge_drag_cb(void *data, int type, void *event)
+{
+    efl_util_event_gesture_edge_drag_s *ev;
+
+    ev = (efl_util_event_gesture_edge_drag_s *)event;
+
+    printf("[Edge_Drag] mode: %d, fingers: %d, center_point: (%d, %d), edge: %d\n",
+           ev->mode, ev->fingers, ev->cx, ev->cy, ev->edge);
+
+    return ECORE_CALLBACK_PASS_ON;
+}
+
+/* EFL_UTIL_EVENT_GESTURE_TAP */
+Eina Bool
+_tap_cb(void *data, int type, void *event)
+{
+    efl_util_event_gesture_tap_s *ev;
+
+    ev = (efl_util_event_gesture_tap_s *)event;
+
+    printf("[Tap] mode: %d, fingers: %d, repeats: %d\n",
+           ev->mode, ev->fingers, ev->repeats);
+
+    return ECORE_CALLBACK_PASS_ON;
+}
+
+/* EFL_UTIL_EVENT_GESTURE_PALM_COVER */
+Eina Bool
+_palm_cover_cb(void *data, int type, void *event)
+{
+    efl_util_event_gesture_palm_cover_s *ev;
+
+    ev = (efl_util_event_gesture_palm_cover_s *)event;
+
+    printf("[Palm_Cover] mode: %d, duration: %d, center_point: (%d, %d), size: %d, pressure: %lf\n",
+           ev->mode, ev->duration, ev->cx, ev->cy, ev->size, ev->pressure);
+
+    return ECORE_CALLBACK_PASS_ON;
+}
+</pre></li>
+ <li>Create the <code>efl_util_gesture_h</code> structure and initialize the structure members with the <code>efl_util_gesture_initialize()</code> function:
+<pre class="prettyprint">
+void
+grab_gesture()
+{
+    int ret = EFL_UTIL_ERROR_NONE;
+    efl_util_gesture_h h_gesture = NULL;
+    efl_util_gesture_data d_edge_swipe = NULL;
+    efl_util_gesture_data d_edge_drag = NULL;
+    efl_util_gesture_data d_tap = NULL;
+    efl_util_gesture_data d_palm_cover = NULL;
+
+    /* Create a gesture handle */
+    h_gesture = efl_util_gesture_initialize();
+
+    if (!h_gesture) {
+        ret = get_last_result();
+        /* Failed to initialize the gesture system */
+
+        return;
+    }
+</pre></li>
+ <li>Define the gesture data to grab using the <code>efl_util_gesture_xxx_new()</code> and <code>efl_util_gesture_xxx_size_set()</code> functions.
+ <p>Setting a size is optional. If a size is not set, the gesture is grabbed within a full-size edge.</p>
+<pre class="prettyprint">
+    /* Define a top edge 1-finger swipe gesture */
+    d_edge_swipe = efl_util_gesture_edge_swipe_new(h_gesture, 1, EFL_UTIL_GESTURE_EDGE_TOP);
+    if (!d_edge_swipe) {
+        ret = get_last_result();
+        /* Failed to create edge swipe data */
+
+        return;
+    }
+    /* Set the size */
+    ret = efl_util_gesture_edge_swipe_size_set(d_edge_swipe, EFL_UTIL_GESTURE_EDGE_SIZE_PARTIAL, 0, 100);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to set size for edge swipe */
+
+        return;
+    }
+
+    /* Define a left edge 1-finger drag gesture */
+    d_edge_drag = efl_util_gesture_edge_drag_new(h_gesture, 1, EFL_UTIL_GESTURE_EDGE_LEFT);
+    if (!d_edge_drag) {
+        ret = get_last_result();
+        /* Failed to create edge drag data */
+
+        return;
+    }
+    /* Set the size */
+    ret = efl_util_gesture_edge_drag_size_set(d_edge_drag, EFL_UTIL_GESTURE_EDGE_SIZE_PARTIAL, 0, 100);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to set size for edge drag */
+
+        return;
+    }
+
+    /* Define a 2-finger double tap gesture */
+    d_tap = efl_util_gesture_tap_new(h_gesture, 2, 2);
+    if (!d_tap) {
+        ret = get_last_result();
+        /* Failed to create tap data */
+
+        return;
+    }
+
+    /* Define a palm cover gesture */
+    d_palm_cover = efl_util_gesture_palm_cover_new(h_gesture);
+    if (!d_palm_cover) {
+        ret = get_last_result();
+        /* Failed to create palm cover data */
+
+        return;
+    }
+</pre></li>
+ <li>To grab a gesture, use the <code>efl_util_gesture_grab()</code> function:
+<pre class="prettyprint">
+    /* Select the gesture you want to grab */
+    ret = efl_util_gesture_grab(h_gesture, d_edge_swipe);
+    /*
+        You can grab multiple gestures:
+        ret = efl_util_gesture_grab(h_gesture, d_edge_drag);
+        ret = efl_util_gesture_grab(h_gesture, d_tap);
+        ret = efl_util_gesture_grab(h_gesture, d_palm_cover);
+    */
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to grab a gesture */
+
+        return;
+    }
+</pre></li>
+ <li>Define the gesture event handlers:
+<pre class="prettyprint">
+    /* Add handlers for the gestures that you want to receive */
+    ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE, _edge_swipe_cb, NULL);
+    /*
+       You can handle multiple gestures:
+       ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_DRAG, _edge_drag_cb, NULL);
+       ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_TAP, _tap_cb, NULL);
+       ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_PALM_COVER, _palm_cover_cb, NULL);
+    */
+</pre></li>
+ <li>Run the main loop:
+<pre class="prettyprint">
+    /* Run Ecore main loop */
+    ecore_main_loop_begin();
+</pre>
+</li>
+  <li>When no longer needed, free the resources and deinitialize the <code>efl_util_gesture_h</code> structure:
+
+<pre class="prettyprint">
+    /* Ungrab the gesture */
+    ret = efl_util_gesture_ungrab(h_gesture, d_edge_swipe);
+    /*
+       Ungrab other gestures if necessary:
+       ret = efl_util_gesture_ungrab(h_gesture, d_edge_drag);
+       ret = efl_util_gesture_ungrab(h_gesture, d_tap);
+       ret = efl_util_gesture_ungrab(h_gesture, d_palm_cover);
+     */
+
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to ungrab the gesture */
+
+        return;
+    }
+
+    /* Free the gesture data */
+    ret = efl_util_gesture_edge_swipe_free(h_gesture, d_edge_swipe);
+    /*
+       Free the data for all gestures:
+       ret = efl_util_gesture_edge_drag_free(h_gesture, d_edge_drag);
+       ret = efl_util_gesture_tap_free(h_gesture, d_tap);
+       ret = efl_util_gesture_palm_cover_free(h_gesture, d_palm_cover);
+     */
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to free gesture data */
+
+        return;
+    }
+
+    ret = efl_util_gesture_deinitialize(h_gesture);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to deinitialize the gesture system */
+
+        return;
+    }
+}
+</pre></li>
+</ol>
+
+<h2 id="gesture_select">Selecting Gestures</h2>
+
+<p>Unlike grabbing, selecting a gesture requires a window. By selecting a gesture, you can detect gesture events when the selected window is active. Selecting has a higher priority than grabbing. Only the palm cover gesture can be selected.</p>
+<p>To select a gesture:</p>
+
+ <ol>
+ <li>Create the required callbacks:
+    <ol>
+       <li>Create a callback for the gesture event:
+<pre class="prettyprint">
+/* EFL_UTIL_EVENT_GESTURE_PALM_COVER */
+Eina Bool
+_palm_cover_cb(void *data, int type, void *event)
+{
+    efl_util_event_gesture_palm_cover_s *ev;
+
+    ev = (efl_util_event_gesture_palm_cover_s *)event;
+
+    printf("[Palm_Cover] mode: %d, duration: %d, center_point: (%d, %d), size: %d, pressure: %lf\n",
+           ev->mode, ev->duration, ev->cx, ev->cy, ev->size, ev->pressure);
+
+    return ECORE_CALLBACK_PASS_ON;
+}</pre></li>
+ <li>Create the window destruction callback:
+<pre class="prettyprint">
+/* Window destruction callback */
+void
+_window_delete_cb(void *data, Evas_Object *obj, void *event)
+{
+    elm_exit();
+}
+</pre></li>
+    </ol></li>
+ <li>Create the <code>efl_util_gesture_h</code> structure and initialize the structure members with the <code>efl_util_gesture_initialize()</code> function:
+<pre class="prettyprint">
+void
+select_gesture()
+{
+    int ret = EFL_UTIL_ERROR_NONE;
+    Evas_Object *window = NULL;
+    efl_util_gesture_h h_gesture = NULL;
+    efl_util_gesture_data d_palm_cover = NULL;
+
+    /* Create a gesture handle */
+    h_gesture = efl_util_gesture_initialize();
+
+    if (!h_gesture) {
+        ret = get_last_result();
+        /* Failed to initialize the gesture system */
+
+        return;
+    }
+</pre></li>
+ <li>Define the gesture data to select:
+<pre class="prettyprint">
+    /* Define the palm cover gesture */
+    d_palm_cover = efl_util_gesture_palm_cover_new(h_gesture);
+    if (!d_palm_cover) {
+        ret = get_last_result();
+        /* Failed to create palm cover gesture data */
+
+        return;
+    }
+</pre></li>
+ <li>Create and show a window in which you want to select a gesture.
+<p>This example uses the <code>efl_win_add()</code> function, but you can create the window in many ways.</p>
+<pre class="prettyprint">
+    window = elm_win_add(NULL, "Gesture Select Window", ELM_WIN_BASIC);
+    if (window) {
+        elm_win_title_set(window, "Gesture Select Window");
+        elm_win_borderless_set(window, EINA_TRUE);
+        evas_object_smart_callback_add(window, "delete,request", _window_delete_cb, NULL);
+        elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW);
+    }
+</pre></li>
+ <li>To select the gesture, use the <code>efl_util_gesture_select()</code> function:
+<pre class="prettyprint">
+    ret = efl_util_gesture_select(h_gesture, window, d_palm_cover);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to select the gesture */
+
+        return;
+    }
+</pre></li>
+ <li>Define the gesture event handler:
+<pre class="prettyprint">
+    /* Add a palm cover event handler */
+    ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_PALM_COVER, _palm_cover_cb, NULL);
+</pre></li>
+ <li>Run the main loop:
+<pre class="prettyprint">
+    /* Run Elm */
+    elm_run();
+</pre></li>
+ <li>When no longer needed, free the resources and deinitialize the <code>efl_util_gesture_h</code> structure:
+<pre class="prettyprint">
+    /* Deselect the palm cover gesture */
+    ret = efl_util_gesture_deselect(h_gesture, d_palm_cover);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to deselect the palm cover gesture */
+
+        return;
+    }
+
+    /* Free the gesture data */
+    ret = efl_util_gesture_palm_cover_free(h_gesture, d_palm_cover);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to free gesture data */
+
+        return;
+    }
+
+    /* Delete the window */
+    evas_object_del(window);
+
+    ret = efl_util_gesture_deinitialize(h_gesture);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to deinitialize the gesture system*/
+
+        return;
+    }
+}
+</pre></li>
+</ol>
+
+<h2 id="gesture_activate">Deactivating Gestures</h2>
+
+<p>Gestures are activated by default.</p>
+<p>To deactivate and re-activate gestures:</p>
+
+ <ol><li>Create the <code>efl_util_gesture_h</code> structure and initialize the structure members with the <code>efl_util_gesture_initialize()</code> function:
+<pre class="prettyprint">
+void
+activate_gesture()
+{
+    int ret = EFL_UTIL_ERROR_NONE;
+    efl_util_gesture_h h_gesture = NULL;
+    efl_util_gesture_data d_palm_cover = NULL;
+    unsigned int type = 0;
+    Eina_Bool active = EINA_FALSE;
+
+    /* Create a gesture handle */
+    h_gesture = efl_util_gesture_initialize();
+
+    if (!h_gesture) {
+        ret = get_last_result();
+        /* Failed to initialize the gesture system */
+
+        return;
+    }
+</pre></li>
+ <li>To deactivate a gesture type, use the <code>efl_util_gesture_activate_set()</code> function:
+<pre class="prettyprint">
+    /* Select the gesture types to deactivate */
+    type = EFL_UTIL_GESTURE_TYPE_EDGE_SWIPE;
+    /*
+       You can select multiple gesture types using bitwise operation, for example:
+       type = EFL_UTIL_GESTURE_TYPE_TAP | EFL_UTIL_GESTURE_TYPE_PAN;
+    */
+    /* Deactivate the gesture (active is EINA_FALSE) */
+    ret = efl_util_gesture_activate_set(h_gesture, type, active);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to set activation status */
+
+        return;
+    }
+</pre></li>
+ <li>Run the main loop:
+<pre class="prettyprint">
+    /* Run Elm */
+    elm_run();
+</pre></li>
+ <li>When no longer needed, re-activate the gestures and deinitialize the <code>efl_util_gesture_h</code> structure:
+<pre class="prettyprint">
+    /* Re-activate any deactivated gestures */
+    active = EINA_TRUE;
+    ret = efl_util_gesture_activate_set(h_gesture, type, active);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to activate gesture */
+
+        return;
+    }
+
+    ret = efl_util_gesture_deinitialize(h_gesture);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to deinitialize the gesture system */
+
+        return;
+    }
+}
+</pre></li>
+</ol>
+
+<h2 id="gesture_activate_with_win">Deactivating Gestures in a Window</h2>
+<p>Gestures are activated by default.</p>
+<p>To deactivate and re-activate gestures in a window:</p>
+
+ <ol>
+ <li>Create the window destruction callback:
+<pre class="prettyprint">
+/* Window destruction callback */
+void
+_window_delete_cb(void *data, Evas_Object *obj, void *event)
+{
+    elm_exit();
+}
+</pre></li>
+ <li>Create the <code>efl_util_gesture_h</code> structure and initialize the structure members with the <code>efl_util_gesture_initialize()</code> function:
+<pre class="prettyprint">
+void
+activate_gesture()
+{
+    int ret = EFL_UTIL_ERROR_NONE;
+    efl_util_gesture_h h_gesture = NULL;
+    efl_util_gesture_data d_palm_cover = NULL;
+    Evas_Object *window = NULL;
+    unsigned int type = 0;
+    Eina_Bool active = EINA_FALSE;
+
+    /* Create a gesture handle */
+    h_gesture = efl_util_gesture_initialize();
+
+    if (!h_gesture) {
+        ret = get_last_result();
+        /* Failed to initialize the gesture system */
+
+        return;
+    }
+</pre></li>
+  <li>Create and show a window in which you want to deactivate a gesture.
+<p>This example uses the <code>efl_win_add()</code> function, but you can create the window in many ways.</p>
+<pre class="prettyprint">
+    window = elm_win_add(NULL, "Gesture Select Window", ELM_WIN_BASIC);
+    if (window) {
+        elm_win_title_set(window, "Gesture Select Window");
+        elm_win_borderless_set(window, EINA_TRUE);
+        evas_object_smart_callback_add(window, "delete,request", _window_delete_cb, NULL);
+        elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW);
+    }
+</pre></li>
+ <li>To deactivate a gesture type, use the <code>efl_util_gesture_activate_set_on_window()</code> function:
+<pre class="prettyprint">
+    /* Select the gesture types to deactivate */
+    type = EFL_UTIL_GESTURE_TYPE_EDGE_SWIPE;
+    /*
+       You can select multiple gesture types using bitwise operation, for example:
+       type = EFL_UTIL_GESTURE_TYPE_TAP | EFL_UTIL_GESTURE_TYPE_PAN;
+    */
+    /* Deactivate the gesture (active is EINA_FALSE) */
+    ret = efl_util_gesture_activate_set_on_window(h_gesture, window, type, active);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to set activation status */
+
+        return;
+    }
+</pre></li>
+ <li>Run the main loop:
+<pre class="prettyprint">
+    /* Run Elm */
+    elm_run();
+</pre></li>
+ <li>When no longer needed, re-activate the gestures, delete the window, and deinitialize the <code>efl_util_gesture_h</code> structure:
+<pre class="prettyprint">
+    /* Re-activate any deactivated gestures */
+    active = EINA_TRUE;
+    ret = efl_util_gesture_activate_set_on_window(h_gesture, window, type, active);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to activate gesture */
+
+        return;
+    }
+
+    /* Delete the window */
+    evas_object_del(window);
+
+    ret = efl_util_gesture_deinitialize(h_gesture);
+    if (ret != EFL_UTIL_ERROR_NONE) {
+        /* Failed to deinitialize the gesture system*/
+
+        return;
+    }
+}
+</pre></li>
+</ol>
 
 <script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../../scripts/showhide.js"></script>