--- /dev/null
+<!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> - Devicemgr problems</p>
+ <p> 1. Cannot know video-only mode start and stop.</p>
+ <p> 2. Doesn't have method to notify to application about external output informations.</p>
+ <p> 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>
--- /dev/null
+<!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 <eom.h></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)
+{
+ eom_output_id *output_ids = NULL;
+ eom_output_id output_id = 0;
+ eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN;
+ int id_cnt = 0;
+ int i;
+
+ output_ids = eom_get_eom_output_ids(&id_cnt);
+ if (id_cnt == 0)
+ {
+ printf ("no external outuputs supported\n");
+ return 0;
+ }
+
+ for (i = 0; i < id_cnt; i++)
+ {
+ eom_get_output_type(output_ids[i], &output_type);
+ if (!strncmp(output_name, "HDMI", 4))
+ {
+ if (output_type == EOM_OUTPUT_TYPE_HDMIA || output_type == EOM_OUTPUT_TYPE_HDMIB)
+ {
+ output_id = output_ids[i];
+ break;
+ }
+ }
+ else if (!strncmp(output_name, "Virtual", 7))
+ {
+ if (output_type == EOM_OUTPUT_TYPE_VIRTUAL)
+ {
+ output_id = output_ids[i];
+ break;
+ }
+ }
+ }
+
+ if (output_ids)
+ free (output_ids);
+ 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()
+{
+ m_output_id output_id = 0;
+ int ret;
+
+ output_id = sample_get_output_id("HDMI");
+
+ ret = eom_set_output_attribute(output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL);
+ if (ret != EOM_ERROR_NONE)
+ {
+ //Attribute set fail. Cannot use external output device. Deinitializing.
+ eom_deinit ();
+ return -1;
+ }
+ 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()
+{
+ Evas_Object *window;
+ window = elm_win_add(NULL, "external_window", ELM_WIN_BASIC);
+ if (eom_set_output_window(output_id, window) == EOM_ERROR_NONE)
+ return 0;
+ else
+ {
+ evas_object_del (window);
+ return -1;
+ }
+}
+ </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
+{
+ EOM_OUTPUT_MODE_NONE,
+ EOM_OUTPUT_MODE_MIRROR,
+ EOM_OUTPUT_MODE_PRESENTATION,
+ 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
+{
+ EOM_OUTPUT_ATTRIBUTE_STATE_NONE,
+ EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE,
+ EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE,
+ EOM_OUTPUT_ATTRIBUTE_STATE_LOST,
+ 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
+{
+ Evas_Object *external_window;
+ int output_id;
+} SampleInfo;
+
+static void
+sample_notify_cb_output_add (eom_output_id output_id, void *user_data)
+{
+ SampleInfo *info = (SampleInfo*)user_data;
+ if (!info->external_window)
+ {
+ //make external window
+ make_external_window(info->external_window);
+ }
+}
+
+static void
+sample_notify_cb_output_remove (eom_output_id output_id, void *user_data)
+{
+ SampleInfo *info = (SampleInfo*)user_data;
+ if (!info->external_window)
+ {
+ evas_object_del (info->external_window)
+ info->external_window = NULL;
+ }
+}
+
+static void
+sample_notify_cb_attribute_changed (eom_output_id output_id, void *user_data)
+{
+ SampleInfo *info = (SampleInfo*)user_data;
+ eom_output_attribute_e attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
+ eom_output_attribute_state_e state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
+
+ eom_get_output_attribute(output_id, &attribute);
+ eom_get_output_attribute_satate(output_id, &state);
+
+ if (state == EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE)
+ {
+ //start displaying image to external output(info->external_window);
+ }
+ else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE)
+ {
+ //stop displaying image
+ //destory external_window
+ if (info->external_window)
+ {
+ evas_object_del (info->external_window);
+ info->external_window = NULL;
+ }
+ }
+ else if (state == EOM_OUTPUT_ATTRIBUTE_STATE_LOST)
+ {
+ //stop displaying image
+ //destory external_window
+ if (info->external_window)
+ {
+ evas_object_del (info->external_window);
+ info->external_window = NULL;
+ }
+ //remove callback
+ eom_unset_output_added_cb(sample_notify_cb_output_add);
+ eom_unset_output_removed_cb(sample_notify_cb_output_remove);
+ eom_unset_attribute_changed_cb(sample_notify_cb_attribute_changed);
+ eom_deinit ();
+ }
+}
+
+int elm_main()
+{
+ SampleInfo *info;
+ eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE;
+ int ret;
+
+ info = calloc(sizeof(SampleInfo));
+
+ eom_init ();
+ info->output_id = sample_get_output_id ("HDMI");
+
+ ret = eom_set_output_attribute(info->hdmi_output_id, EOM_OUTPUT_ATTRIBUTE_NORMAL);
+ if (ret != EOM_ERROR_NONE)
+ {
+ //cannot use external output device
+ eom_deinit ();
+ }
+ else
+ {
+ eom_get_output_mode(info->output_id, &output_mode);
+ if (output_mode != EOM_OUTPUT_MODE_NONE)
+ {
+ //make external window
+ make_external_window(info->external_window);
+ }
+
+ //add callback
+ eom_set_output_added_cb(sample_notify_cb_output_add, info);
+ eom_set_output_removed_cb(sample_notify_cb_output_remove, info);
+ eom_set_attribute_changed_cb(sample_notify_cb_attribute_changed, info);
+ }
+
+ elm_run();
+
+ //remove callback
+ eom_unset_output_added_cb(sample_notify_cb_output_add);
+ eom_unset_output_removed_cb(sample_notify_cb_output_remove);
+ eom_unset_attribute_changed_cb(sample_notify_cb_attribute_changed);
+ eom_deinit ();
+ elm_shutdown();
+ 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>