LB reviewed (efl_util)
authorDonghyun Lee <dh0922.lee@samsung.com>
Thu, 30 Apr 2015 06:52:43 +0000 (15:52 +0900)
committerDonghyun Lee <dh0922.lee@samsung.com>
Thu, 30 Apr 2015 06:52:45 +0000 (15:52 +0900)
Signed-off-by: Donghyun Lee <dh0922.lee@samsung.com>
org.tizen.guides/html/native/ui/efl_util_n.htm

index 627f4c1..37d50f0 100755 (executable)
  </head> 
  <body onload="prettyPrint()" style="overflow: auto;">
  
- <div id="navigation">
+ <div id="toc-navigation">
        <div id="profile">
-               <p><img alt="Mobile native" src="../../images/mn_icon.png"/></p>
+               <p><img alt="Mobile native" src="../../images/mn_icon.png"/> <img alt="Wearable native" src="../../images/wn_icon.png"/></p>
        </div>
        
        <div id="toc_border"><div id="toc">
-               <p class="toc-title">Content </P>
-               <ul class="toc">
+       <p class="toc-title">Content </P>
+         <ul class="toc">
                        <li><a href="#noti">Notification Window</a></li>
-                       <li><a href="#shot">Screen Shot</a></li>
-                       <li><a href="#input_gen">Input Generator</a></li>
+            <li><a href="#shot">Screenshot</a></li>
+            <li><a href="#input_gen">Input Generator</a></li>
+               </ul>
                <p class="toc-title">Related Info</p>
                <ul class="toc">
                        <li><a href="../../../../org.tizen.tutorials/html/native/ui/efl_util_tutorial_n.htm">EFL UTIL Tutorial</a></li> 
-                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__MODULE.html">EFL UTIL API</a></li>                        
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__MODULE.html">EFL UTIL API for Mobile Native</a></li>
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__Elementary.html">Elementary API for Mobile Native</a></li>
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__Evas.html">Evas API for Mobile Native</a></li>     
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__EFL__UTIL__MODULE.html">EFL UTIL API for Wearable Native</a></li>
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/group__Elementary.html">Elementary API for Wearable Native</a></li>
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/group__Evas.html">Evas API for Wearable Native</a></li>                 
                </ul>
        </div></div>
 </div> 
 <div id="container"><div id="contents"><div class="content">
 
   <h1>EFL UTIL</h1> 
-<P> The <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__MODULE.html">EFL UTIL</a> is a utility package that supports several functioinality of EFL. It provides the following functions.</P>
+<p>The EFL UTIL utility package that supports the following EFL functionalities:</p>
+
+<ul><li><a href="#noti">Notification Window</a></li>
+    <li><a href="#shot">Screenshot</a></li>
+    <li><a href="#input_gen">Input Generator</a></li></ul>
 
 <h2 id="noti" name="noti">Notification Window</h2>
 
-<p>The Notification Window API provides setting and getting the notification level of the notification window (which is of the EFL window type):</p>
+<p>The Notification Window API allows you to set and get the notification level of the notification window (which is of the EFL window type):</p>
 
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">efl_util_set_notification_window_level()</span></li>
+<ul><li><span style="font-family: Courier New,Courier,monospace;">efl_util_set_notification_window_level()</span></li>
 <li><span style="font-family: Courier New,Courier,monospace;">efl_util_get_notification_window_level()</span></li></ul>
 
-<h3>Background</h3>
 <p>To understand notification levels, you must first learn about the Tizen window layer hierarchy. Window layers are logical containers used to control the window stack order. Each window belongs to 1 layer and can change the stack order in the layer. Windows in same layer are always placed on or under a window in another layer. In addition to the default &quot;normal layer&quot;, there exists a &quot;notification layer&quot;, which is always placed above the normal layer.</p>
 
 
 <p style="text-align:center;"><img alt="Window layers" src="../../images/efl_windowlayer.png" /></p> 
 
 
-
 <p>Each window is set to  a specific layer according to its type or properties. Most application windows belong to the normal layer. However, in case of an important alarm or other information crucial to the user, you can set the window to belong to the notification layer. This ensures that the user notices the information immediately, because the window belonging to the notification layer is always shown above the windows in the normal layer.</p> 
 
