[tizen2.4][ACR-66][EOM] Init eom document
authorJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 11 May 2015 09:22:34 +0000 (18:22 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 11 May 2015 09:22:43 +0000 (18:22 +0900)
Change-Id: Idc7928f9dd27ee0826ba475181456e7ec7898064
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
org.tizen.guides/html/images/eom_mode.png [new file with mode: 0755]
org.tizen.guides/html/native/ui/eom_n.htm [new file with mode: 0644]
org.tizen.guides/html/native/ui/ui_guide_n.htm
org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm [new file with mode: 0644]
org.tizen.tutorials/html/native/ui/ui_tutorials_n.htm

diff --git a/org.tizen.guides/html/images/eom_mode.png b/org.tizen.guides/html/images/eom_mode.png
new file mode 100755 (executable)
index 0000000..1e7b9eb
Binary files /dev/null and b/org.tizen.guides/html/images/eom_mode.png differ
diff --git a/org.tizen.guides/html/native/ui/eom_n.htm b/org.tizen.guides/html/native/ui/eom_n.htm
new file mode 100644 (file)
index 0000000..7b27bec
--- /dev/null
@@ -0,0 +1,218 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
+    <script type="text/javascript" src="../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
+  <title>External Output Manager (EOM)</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="navigation">
+    <div id="profile">
+        <p><img alt="Mobile native" src="../../images/mn_icon.png"/></p>
+    </div>
+
+    <div id="toc_border"><div id="toc">
+        <p class="toc-title">Content</p>
+        <ul class="toc">
+            <li><a href="#mode">Mode</a></li>
+            <li><a href="#attribute">Attribute for Presentation Mode</a></li>
+            <li><a href="#noti">Notify to application</a></li>
+            <li><a href="#getinfo">Get Information of External Output Device</a></li>
+            <li><a href="#setinfo">Set to External Output Device</a></li>
+        </ul>
+        <p class="toc-title">Related Info</p>
+        <ul class="toc">
+            <li><a href="../../../../org.tizen.tutorials/html/native/graphics/eom_tutorial_n.htm">EOM Tutorial</a></li>
+<!-- (            <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__EOM__MODULE.html">EOM API</a></li>) -->
+        </ul>
+    </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>External Output Manager (EOM)</h1>
+  <p>External Output Manager(EOM) is a module to control external output devices.</p>
+  <p>Until Tizen 2.3, Devicemgr(private module) is used for external output. But Devicemgr has some problems.</p>
+  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Devicemgr problems</p>
+  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Cannot know video-only mode start and stop.</p>
+  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Doesn't have method to notify to application about external output informations.</p>
+  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Application cannot display specific images to external output.)</p>
+  <p>So module for external output is replaced to EOM from Tizen 2.4. EOM fixes devicemgr's problems and manages all convergence scenarios of external output.</p>
+  <p>EOM is a module of enlightenment. And EOM has X and Walyland backend.</p>
+
+  <h2 id="mode" name="mode">Mode</h2>
+    <p>EOM has two modes. One is Mirror mode, the other is Presentation mode.</p>
+    <pre class="prettyprint">
+      <p class="figure">Figure: EOM mode</p>
+      <p style="text-align:center;"><img alt="Window layers" src="../../images/eom_mode.png" /></p>
+    </pre>
+    <P>Mirror mode is default mode. So if any application doesn't set presentation mode, Mirror mode will work by EOM module when external output device is connected.</P>
+    <P>Presentation mode can be set by application. If application wants to display it's own image or video to external output device, application must use presentation mode.</P>
+
+  <h2 id="attribute" name="attribute">Attribute for Presentation Mode</h2>
+    <p>Applications have to use EOM attributes to set presentation mode.</p>
+    <p>There are three priorities of EOM attribute. The meaning of set attribute is the application wants to display a window with fullscreen size on the external output. </p>
+    <table>
+      <caption>
+      Table: Attribute for presentation mode
+      </caption>
+      <tbody>
+      <tr>
+        <th>Attribute</th>
+        <th>Description</th>
+      </tr>
+      <tr>
+        <td rowspan="2"><span style="font-family: Courier New,Courier,monospace">EOM_OUTPUT_ATTRIBUTE_NORMAL</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Can set normal if none(mirror mode) or normal attribute state</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">Cannot set normal if exclusive_share or exclusive attribute state</span></td>
+      </tr>
+      <tr>
+        <td rowspan="2"><span style="font-family: Courier New,Courier,monospace">EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARE</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Can set exclusive_share if none(mirror mode), normal or exclusive_share attribute state</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">Cannot set exclusive_share if exclusive attribute set state</span></td>
+      </tr>
+      <tr>
+        <td rowspan="2"><span style="font-family: Courier New,Courier,monospace">EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Can set exclusive if none(mirror mode), normal or exclusive_share attribute state</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">Cannot set exclusive if exclusive attribute set state</span></td>
+      </tr>
+      </tbody>
+    </table>
+
+  <h2 id="noti" name="noti">Notify to application</h2>
+    <p>EOM can send notification event to application. Eom checks several changes(external output add and remove, mode change, attribute state change) and sends notification events to EOM client.</p>
+    <p>So application(EOM client) can get the status of external output. EOM client has to register callback functions to get information.</p>
+    <table>
+      <caption>
+      Table: EOM Notify event
+      </caption>
+      <tbody>
+      <tr>
+        <th>Callback Type</th>
+        <th>Description</th>
+        <th>Function</th>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_output_add_cb</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Send event when the external output is connected</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_set_output_added_cb, eom_unset_output_added_cb</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_output_remove_cb</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Send event when the external output is disconnected</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_set_output_removed_cb, eom_unset_output_removed_cb</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_mode_change_cb</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Send event when the EOM output mode is changed</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_set_mode_changed_cb, eom_unset_mode_changed_cb</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_attribute_change_cb</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Send event when the state of the EOM output attribute is changed</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_set_attribute_changed_cb, eom_unset_attribute_changed_cb</span></td>
+      </tr>
+      </tbody>
+    </table>
+
+  <h2 id="getinfo" name="getinfo">Get Information of External Output Device</h2>
+    <p>By using below APIs, application can get information of external output device from EOM.</p>
+    <table>
+      <caption>
+      Table: APIs for get external output device information
+      </caption>
+      <tbody>
+      <tr>
+        <th>Function</th>
+        <th>Description</th>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_get_eom_output_ids</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Gets the ID of external output devices</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_get_output_type</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Gets the connection type of external output (HDMI, Virtual, VGA, etc)</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_get_output_mode</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Gets the mode of external output (NONE, MIRROR, PRESENTATION)</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_get_output_attribute</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Gets the attribute information (NORMAL, EXCLUSIVE_SHARE, EXCLUSIVE)</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_get_output_attribute_state</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Gets the attribute state information (NONE, ACTIVE, INACTIVE, LOST)</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_get_output_resolution</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Gets the best resolution of external output device</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_get_output_physical_size</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Gets the physical size of external output device</span></td>
+      </tr>
+      </tbody>
+    </table>
+
+  <h2 id="setinfo" name="setinfo">Set to External Output Device</h2>
+    <p>By using below APIs, application can set information to EOM.</p>
+    <table>
+      <caption>
+      Table: APIs for set information
+      </caption>
+      <tbody>
+      <tr>
+        <th>Function</th>
+        <th>Description</th>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_set_output_attribute</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Sets to presentation mode by setting attribute to EOM</span></td>
+      </tr>
+      <tr>
+        <td><span style="font-family: Courier New,Courier,monospace">eom_set_output_window</span></td>
+        <td><span style="font-family: Courier New,Courier,monospace">Sets window to the external output best resolution of external output device</span></td>
+      </tr>
+      </tbody>
+    </table>
+
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer"> 
+<p class="footer">Except as noted, this content is licensed under <a href="http://opensource.org/licenses/LGPL-2.1" target="_blank">LGPLv2.1+</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p> 
+</div> 
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
index 444c0c9..47c3f6c 100644 (file)
@@ -45,6 +45,7 @@
         <li><a href="font_setting_n.htm">Font Setting</a> <p>Enables you to change the font of your application to another system default font or your own font.</p></li>
         <li><a href="efl_util_n.htm">EFL UTIL</a> <p>Enables you to manage notification window levels.</p> </li>
         <li><a href="multiple_screens_n.htm">Multiple Screen Support</a> <p>Enables you to design applications for different kids of screens.</p></li>          
+        <li><a href="eom_n.htm">EOM</a> <p>Enables you to handle external output.</p></li>
      </ul>
  
 
@@ -70,4 +71,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm b/org.tizen.tutorials/html/native/ui/eom_tutorial_n.htm
new file mode 100644 (file)
index 0000000..7da8970
--- /dev/null
@@ -0,0 +1,404 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
+    <script type="text/javascript" src="../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
+
+    <title>EOM: Using the External Output Devices</title>
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="navigation">
+  <div id="profile">
+    <p><img alt="Mobile native" src="../../images/mn_icon.png"/></p>
+  </div>
+  <div id="toc_border"><div id="toc">
+    <p class="toc-title">Content</p>
+    <ul class="toc">
+      <li><a class="opensection" href="#init">Initializing EOM</a></li>
+      <li><a class="opensection" href="#getid">Getting Output ID</a></li>
+      <li><a class="opensection" href="#setattr">Setting Attribute</a></li>
+      <li><a class="opensection" href="#setwin">Setting External Window</a></li>
+      <li><a class="opensection" href="#getstatus">Getting Status of External Output Device</a></li>
+    </ul>
+    <p class="toc-title">Related Info</p>
+    <ul class="toc">
+      <li><a href="../../../../org.tizen.guides/html/native/ui/eom_n.htm">EOM Guide</a></li>
+<!-- (      <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__EFL__UTIL__MODULE.html">EFL UTIL API</a></li>) -->
+    </ul>
+  </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>EOM: Using the External Output Devices</h1>
+  <div class="cont"><div class="static-cont">
+  <p>This tutorial demonstrates how you can control external output devices by EOM API.</p>
+
+  <h2>Warm-up</h2>
+  <p>Become familiar with the EOM API basics by learning about:</p>
+
+  <ul>
+  <li><a href="#init">Initializing EOM</a>
+    <p>Initialize the EOM.</p></li>
+  <li><a href="#getid">Getting Output ID</a>
+    <p>Get output device's ID.</p></li>
+  <li><a href="#setattr">Setting Attribute</a>
+    <p>Set the attribute.</p></li>
+  <li><a href="#setwin">Setting External Window</a>
+    <p>Set external window.</p></li>
+  <li><a href="#getstatus">Getting Status of External Output Device</a>
+    <p>Get external output device's information</p></li>
+  </ul>
+
+  <div class="devicespecs-util mt5 clfix">
+    <ul class="dutil">
+      <li><a href="#" class="showA">Show All</a></li>
+      <li class="none"><a href="#" class="hideA">Hide All</a></li>
+    </ul>
+  </div>
+
+  <ul class="devicespecifications">
+  <li>
+    <div class="devicespec-tit">
+      <h2 id="init" name="init" class="items-tit-h2">Initializing EOM</h2>
+      <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
+    </div>
+    <div class="devicespec-con">
+      <p>To use the EOM API, the following header file has to be included:</p>
+      <pre class="prettyprint">#include &lt;eom.h&gt;</pre>
+      <p>And have to excute <span style="font-family: Courier New,Courier,monospace">eom_init()</span> function.</p>
+    </div>
+  </li>
+
+  <li>
+    <div class="devicespec-tit">
+      <h2 id="getid" name="getid" class="items-tit-h2">Getting Output ID</h2>
+      <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
+    </div>
+    <div class="devicespec-con">
+      <p>Have to find output id to get information of output device and control external window.</P>
+      <p>Use the <span style="font-family: Courier New,Courier,monospace">eom_get_eom_output_ids()</span> function to find output id.</p>
+      <pre class="prettyprint">
+int sample_get_output_id (const char *output_name)
+{
+&nbsp;&nbsp;&nbsp;eom_output_id *output_ids = NULL;
+&nbsp;&nbsp;&nbsp;eom_output_id output_id = 0;
+&nbsp;&nbsp;&nbsp;eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN;
+&nbsp;&nbsp;&nbsp;int id_cnt = 0;
+&nbsp;&nbsp;&nbsp;int i;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;output_ids = eom_get_eom_output_ids(&amp;id_cnt);
+&nbsp;&nbsp;&nbsp;if (id_cnt == 0)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf ("no external outuputs supported\n");
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 0;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;for (i = 0; i &lt; id_cnt; i++)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_get_output_type(output_ids[i], &amp;output_type);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!strncmp(output_name, "HDMI", 4))
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (output_type == EOM_OUTPUT_TYPE_HDMIA || output_type == EOM_OUTPUT_TYPE_HDMIB)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output_id = output_ids[i];
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else if (!strncmp(output_name, "Virtual", 7))
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (output_type == EOM_OUTPUT_TYPE_VIRTUAL)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output_id = output_ids[i];
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;if (output_ids)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;free (output_ids);
+&nbsp;&nbsp;&nbsp;return output_id;
+}
+      </pre>
+    </div>
+  </li>
+
+  <li>
+  <div class="devicespec-tit">
+    <h2 id="setattr" name="setattr" class="items-tit-h2">Setting Attribute</h2>
+    <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
+  </div>
+  <div class="devicespec-con">
+    <p>To acquire the right of external output device, use the <span style="font-family: Courier New,Courier,monospace">eom_set_output_attribute()</span> function</p>
+    <p>If setting is successful, eom module will work presentation mode when external output device connected.</p>
+    <pre class="prettyprint">
+int set_attribute()
+{
+&nbsp;&nbsp;&nbsp;m_output_id output_id = 0;
+&nbsp;&nbsp;&nbsp;int ret;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;output_id = sample_get_output_id("HDMI");
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;ret = eom_set_output_attribute(output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL);
+&nbsp;&nbsp;&nbsp;if (ret != EOM_ERROR_NONE) 
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Attribute set fail. Cannot use external output device. Deinitializing.
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_deinit ();
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return -1;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;return 0;
+}
+    </pre>
+    <p>There are three attributes for priority. It is recommended to use EOM_OUTPUT_ATTRIBUTE_NORMAL attribute to general application.</p>
+    <p>Other attributes are for special applications.</p>
+    <pre class="prettyprint">
+EOM_OUTPUT_ATTRIBUTE_NORMAL
+EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARE
+EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE
+    </pre>
+    <p>If receive EOM_ERROR_NONE by eom_set_output_attribute() funtion, the application can use external output device.</p>
+  </div>
+  </li>                        
+
+  <ul class="devicespecifications">
+  <li>
+    <div class="devicespec-tit">
+      <h2 id="setwin" name="setwin" class="items-tit-h2">Setting External Window</h2>
+      <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
+    </div>
+    <div class="devicespec-con">
+      <p>Application can set window to external by using <span style="font-family: Courier New,Courier,monospace">eom_set_output_window()</span> function.</p>
+      <p>This API moves window to external output and resizes best resolution of external output device automatically.</p>
+      <p>Before excuting this function, application must receive success return from <span style="font-family: Courier New,Courier,monospace">eom_set_output_attribute()</span> function.</p>
+      <pre class="prettyprint">
+int make_external_window()
+{
+&nbsp;&nbsp;&nbsp;Evas_Object *window;
+&nbsp;&nbsp;&nbsp;window = elm_win_add(NULL, "external_window", ELM_WIN_BASIC);
+&nbsp;&nbsp;&nbsp;if (eom_set_output_window(output_id, window) == EOM_ERROR_NONE)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 0;
+&nbsp;&nbsp;&nbsp;else
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evas_object_del (window);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return -1;
+&nbsp;&nbsp;&nbsp;}
+}
+      </pre>
+    </div>
+  </li>
+
+  <li>
+    <div class="devicespec-tit">
+      <h2 id="getstatus" name="getstatus" class="items-tit-h2">Getting Status of External Output Device</h2>
+      <span class="fr"><a href="#" class="bt-arr"><em>Hide</em></a></span>
+    </div>
+    <div class="devicespec-con">
+      <p>Application can get external output device's information by using EOM API callback functions.</p>
+      <h3>mode info</h3>
+        <p>Mirror mode is default mode. If eom_set_output_attribute funtion excuted successfully, the external output will work to presentation mode.</p>
+        <pre class="prettyprint">
+typedef enum
+{
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_MODE_NONE,
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_MODE_MIRROR,
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_MODE_PRESENTATION,
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_MODE_MAX,
+} eom_output_mode_e;
+        </pre>
+
+      <h3>attribute state</h3>
+        <p>If application set attribue, EOM send current attribute state to application.</p>
+        <p>ACTIVE means application can use external output. INACTIVE means cannot use cause of disconnection.</p>
+        <p>LOST means application cannot use external output cause of another application's attribute setting.</p>
+        <p>In case of LOST, application can't recevie attribute state anymore.</p>
+        <pre class="prettyprint">
+typedef enum
+{
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_ATTRIBUTE_STATE_NONE,
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE,
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE,
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_ATTRIBUTE_STATE_LOST,
+&nbsp;&nbsp;&nbsp;EOM_OUTPUT_ATTRIBUTE_STATE_MAX,
+} eom_output_attribute_state_e;
+        </pre>
+
+      <h3>get information</h3>
+        <p>Application can get some information by using below APIs.</p>
+        <p><span style="font-family: Courier New,Courier,monospace">int eom_get_output_type (eom_output_id output_id, eom_output_type_e *type):</span>Get output device type(HDMI, VIRTUAL, VGA, etc).</p>
+        <p><span style="font-family: Courier New,Courier,monospace">int eom_get_output_mode (eom_output_id output_id, eom_output_mode_e *mode):</span>Get mode (NONE, MIRROR, PRESETNTATION).</p>
+        <p><span style="font-family: Courier New,Courier,monospace">int eom_get_output_attribute (eom_output_id output_id, eom_output_attribute_e *attribute)</span>Get information of attribute set(NORMAL, EXCLUSIVE_SHARE, EXCLUSIVE).</p>
+        <p><span style="font-family: Courier New,Courier,monospace">int eom_get_output_attribute_state (eom_output_id output_id, eom_output_attribute_state_e *state)</span>Get attribute state(ACTIVE, INACTIVE, LOST).</p>
+        <p><span style="font-family: Courier New,Courier,monospace">int eom_get_output_resolution (eom_output_id output_id, int *width, int *height)</span>Get best resolution of external output device.</p>
+        <p><span style="font-family: Courier New,Courier,monospace">int eom_get_output_physical_size (eom_output_id output_id, int *phy_width, int *phy_height)</span>Get physical size of external output device.</p>
+
+      <h3>callback</h3>
+        <p>Application can get status changing event by setting callback functions.</p>
+        <pre class="prettyprint">
+typedef void (*eom_output_added_cb)(eom_output_id output_id, void *user_data);
+typedef void (*eom_output_removed_cb)(eom_output_id output_id, void *user_data);
+typedef void (*eom_mode_changed_cb)(eom_output_id output_id, void *user_data);
+typedef void (*eom_attribute_changed_cb)(eom_output_id output_id, void *user_data);
+        </pre>
+        <p>By using below funtions, application can set and unset callback functions.</p>
+        <pre class="prettyprint">
+int eom_set_output_added_cb (eom_output_added_cb callback, void *user_data);            //external output connection event
+int eom_unset_output_added_cb (eom_output_added_cb callback);                           //external output connection event
+int eom_set_output_removed_cb (eom_output_removed_cb callback, void *user_data);        //external output disconnection event
+int eom_unset_output_removed_cb (eom_output_removed_cb callback);                       //external output disconnection event
+int eom_set_mode_changed_cb (eom_mode_changed_cb callback, void *user_data);            //external output mode changing event
+int eom_unset_mode_changed_cb (eom_mode_changed_cb callback);                           //external output mode changing event
+int eom_set_attribute_changed_cb (eom_attribute_changed_cb callback, void *user_data);  //external output attribute state changing event
+int eom_unset_attribute_changed_cb (eom_attribute_changed_cb callback);                 //external output attribute state changing event
+        </pre>
+        <p>This is sample code about callback funtion.</p>
+        <pre class="prettyprint">
+typedef struct
+{
+&nbsp;&nbsp;&nbsp;Evas_Object *external_window;
+&nbsp;&nbsp;&nbsp;int output_id;
+} SampleInfo;
+
+static void
+sample_notify_cb_output_add (eom_output_id output_id, void *user_data)
+{
+&nbsp;&nbsp;&nbsp;SampleInfo *info = (SampleInfo*)user_data;
+&nbsp;&nbsp;&nbsp;if (!info-&gt;external_window)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//make external window
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make_external_window(info-&gt;external_window);
+&nbsp;&nbsp;&nbsp;}
+}
+
+static void
+sample_notify_cb_output_remove (eom_output_id output_id, void *user_data)
+{
+&nbsp;&nbsp;&nbsp;SampleInfo *info = (SampleInfo*)user_data;
+&nbsp;&nbsp;&nbsp;if (!info-&gt;external_window)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evas_object_del (info-&gt;external_window)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info-&gt;external_window = NULL;
+&nbsp;&nbsp;&nbsp;}
+}
+
+static void
+sample_notify_cb_attribute_changed (eom_output_id output_id, void *user_data)
+{
+&nbsp;&nbsp;&nbsp;SampleInfo *info = (SampleInfo*)user_data;
+&nbsp;&nbsp;&nbsp;eom_output_attribute_e attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
+&nbsp;&nbsp;&nbsp;eom_output_attribute_state_e state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;eom_get_output_attribute(output_id, &amp;attribute);
+&nbsp;&nbsp;&nbsp;eom_get_output_attribute_satate(output_id, &amp;state);
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;if (state == EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//start displaying image to external output(info-&gt;external_window);
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//stop displaying image
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//destory external_window
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (info-&gt;external_window)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evas_object_del (info-&gt;external_window);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info-&gt;external_window = NULL;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//stop displaying image
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//destory external_window
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (info-&gt;external_window)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;evas_object_del (info-&gt;external_window);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;info-&gt;external_window = NULL;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//remove callback
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_unset_output_added_cb(sample_notify_cb_output_add);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_unset_output_removed_cb(sample_notify_cb_output_remove);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_unset_attribute_changed_cb(sample_notify_cb_attribute_changed);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_deinit ();
+&nbsp;&nbsp;&nbsp;}
+}
+
+int elm_main()
+{
+&nbsp;&nbsp;&nbsp;SampleInfo *info;
+&nbsp;&nbsp;&nbsp;eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE;
+&nbsp;&nbsp;&nbsp;int ret;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;info = calloc(sizeof(SampleInfo));
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;eom_init ();
+&nbsp;&nbsp;&nbsp;info-&gt;output_id = sample_get_output_id ("HDMI");
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;ret = eom_set_output_attribute(info-&gt;hdmi_output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL);
+&nbsp;&nbsp;&nbsp;if (ret != EOM_ERROR_NONE)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//cannot use external output device
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_deinit ();
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;else
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_get_output_mode(info-&gt;output_id, &amp;output_mode);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (output_mode != EOM_OUTPUT_MODE_NONE)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//make external window
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make_external_window(info-&gt;external_window);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//add callback
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_set_output_added_cb(sample_notify_cb_output_add, info);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_set_output_removed_cb(sample_notify_cb_output_remove, info);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eom_set_attribute_changed_cb(sample_notify_cb_attribute_changed, info);
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;elm_run();
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;//remove callback
+&nbsp;&nbsp;&nbsp;eom_unset_output_added_cb(sample_notify_cb_output_add);
+&nbsp;&nbsp;&nbsp;eom_unset_output_removed_cb(sample_notify_cb_output_remove);
+&nbsp;&nbsp;&nbsp;eom_unset_attribute_changed_cb(sample_notify_cb_attribute_changed);
+&nbsp;&nbsp;&nbsp;eom_deinit ();
+&nbsp;&nbsp;&nbsp;elm_shutdown();
+&nbsp;&nbsp;&nbsp;return 0;
+}
+        </pre>
+    </div>
+  </li>
+</ul>  
+</div>                         
+</div>
+  
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../scripts/showhide.js"></script>
+
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div> 
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
index 2ca6c78..d330718 100644 (file)
@@ -42,7 +42,7 @@
     <li><a href="font_settings_tutorial_n.htm">Font Setting: Using Various Fonts in the Application</a> <p>Demonstrates how you can modify the fonts and text size of your application, or set your own font.</p></li>         
     <li><a href="efl_util_tutorial_n.htm">EFL UTIL: Adjusting the Notification Window Level</a> <p>Demonstrates how you can create a notification window and adjust its position.</p></li>
        <li><a href="efl_optimization_tutorial_n.htm">EFL Optimization: Optimizing Tizen Native Applications</a> <p>Demonstrates how you can optimize your Tizen native application.</p></li>
-        
+       <li><a href="eom_tutorial_n.htm">EOM: Using External Output by EOM</a> <p>Demonstrates how you can use external output devices.</p></li>         
         
   </ul>