-<h3>Usage</h3>
+<h3>Using the Notification Windows</h3>
+
 <p>A window that belongs to the notification layer is called a &quot;notification window&quot;. To make a notification window:</p>
 
 <ol><li>Set the window type to <span style="font-family: Courier New,Courier,monospace;">NOTIFICATION</span>, by calling the <span style="font-family: Courier New,Courier,monospace;">elm_win_add()</span> function with the third parameter set to <span style="font-family: Courier New,Courier,monospace;">ELM_WIN_NOTIFICATION</span>.</li>
@@ -71,7 +81,7 @@
 <p class="figure">Figure: Notification levels</p> 
 <p style="text-align:center;"><img alt="Notification levels" src="../../images/efl_notilevels.png" /></p> 
 
-<h3>Example</h3>
+
 <p>The following code snippets shown how to make a notification window with a higher level.</p>
 
 <pre class="prettyprint">
@@ -134,127 +144,20 @@ void get_notification_level (Evas_Object *eo)
 &nbsp;&nbsp;&nbsp;}
 }</pre>
   
+<h2 id="shot" name="shot">Screenshot</h2>
 
-<h2 id="shot" name="shot">Screen Shot</h2>
-
-<p>The Screen Shot API provides getting screen image to user (return tbm_surface handler)</p>
-
-<h3>Initialize</h3>
-<P>Make efl_util_screenshot_h structure and initialize structure members.</P>
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height)</span></li></ul>
+<p>The Screen Shot API allows you to get the screen image to the user.</p>
 
-<h3>Take Screen Shot</h3>
-<P>Create screen capture data and return to tbm_surface handler.</P>
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">tbm_surface_h efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot)</span></li></ul>
-
-<h3>Terminate</h3>
-<P>Free efl_util_screenshot_h structure.</P>
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">void efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot)</span></li></ul>
-
-<h3>Example</h3>
-<pre class="prettyprint">
-#include &lt;tbm_surface.h&gt;
-#include &lt;efl_util.h&gt;
-#include &lt;X11/Xlib.h&gt;
-
-void capture()
-{
-&nbsp;&nbsp;&nbsp;efl_util_screenshot_h screenshot = NULL;
-&nbsp;&nbsp;&nbsp;tbm_surface_h tbm_surface = NULL;
-&nbsp;&nbsp;&nbsp;tbm_surface_info_s tsuri;
-
-&nbsp;&nbsp;&nbsp;screenshot = efl_util_screenshot_initialize(width, height);
-&nbsp;&nbsp;&nbsp;if (screenshot) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tbm_surface = efl_util_screenshot_take_tbm_surface(screenshot);
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (tbm_surface) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//treat tbm_surface handler(screen shot data)
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;efl_util_screenshot_deinitialize(screenshot);
-&nbsp;&nbsp;&nbsp;}
-}</pre>
+<p>First you must make the <span style="font-family: Courier New,Courier,monospace;">efl_util_screenshot_h</span> structure and initialize the structure members with the <span style="font-family: Courier New,Courier,monospace;">efl_util_screenshot_initialize()</span> function. To take the actual screenshot, create screen capture data and return it to the <span style="font-family: Courier New,Courier,monospace;">tbm_surface</span> handler with the <span style="font-family: Courier New,Courier,monospace;">efl_util_screenshot_take_tbm_surface()</span> function.</p>
+<p>When no longer needed, remember to free the <span style="font-family: Courier New,Courier,monospace;">efl_util_screenshot_h</span> structure with the <span style="font-family: Courier New,Courier,monospace;">efl_util_screenshot_deinitialize()</span> function.</p>
 
 
 <h2 id="input_gen" name="input_gen">Input Generator</h2>
 
-<p>The Input Generator API provides generating input events(such as key and touch events).</p>
-
-<h3>Initialize</h3>
-<P>Initialize the input generator and select a device type.</P>
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">int efl_util_input_initialize_generator(efl_util_input_device_type_e dev_type)</span></li></ul>
-
-<h3>Generate Event</h3>
-<P>Generate a key event.</P>
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">int efl_util_input_generate_key(const char *key_name, int pressed)</span></li></ul>
-<P>Generate a touch event.</P>
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">int efl_util_input_generate_touch(int idx, efl_util_input_touch_type_e touch_type, int x, int y)</span></li></ul>
-
-<h3>Terminate</h3>
-<P>Free input generator.</P>
-<ul class="ul"><li><span style="font-family: Courier New,Courier,monospace;">void efl_util_input_deinitialize_generator(void)</span></li></ul>
-
-<h3>Example</h3>
-<p>Please generate key events with Press and Release pair.</p>
-<pre class="prettyprint">
-#include &lt;efl_util.h&gt;
-
-void key_event_generator()
-{
-&nbsp;&nbsp;&nbsp;int ret = EFL_UTIL_ERROR_NONE;
-
-&nbsp;&nbsp;&nbsp;ret = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD);
-&nbsp;&nbsp;&nbsp;if (ret != EFL_UTIL_ERROR_NONE) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// failed to initialize input generator
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;ret = efl_util_input_generate_key("XF86Menu", 1);
-&nbsp;&nbsp;&nbsp;if (ret != EFL_UTIL_ERROR_NONE) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// failed to generate a "XF86Menu" key press event
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;efl_util_input_deinitialize_generator();
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;ret = efl_util_input_generate_key("XF86Menu", 0);
-&nbsp;&nbsp;&nbsp;if (ret != EFL_UTIL_ERROR_NONE) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// failed to generate a "XF86Menu" key release event
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;efl_util_input_deinitialize_generator();
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;efl_util_input_deinitialize_generator();
-}</pre>
-
-<p>Please generate touch events with Begin/Update/End sequence each of index.</p>
-<pre class="prettyprint">
-#include &lt;efl_util.h&gt;
-
-void touch_event_generator()
-{
-&nbsp;&nbsp;&nbsp;int ret = EFL_UTIL_ERROR_NONE;
-
-&nbsp;&nbsp;&nbsp;ret = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN);
-&nbsp;&nbsp;&nbsp;if (ret != EFL_UTIL_ERROR_NONE) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// failed to initialize input generator
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;ret = efl_util_input_generate_touch(0, EFL_UTIL_INPUT_TOUCH_BEGIN, 100, 100);
-&nbsp;&nbsp;&nbsp;if (ret != EFL_UTIL_ERROR_NONE) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// failed to generate a first finger touch press event on (100, 100)
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;efl_util_input_deinitialize_generator();
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;ret = efl_util_input_generate_touch(0, EFL_UTIL_INPUT_TOUCH_UPDATE, 110, 110);
-&nbsp;&nbsp;&nbsp;if (ret != EFL_UTIL_ERROR_NONE) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// failed to generate a first finger touch move event to (110, 110)
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;efl_util_input_deinitialize_generator();
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;ret = efl_util_input_generate_touch(0, EFL_UTIL_INPUT_TOUCH_END, 110, 110);
-&nbsp;&nbsp;&nbsp;if (ret != EFL_UTIL_ERROR_NONE) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// failed to generate a first finger touch release event to (110, 110)
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;efl_util_input_deinitialize_generator();
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;efl_util_input_deinitialize_generator();
-}</pre>
+<p>The Input Generator API allows you to generate input events (such as key and touch events).</p>
 
+<p>First you initialize the input generator and select a device type with the <span style="font-family: Courier New,Courier,monospace;">efl_util_input_initialize_generator()</span> function. To generate actual key or touch events, use the <span style="font-family: Courier New,Courier,monospace;">efl_util_input_generate_key()</span> or <span style="font-family: Courier New,Courier,monospace;">efl_util_input_generate_touch()</span> function.</p>
+<p>When no longer needed, remember to free the input generator with the <span style="font-family: Courier New,Courier,monospace;">efl_util_input_deinitialize_generator()</span> function.</p>
 
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
@@ -278,4 +181,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 </script>
 
 </body>
-</html>
+</html>
\ No newline at end of file