remove x11 dependencies 86/94586/3
authorRoman Peresipkyn <r.peresipkyn@samsung.com>
Mon, 31 Oct 2016 14:30:16 +0000 (16:30 +0200)
committerRoman Peresypkin <r.peresipkyn@samsung.com>
Tue, 1 Nov 2016 13:44:05 +0000 (06:44 -0700)
Change-Id: If4109fd8c90bb60a17a7a75bfc8547c67fba3525
Signed-off-by: Roman Peresipkyn <r.peresipkyn@samsung.com>
17 files changed:
configure.ac
packaging/libeom.spec
protocol/eom-client-protocol.h [new file with mode: 0644]
protocol/eom-protocol.c [new file with mode: 0644]
protocol/eom.xml [new file with mode: 0644]
src/Makefile.am
src/dbus/eom-connect.c [deleted file]
src/dbus/eom-dbus.c [deleted file]
src/dbus/eom-dbus.h [deleted file]
src/eom-wayland.c [new file with mode: 0644]
src/eom-wayland.h [new file with mode: 0644]
src/eom.c
src/wayland/eom-wayland.c [deleted file]
src/wayland/eom-wayland.h [deleted file]
src/wayland/protocol/eom-client-protocol.h [deleted file]
src/wayland/protocol/eom-protocol.c [deleted file]
src/wayland/protocol/eom.xml [deleted file]

index 69650db06888b40ae2db54de22187d40f58973f4..9f7e30d948bc1c2821030d6ed45b1e659dfdafe5 100755 (executable)
@@ -51,18 +51,6 @@ AC_FUNC_ALLOCA
 # Enable quiet compiles on automake 1.11.
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
-# set the window system platform where the bufmgr initializes
-AC_ARG_WITH(eom-platform, AS_HELP_STRING([--with-eom-platform=WINSYS], [eom platform (default: X11)]),
-                               [ EOM_PLATFORM="$withval" ],
-                               [ EOM_PLATFORM="X11" ])
-AC_SUBST(EOM_PLATFORM)
-
-
-AC_ARG_WITH(tizen-version, AS_HELP_STRING([--with-tizen-version=T_VERSION], [eom platform (default: TIZEN_2_X)]),
-                               [ TIZEN_VERSION="$withval" ],
-                               [ TIZEN_VERSION="TIZEN_2_X" ])
-AC_SUBST(TIZEN_VERSION)
-
 AC_ARG_WITH(utest, AS_HELP_STRING([--with-utest=yes/no], [whether build/run unit tests or not]),
                                [ utest="$withval" ],
                                [ utest="no" ])
@@ -70,32 +58,25 @@ AC_ARG_WITH(utest, AS_HELP_STRING([--with-utest=yes/no], [whether build/run unit
 AM_CONDITIONAL(HAVE_UTEST, test "x$utest" = "xyes")
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(DBUS, dbus-1)
 PKG_CHECK_MODULES(GLIB, glib-2.0 gobject-2.0)
 PKG_CHECK_MODULES(ELEMENTARY, elementary)
 
 LIBEOM_CFLAGS="$DBUS_CFLAGS $GLIB_CFLAGS $ELEMENTARY_CFLAGS "
 LIBEOM_LIBS="$DBUS_LIBS $GLIB_LIBS $ELEMENTARY_LIBS "
 
-if test "x$EOM_PLATFORM" = "xX11"; then
-    LIBEOM_CFLAGS="$LIBEOM_CFLAGS "
-    LIBEOM_LIBS="$LIBEOM_LIBS "
-fi
 
-if test "x$EOM_PLATFORM" = "xWAYLAND"; then
-    PKG_CHECK_MODULES(WAYLAND_CLIENT, wayland-client)
-    PKG_CHECK_MODULES(XDG_SHELL_CLIENT, xdg-shell-client)
-    LIBEOM_CFLAGS="$LIBEOM_CFLAGS $WAYLAND_CLIENT_CFLAGS $XDG_SHELL_CLIENT_CFLAGS"
-    LIBEOM_LIBS="$LIBEOM_LIBS $WAYLAND_CLIENT_LIBS $XDG_SHELL_CLIENT_LIBS"
+PKG_CHECK_MODULES(WAYLAND_CLIENT, wayland-client)
+PKG_CHECK_MODULES(XDG_SHELL_CLIENT, xdg-shell-client)
+LIBEOM_CFLAGS="$LIBEOM_CFLAGS $WAYLAND_CLIENT_CFLAGS $XDG_SHELL_CLIENT_CFLAGS"
+LIBEOM_LIBS="$LIBEOM_LIBS $WAYLAND_CLIENT_LIBS $XDG_SHELL_CLIENT_LIBS"
 
-    PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
-    LIBEOM_CFLAGS="$LIBEOM_CFLAGS $ECORE_WAYLAND_CFLAGS"
-    LIBEOM_LIBS="$LIBEOM_LIBS $ECORE_WAYLAND_LIBS"
+PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
+LIBEOM_CFLAGS="$LIBEOM_CFLAGS $ECORE_WAYLAND_CFLAGS"
+LIBEOM_LIBS="$LIBEOM_LIBS $ECORE_WAYLAND_LIBS"
 
 #      WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
 #    AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
 #                  [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
-fi
 
 
 
@@ -117,23 +98,6 @@ fi
 AC_SUBST([LIBEOM_CFLAGS])
 AC_SUBST([LIBEOM_LIBS])
 
-if test "x$EOM_PLATFORM" = "xX11"; then
-       AC_DEFINE(HAVE_X11,1,[The window system is X11.])
-else
-       AC_DEFINE(HAVE_WAYLAND,1,[The window system is WAYLAND.])
-fi
-
-AM_CONDITIONAL(HAVE_EOM_PLATFORM_X11, test "x$EOM_PLATFORM" = "xX11")
-AM_CONDITIONAL(HAVE_EOM_PLATFORM_WAYLAND, test "x$EOM_PLATFORM" = "xWAYLAND")
-
-if test "x$TIZEN_VERSION" = "xTIZEN_2_X"; then
-       AC_DEFINE(HAVE_TIZEN_2_X,1,[tizen version is 2.x.])
-fi
-
-AM_CONDITIONAL(HAVE_TIZEN_VERSION_2_X, test "x$TIZEN_VERSION" = "xTIZEN_2_X")
-
-
-
 # Checks for header files.
 AC_HEADER_STDC
 
index e42757283413f11088238de915c1f87ec51b06ab..f9abebd1ff6fe99cc6f06f4863601ed4e3039bbc 100644 (file)
@@ -1,5 +1,3 @@
-%bcond_with x
-%bcond_with wayland
 %bcond_with utest
 
 Name: libeom
@@ -11,14 +9,10 @@ License: MIT
 Source0: %{name}-%{version}.tar.gz
 Source1001:    %name.manifest
 
-%if %{with wayland}
 BuildRequires:  pkgconfig(wayland-client)
 BuildRequires:  pkgconfig(ecore-wayland)
 BuildRequires:  pkgconfig(xdg-shell-client)
-%else
-%endif
 BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(gio-unix-2.0)
 BuildRequires:  pkgconfig(capi-base-common)
@@ -55,15 +49,7 @@ UTEST="no"
 UTEST="yes"
 %endif
 
-%if %{with wayland}
-%reconfigure --disable-dlog --disable-static --with-eom-platform=WAYLAND --with-utest=${UTEST}
-%else
-%if 0%{?tizen_version_major} == 2
-%reconfigure --disable-dlog --disable-static --with-eom-platform=X11 --with-tizen-version=TIZEN_2_X --with-utest=${UTEST}
-%else
-%reconfigure --disable-dlog --disable-static --with-eom-platform=X11 --with-tizen-version=TIZEN_3_X --with-utest=${UTEST}
-%endif
-%endif
+%reconfigure --disable-dlog --disable-static --with-utest=${UTEST}
 
 make %{?_smp_mflags}
 
diff --git a/protocol/eom-client-protocol.h b/protocol/eom-client-protocol.h
new file mode 100644 (file)
index 0000000..c88784e
--- /dev/null
@@ -0,0 +1,379 @@
+/*
+ * Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this
+ * software and its documentation for any purpose is hereby granted
+ * without fee, provided that\n the above copyright notice appear in
+ * all copies and that both that copyright notice and this permission
+ * notice appear in supporting documentation, and that the name of
+ * the copyright holders not be used in advertising or publicity
+ * pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+
+#ifndef WL_EOM_CLIENT_PROTOCOL_H
+#define WL_EOM_CLIENT_PROTOCOL_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct wl_eom;
+struct wl_shell_surface;
+struct xdg_surface;
+
+extern const struct wl_interface wl_eom_interface;
+
+#ifndef WL_EOM_ERROR_ENUM
+#define WL_EOM_ERROR_ENUM
+enum wl_eom_error {
+       WL_EOM_ERROR_NONE = 0,
+       WL_EOM_ERROR_NO_OUTPUT = 1,
+       WL_EOM_ERROR_NO_ATTRIBUTE = 2,
+       WL_EOM_ERROR_OUTPUT_OCCUPIED = 3,
+};
+#endif /* WL_EOM_ERROR_ENUM */
+
+#ifndef WL_EOM_TYPE_ENUM
+#define WL_EOM_TYPE_ENUM
+/**
+ * wl_eom_type - connector type
+ * @WL_EOM_TYPE_NONE: none
+ * @WL_EOM_TYPE_VGA: VGA output connector type
+ * @WL_EOM_TYPE_DVII: DVI-I output connector type
+ * @WL_EOM_TYPE_DVID: DVI-D output connector type
+ * @WL_EOM_TYPE_DVIA: DVI-A output connector type
+ * @WL_EOM_TYPE_COMPOSITE: Composite output connector type
+ * @WL_EOM_TYPE_SVIDEO: S-Video output connector type
+ * @WL_EOM_TYPE_LVDS: LVDS output connector type
+ * @WL_EOM_TYPE_COMPONENT: Component output connector type
+ * @WL_EOM_TYPE_9PINDIN: 9 pin DIN output connector type
+ * @WL_EOM_TYPE_DISPLAYPORT: DisplayPort output connector type
+ * @WL_EOM_TYPE_HDMIA: HDMI type A output connector type
+ * @WL_EOM_TYPE_HDMIB: HDMI type B output connector type
+ * @WL_EOM_TYPE_TV: TV output connector type
+ * @WL_EOM_TYPE_EDP: eDP output connector type
+ * @WL_EOM_TYPE_VIRTUAL: Virtual output connector type
+ * @WL_EOM_TYPE_DSI: DSI output connector type
+ *
+ * Define several connectors type of the external outputs
+ */
+enum wl_eom_type {
+       WL_EOM_TYPE_NONE = 0,
+       WL_EOM_TYPE_VGA = 1,
+       WL_EOM_TYPE_DVII = 2,
+       WL_EOM_TYPE_DVID = 3,
+       WL_EOM_TYPE_DVIA = 4,
+       WL_EOM_TYPE_COMPOSITE = 5,
+       WL_EOM_TYPE_SVIDEO = 6,
+       WL_EOM_TYPE_LVDS = 7,
+       WL_EOM_TYPE_COMPONENT = 8,
+       WL_EOM_TYPE_9PINDIN = 9,
+       WL_EOM_TYPE_DISPLAYPORT = 10,
+       WL_EOM_TYPE_HDMIA = 11,
+       WL_EOM_TYPE_HDMIB = 12,
+       WL_EOM_TYPE_TV = 13,
+       WL_EOM_TYPE_EDP = 14,
+       WL_EOM_TYPE_VIRTUAL = 15,
+       WL_EOM_TYPE_DSI = 16,
+};
+#endif /* WL_EOM_TYPE_ENUM */
+
+#ifndef WL_EOM_STATUS_ENUM
+#define WL_EOM_STATUS_ENUM
+/**
+ * wl_eom_status - connection status of the external output
+ * @WL_EOM_STATUS_NONE: none
+ * @WL_EOM_STATUS_CONNECTION: output connected
+ * @WL_EOM_STATUS_DISCONNECTION: output disconnected
+ *
+ * The status of external output is connected or not.
+ */
+enum wl_eom_status {
+       WL_EOM_STATUS_NONE = 0,
+       WL_EOM_STATUS_CONNECTION = 1,
+       WL_EOM_STATUS_DISCONNECTION = 2,
+};
+#endif /* WL_EOM_STATUS_ENUM */
+
+#ifndef WL_EOM_MODE_ENUM
+#define WL_EOM_MODE_ENUM
+/**
+ * wl_eom_mode - mode of the external output
+ * @WL_EOM_MODE_NONE: none
+ * @WL_EOM_MODE_MIRROR: mirror mode
+ * @WL_EOM_MODE_PRESENTATION: presentation mode
+ *
+ * There are two modes for external output. Mirror mode is showing main
+ * display screen to external output. Presentation mode is showing app's
+ * specific buffer contents to external output.
+ */
+enum wl_eom_mode {
+       WL_EOM_MODE_NONE = 0,
+       WL_EOM_MODE_MIRROR = 1,
+       WL_EOM_MODE_PRESENTATION = 2,
+};
+#endif /* WL_EOM_MODE_ENUM */
+
+#ifndef WL_EOM_ATTRIBUTE_ENUM
+#define WL_EOM_ATTRIBUTE_ENUM
+/**
+ * wl_eom_attribute - attribute of the external output
+ * @WL_EOM_ATTRIBUTE_NONE: none
+ * @WL_EOM_ATTRIBUTE_NORMAL: nomal attribute
+ * @WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE: exclusive share attribute
+ * @WL_EOM_ATTRIBUTE_EXCLUSIVE: exclusive attribute
+ *
+ * Application can use external output by attribute.
+ *
+ * If application succeed to set attribute and set external output window,
+ * the external output's mode will be changed to Presentation mode.
+ *
+ * Attribute has priority. If attribute is set to normal, it can be changed
+ * by normal, exclusive_share, exclusive. If attribute is set to
+ * exclusive_share, it can be changed by exclusive_share, exclusive. If
+ * attribute is set to exclusive, it cannot be changed by other
+ * application. If application which set attribute is quit or set to none,
+ * the mode will be changed to Mirror if connected.
+ */
+enum wl_eom_attribute {
+       WL_EOM_ATTRIBUTE_NONE = 0,
+       WL_EOM_ATTRIBUTE_NORMAL = 1,
+       WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE = 2,
+       WL_EOM_ATTRIBUTE_EXCLUSIVE = 3,
+};
+#endif /* WL_EOM_ATTRIBUTE_ENUM */
+
+#ifndef WL_EOM_ATTRIBUTE_STATE_ENUM
+#define WL_EOM_ATTRIBUTE_STATE_ENUM
+/**
+ * wl_eom_attribute_state - state of the external output attribute
+ * @WL_EOM_ATTRIBUTE_STATE_NONE: none
+ * @WL_EOM_ATTRIBUTE_STATE_ACTIVE: attribute is active on the output
+ * @WL_EOM_ATTRIBUTE_STATE_INACTIVE: attribute is inactive on the output
+ * @WL_EOM_ATTRIBUTE_STATE_LOST: the connection of output is lost
+ *
+ * It means the state of attribute. The applicatoin which set attribute
+ * successful can get state.
+ *
+ * Active means the external window is set to external output succefully.
+ * So application can use that window. Inactive means cannot use external
+ * output, because of dissconnecting or some other reasons. But if
+ * connected again, the application can use external output. Lost means the
+ * application is lost it's right to external output by other application's
+ * attribute set.
+ */
+enum wl_eom_attribute_state {
+       WL_EOM_ATTRIBUTE_STATE_NONE = 0,
+       WL_EOM_ATTRIBUTE_STATE_ACTIVE = 1,
+       WL_EOM_ATTRIBUTE_STATE_INACTIVE = 2,
+       WL_EOM_ATTRIBUTE_STATE_LOST = 3,
+};
+#endif /* WL_EOM_ATTRIBUTE_STATE_ENUM */
+
+/**
+ * wl_eom - an interface for external outputs
+ * @output_count: external output count
+ * @output_info: 
+ * @output_type: output type and connection info
+ * @output_mode: output mode info
+ * @output_attribute: output attribute info
+ * @output_set_window: reslut of set_window
+ *
+ * An interface to get information of external outputs and to use
+ * external outputs.
+ */
+struct wl_eom_listener {
+       /**
+        * output_count - external output count
+        * @count: (none)
+        *
+        * Get the number of external output devices that are supported
+        * by this device.
+        */
+       void (*output_count)(void *data,
+                            struct wl_eom *wl_eom,
+                            uint32_t count);
+       /**
+        * output_info - 
+        * @output_id: (none)
+        * @type: (none)
+        * @mode: (none)
+        * @w: (none)
+        * @h: (none)
+        * @w_mm: (none)
+        * @h_mm: (none)
+        * @connection: (none)
+        * @skip: (none)
+        * @attribute: (none)
+        * @attribute_state: (none)
+        * @error: (none)
+        *
+        * Send information of specific external output to client.
+        *
+        * Output_id is numbering of external outputs. It is fixed when
+        * booting time. The type, mode attribute, attribute_state is
+        * mentioned above. The w and h is the resolution of external
+        * output. The w_mm and h_mm is the physical size of external
+        * output. The unit is mm.
+        */
+       void (*output_info)(void *data,
+                           struct wl_eom *wl_eom,
+                           uint32_t output_id,
+                           uint32_t type,
+                           uint32_t mode,
+                           uint32_t w,
+                           uint32_t h,
+                           uint32_t w_mm,
+                           uint32_t h_mm,
+                           uint32_t connection,
+                           uint32_t skip,
+                           uint32_t attribute,
+                           uint32_t attribute_state,
+                           uint32_t error);
+       /**
+        * output_type - output type and connection info
+        * @output_id: (none)
+        * @type: (none)
+        * @status: (none)
+        *
+        * Send information of output type and connection.
+        */
+       void (*output_type)(void *data,
+                           struct wl_eom *wl_eom,
+                           uint32_t output_id,
+                           uint32_t type,
+                           uint32_t status);
+       /**
+        * output_mode - output mode info
+        * @output_id: (none)
+        * @mode: (none)
+        *
+        * Send information of output mode.
+        */
+       void (*output_mode)(void *data,
+                           struct wl_eom *wl_eom,
+                           uint32_t output_id,
+                           uint32_t mode);
+       /**
+        * output_attribute - output attribute info
+        * @output_id: (none)
+        * @attribute: (none)
+        * @attribute_state: (none)
+        * @error: (none)
+        *
+        * Send information of output attribute and attribute state.
+        */
+       void (*output_attribute)(void *data,
+                                struct wl_eom *wl_eom,
+                                uint32_t output_id,
+                                uint32_t attribute,
+                                uint32_t attribute_state,
+                                uint32_t error);
+       /**
+        * output_set_window - reslut of set_window
+        * @output_id: (none)
+        * @error: (none)
+        *
+        * Send the result of set_window to client.
+        */
+       void (*output_set_window)(void *data,
+                                 struct wl_eom *wl_eom,
+                                 uint32_t output_id,
+                                 uint32_t error);
+};
+
+static inline int
+wl_eom_add_listener(struct wl_eom *wl_eom,
+                   const struct wl_eom_listener *listener, void *data)
+{
+       return wl_proxy_add_listener((struct wl_proxy *) wl_eom,
+                                    (void (**)(void)) listener, data);
+}
+
+#define WL_EOM_SET_ATTRIBUTE   0
+#define WL_EOM_SET_XDG_WINDOW  1
+#define WL_EOM_SET_SHELL_WINDOW        2
+#define WL_EOM_GET_OUTPUT_INFO 3
+
+#define WL_EOM_SET_ATTRIBUTE_SINCE_VERSION     1
+#define WL_EOM_SET_XDG_WINDOW_SINCE_VERSION    1
+#define WL_EOM_SET_SHELL_WINDOW_SINCE_VERSION  1
+#define WL_EOM_GET_OUTPUT_INFO_SINCE_VERSION   1
+
+static inline void
+wl_eom_set_user_data(struct wl_eom *wl_eom, void *user_data)
+{
+       wl_proxy_set_user_data((struct wl_proxy *) wl_eom, user_data);
+}
+
+static inline void *
+wl_eom_get_user_data(struct wl_eom *wl_eom)
+{
+       return wl_proxy_get_user_data((struct wl_proxy *) wl_eom);
+}
+
+static inline uint32_t
+wl_eom_get_version(struct wl_eom *wl_eom)
+{
+       return wl_proxy_get_version((struct wl_proxy *) wl_eom);
+}
+
+static inline void
+wl_eom_destroy(struct wl_eom *wl_eom)
+{
+       wl_proxy_destroy((struct wl_proxy *) wl_eom);
+}
+
+static inline void
+wl_eom_set_attribute(struct wl_eom *wl_eom, uint32_t output_id, uint32_t attribute)
+{
+       wl_proxy_marshal((struct wl_proxy *) wl_eom,
+                        WL_EOM_SET_ATTRIBUTE, output_id, attribute);
+}
+
+static inline void
+wl_eom_set_xdg_window(struct wl_eom *wl_eom, uint32_t output_id, struct xdg_surface *surface)
+{
+       wl_proxy_marshal((struct wl_proxy *) wl_eom,
+                        WL_EOM_SET_XDG_WINDOW, output_id, surface);
+}
+
+static inline void
+wl_eom_set_shell_window(struct wl_eom *wl_eom, uint32_t output_id, struct wl_shell_surface *surface)
+{
+       wl_proxy_marshal((struct wl_proxy *) wl_eom,
+                        WL_EOM_SET_SHELL_WINDOW, output_id, surface);
+}
+
+static inline void
+wl_eom_get_output_info(struct wl_eom *wl_eom, uint32_t output_id)
+{
+       wl_proxy_marshal((struct wl_proxy *) wl_eom,
+                        WL_EOM_GET_OUTPUT_INFO, output_id);
+}
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/protocol/eom-protocol.c b/protocol/eom-protocol.c
new file mode 100644 (file)
index 0000000..3ca9b25
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this
+ * software and its documentation for any purpose is hereby granted
+ * without fee, provided that\n the above copyright notice appear in
+ * all copies and that both that copyright notice and this permission
+ * notice appear in supporting documentation, and that the name of
+ * the copyright holders not be used in advertising or publicity
+ * pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_shell_surface_interface;
+extern const struct wl_interface xdg_surface_interface;
+
+static const struct wl_interface *types[] = {
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       NULL,
+       &xdg_surface_interface,
+       NULL,
+       &wl_shell_surface_interface,
+};
+
+static const struct wl_message wl_eom_requests[] = {
+       { "set_attribute", "uu", types + 0 },
+       { "set_xdg_window", "uo", types + 12 },
+       { "set_shell_window", "uo", types + 14 },
+       { "get_output_info", "u", types + 0 },
+};
+
+static const struct wl_message wl_eom_events[] = {
+       { "output_count", "u", types + 0 },
+       { "output_info", "uuuuuuuuuuuu", types + 0 },
+       { "output_type", "uuu", types + 0 },
+       { "output_mode", "uu", types + 0 },
+       { "output_attribute", "uuuu", types + 0 },
+       { "output_set_window", "uu", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_eom_interface = {
+       "wl_eom", 1,
+       4, wl_eom_requests,
+       6, wl_eom_events,
+};
+
diff --git a/protocol/eom.xml b/protocol/eom.xml
new file mode 100644 (file)
index 0000000..b1fd312
--- /dev/null
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="wl_eom">
+
+  <copyright>
+    Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
+
+    Permission to use, copy, modify, distribute, and sell this
+    software and its documentation for any purpose is hereby granted
+    without fee, provided that\n the above copyright notice appear in
+    all copies and that both that copyright notice and this permission
+    notice appear in supporting documentation, and that the name of
+    the copyright holders not be used in advertising or publicity
+    pertaining to distribution of the software without specific,
+    written prior permission.  The copyright holders make no
+    representations about the suitability of this software for any
+    purpose.  It is provided "as is" without express or implied
+    warranty.
+
+    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+    THIS SOFTWARE.
+  </copyright>
+
+  <interface name="wl_eom" version="1">
+    <description summary="an interface for external outputs">
+      An interface to get information of external outputs and to use external outputs.
+    </description>
+
+    <enum name="error">
+      <entry name="none" value="0" summary="no error"/>
+      <entry name="no_output" value="1" summary="Given output is invalid."/>
+      <entry name="no_attribute" value="2" summary="Given attribute is invalid."/>
+      <entry name="output_occupied" value="3" summary="The key has been grabbed already."/>
+    </enum>
+
+    <enum name="type">
+      <description summary="connector type">
+        Define several connectors type of the external outputs
+      </description>
+      <entry name="none" value="0" summary="none"/>
+      <entry name="vga" value="1" summary="VGA output connector type"/>
+      <entry name="dvii" value="2" summary="DVI-I output connector type"/>
+      <entry name="dvid" value="3" summary="DVI-D output connector type"/>
+      <entry name="dvia" value="4" summary="DVI-A output connector type"/>
+      <entry name="composite" value="5" summary="Composite output connector type"/>
+      <entry name="svideo" value="6" summary="S-Video output connector type"/>
+      <entry name="lvds" value="7" summary="LVDS output connector type"/>
+      <entry name="component" value="8" summary="Component output connector type"/>
+      <entry name="9pindin" value="9" summary="9 pin DIN output connector type"/>
+      <entry name="displayport" value="10" summary="DisplayPort output connector type"/>
+      <entry name="hdmia" value="11" summary="HDMI type A output connector type"/>
+      <entry name="hdmib" value="12" summary="HDMI type B output connector type"/>
+      <entry name="tv" value="13" summary="TV output connector type"/>
+      <entry name="edp" value="14" summary="eDP output connector type"/>
+      <entry name="virtual" value="15" summary="Virtual output connector type"/>
+      <entry name="dsi" value="16" summary="DSI output connector type"/>
+    </enum>
+
+    <enum name="status">
+      <description summary="connection status of the external output">
+        The status of external output is connected or not.
+      </description>
+      <entry name="none" value="0" summary="none"/>
+      <entry name="connection" value="1" summary="output connected"/>
+      <entry name="disconnection" value="2" summary="output disconnected"/>
+    </enum>
+
+    <enum name="mode">
+      <description summary="mode of the external output">
+        There are two modes for external output.
+        Mirror mode is showing main display screen to external output.
+        Presentation mode is showing app's specific buffer contents to external output.
+      </description>
+      <entry name="none" value="0" summary="none"/>
+      <entry name="mirror" value="1" summary="mirror mode"/>
+      <entry name="presentation" value="2" summary="presentation mode"/>
+    </enum>
+
+    <enum name="attribute">
+      <description summary="attribute of the external output">
+        Application can use external output by attribute.
+
+        If application succeed to set attribute and set external output window,
+        the external output's mode will be changed to Presentation mode.
+
+        Attribute has priority.
+        If attribute is set to normal, it can be changed by normal, exclusive_share, exclusive.
+        If attribute is set to exclusive_share, it can be changed by exclusive_share, exclusive.
+        If attribute is set to exclusive, it cannot be changed by other application.
+        If application which set attribute is quit or set to none,
+        the mode will be changed to Mirror if connected.
+      </description>
+      <entry name="none" value="0" summary="none"/>
+      <entry name="normal" value="1" summary="nomal attribute"/>
+      <entry name="exclusive_share" value="2" summary="exclusive share attribute"/>
+      <entry name="exclusive" value="3" summary="exclusive attribute"/>
+    </enum>
+
+    <enum name="attribute_state">
+      <description summary="state of the external output attribute">
+        It means the state of attribute.
+        The applicatoin which set attribute successful can get state.
+
+        Active means the external window is set to external output succefully.
+        So application can use that window.
+        Inactive means cannot use external output, because of dissconnecting or some other reasons.
+        But if connected again, the application can use external output.
+        Lost means the application is lost it's right to external output by other application's attribute set.
+      </description>
+      <entry name="none" value="0" summary="none"/>
+      <entry name="active" value="1" summary="attribute is active on the output"/>
+      <entry name="inactive" value="2" summary="attribute is inactive on the output"/>
+      <entry name="lost" value="3" summary="the connection of output is lost"/>
+    </enum>
+
+    <request name="set_attribute">
+      <description summary="api to set attribute to specific external output">
+        Application can have right to external output by set_attribute.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="attribute" type="uint"/>
+    </request>
+
+    <request name="set_xdg_window">
+      <description summary="set xdg surface to external window">
+        Use xdg_shell_surface to external output.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="surface" type="object" interface="xdg_surface" allow-null="false"/>
+    </request>
+
+    <request name="set_shell_window">
+      <description summary="">
+        Use shell_surface to external output.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="surface" type="object" interface="wl_shell_surface" allow-null="false"/>
+    </request>
+
+    <request name="get_output_info">
+      <description summary="get information of external output">
+        Request to server to send information of specific external output to client by output id.
+      </description>
+      <arg name="output_id" type="uint"/>
+    </request>
+
+    <event name="output_count">
+      <description summary="external output count">
+        Get the number of external output devices that are supported by this device.
+      </description>
+      <arg name="count" type="uint"/>
+    </event>
+
+    <event name="output_info">
+      <description summary="">
+        Send information of specific external output to client.
+
+        Output_id is numbering of external outputs. It is fixed when booting time.
+        The type, mode attribute, attribute_state is mentioned above.
+        The w and h is the resolution of external output.
+        The w_mm and h_mm is the physical size of external output. The unit is mm.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="type" type="uint"/>
+      <arg name="mode" type="uint"/>
+      <arg name="w" type="uint"/>
+      <arg name="h" type="uint"/>
+      <arg name="w_mm" type="uint"/>
+      <arg name="h_mm" type="uint"/>
+      <arg name="connection" type="uint"/>
+      <arg name="skip" type="uint"/>
+      <arg name="attribute" type="uint"/>
+      <arg name="attribute_state" type="uint"/>
+      <arg name="error" type="uint"/>
+    </event>
+
+    <event name="output_type">
+      <description summary="output type and connection info">
+        Send information of output type and connection.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="type" type="uint"/>
+      <arg name="status" type="uint"/>
+    </event>
+
+    <event name="output_mode">
+      <description summary="output mode info">
+        Send information of output mode.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="mode" type="uint"/>
+    </event>
+
+    <event name="output_attribute">
+      <description summary="output attribute info">
+        Send information of output attribute and attribute state.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="attribute" type="uint"/>
+      <arg name="attribute_state" type="uint"/>
+      <arg name="error" type="uint"/>
+    </event>
+
+    <event name="output_set_window">
+      <description summary="reslut of set_window">
+        Send the result of set_window to client.
+      </description>
+      <arg name="output_id" type="uint"/>
+      <arg name="error" type="uint"/>
+    </event>
+
+  </interface>
+
+</protocol>
index cb541d617ade2394276046dfc0d143ca8af2d834..c8579b3035750af12316fcab504da753c2932792 100755 (executable)
@@ -32,28 +32,13 @@ libeom_la_CFLAGS = \
     ${CFLAGS} \
     @LIBEOM_CFLAGS@ \
     -I$(top_srcdir)/include \
-    -I$(top_srcdir)/src
+    -I$(top_srcdir)/src \
+       -I$(top_srcdir)/protocol
 
 libeom_la_SOURCES = \
-       eom.c
-
-if HAVE_EOM_PLATFORM_X11
-libeom_la_CFLAGS += \
-       -I$(top_srcdir)/src/dbus
-
-libeom_la_SOURCES += \
-       dbus/eom-dbus.c
-endif
-
-if HAVE_EOM_PLATFORM_WAYLAND
-libeom_la_CFLAGS += \
-       -I$(top_srcdir)/src/wayland \
-       -I$(top_srcdir)/src/wayland/protocol
-
-libeom_la_SOURCES += \
-       wayland/protocol/eom-protocol.c \
-       wayland/eom-wayland.c
-endif
+       eom.c \
+       eom-wayland.c \
+       ../protocol/eom-protocol.c
 
 
 
diff --git a/src/dbus/eom-connect.c b/src/dbus/eom-connect.c
deleted file mode 100644 (file)
index bcd71c9..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/**************************************************************************
- *
- * eom (external output manager)
- *
- * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Contact:
- * SooChan Lim <sc1.lim@samsung.com>
- * Boram Park <boram1288.park@samsung.com>
- * Changyeon Lee <cyeon.lee@samsung.com>
- * JunKyeong Kim <jk0430.kim@samsung.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
-**************************************************************************/
-#include <config.h>
-
-#include "eom.h"
-#include "eom-log.h"
-#include "eom-dbus.h"
-#include "eom-connect.h"
-#include "eom-private.h"
-
-API int
-eom_output_set_mode(eom_output_id output_id, eom_output_mode_e mode)
-{
-       bool ret = false;
-       GValueArray *msg_array;
-       GValueArray *ret_array;
-       GValue v = G_VALUE_INIT;
-
-       RETV_IF_FAIL(mode < EOM_OUTPUT_MODE_MAX, EOM_ERROR_INVALID_PARAMETER);
-
-       _eom_mutex_lock();
-
-       INFO("mode: %d\n", mode);
-
-       msg_array = g_value_array_new(0);
-
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, output_id);
-       msg_array = g_value_array_append(msg_array, &v);
-       g_value_set_int(&v, mode);
-       msg_array = g_value_array_append(msg_array, &v);
-
-       ret_array = eom_dbus_client_send_message("SetMode", msg_array);
-       g_value_array_free(msg_array);
-       if (!ret_array) {
-               _eom_mutex_unlock();
-               return EOM_ERROR_MESSAGE_SENDING_FAILURE;
-       }
-
-       ret = g_value_get_int(g_value_array_get_nth(ret_array, 0));
-
-       g_value_array_free(ret_array);
-
-       INFO("SetMode: %s", (ret) ? "success" : "failed");
-
-       _eom_mutex_unlock();
-
-       return (ret) ? EOM_ERROR_NONE : EOM_ERROR_MESSAGE_OPERATION_FAILURE;
-}
-
diff --git a/src/dbus/eom-dbus.c b/src/dbus/eom-dbus.c
deleted file mode 100755 (executable)
index bd4b073..0000000
+++ /dev/null
@@ -1,727 +0,0 @@
-/**************************************************************************
- *
- * eom (external output manager)
- *
- * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Contact:
- * SooChan Lim <sc1.lim@samsung.com>
- * Boram Park <boram1288.park@samsung.com>
- * Changyeon Lee <cyeon.lee@samsung.com>
- * JunKyeong Kim <jk0430.kim@samsung.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
-**************************************************************************/
-
-#include <config.h>
-#include <dbus/dbus.h>
-#include <string.h>
-#include "eom.h"
-#include "eom-log.h"
-#include "eom-dbus.h"
-#include "eom-private.h"
-
-#define EOM_DBUS_SERVER     "org.eom.server"
-#define EOM_DBUS_CLIENT     "org.eom.client"
-#define EOM_DBUS_INTERFACE  "org.eom.interface"
-#define EOM_DBUS_PATH       "/org/eom/path"
-
-#define STR_LEN 128
-
-#define REPLY_TIME  1000
-#define ARGV_NUM    64
-
-typedef struct _EomDBusClientMethod {
-       char name[STR_LEN];
-       notify_func func;
-       void *data;
-       struct _EomDBusClientMethod *next;
-} EomDBusClientMethod;
-
-typedef struct _EomDBusClientInfo {
-       DBusConnection *conn;
-       char name[STR_LEN];
-       char rule[STR_LEN];
-       GSource *src;
-       EomDBusClientMethod *methods;
-       int fd;
-} EomDBusClientInfo;
-
-static EomDBusClientInfo client_info;
-
-static bool dbus_initialized;
-static EomDBusClientMethod dbus_method;
-
-static void _eom_dbus_client_deinitialize(EomDBusClientInfo *info);
-
-static int
-_eom_dbus_need_private_conn(void)
-{
-       char *env = getenv("EOM_PRIVATE_CONN");
-
-       if (env) {
-               return (atoi(env) > 0) ? 1 : 0;
-               INFO("EOM_PRIVATE_CONN = %s", env);
-       }
-
-       return 0;
-}
-
-static int
-_eom_dbus_convert_gvalue_to_message(GArray *array, DBusMessage *msg)
-{
-       DBusMessageIter iter;
-       GValue *v = NULL;
-       GType type;
-       int i;
-
-       if (!array)
-               return 1;
-
-       if (array->len <= 0)
-               return 1;
-
-       dbus_message_iter_init_append(msg, &iter);
-
-       INFO("[EOM_CLIENT:%s] len(%d)", client_info.name, array->len);
-
-       for (i = 0; i < array->len; i++) {
-               v = &g_array_index(array, GValue, i);
-               type = v->g_type;
-
-               INFO("[EOM_CLIENT:%s] type(%d)", client_info.name, (int)type);
-
-               switch (type) {
-               case G_TYPE_INT:
-               {
-                       int integer = g_value_get_int(v);
-
-                       if (!dbus_message_iter_append_basic(&iter,
-                               DBUS_TYPE_INT32, &integer)) {
-                               ERR("[EOM_CLIENT:%s] failed: int append",
-                                       client_info.name);
-                               return 0;
-                       }
-               }
-                       break;
-               case G_TYPE_UINT:
-               {
-                       unsigned int uinteger = g_value_get_uint(v);
-
-                       if (!dbus_message_iter_append_basic(&iter,
-                               DBUS_TYPE_UINT32, &uinteger)) {
-                               ERR("[EOM_CLIENT:%s] failed: uint append",
-                                       client_info.name);
-                               return 0;
-                       }
-               }
-                       break;
-               case G_TYPE_STRING:
-               {
-                       char *string = (char *)g_value_get_string(v);
-
-                       if (!dbus_message_iter_append_basic(&iter,
-                               DBUS_TYPE_STRING, (void *)&string)) {
-                               ERR("[EOM_CLIENT:%s] failed: uint append",
-                                       client_info.name);
-                               return 0;
-                       }
-               }
-                       break;
-               case G_TYPE_VARIANT:
-               {
-                       GVariant *variant = g_value_get_variant(v);
-                       int data_size = g_variant_get_size(variant);
-                       void *data = (void *)g_variant_get_data(variant);
-                       DBusMessageIter sub;
-
-                       RETV_IF_FAIL(data != NULL, 0);
-                       RETV_IF_FAIL(data_size > 0, 0);
-
-                       dbus_message_iter_open_container(&iter,
-                               DBUS_TYPE_ARRAY, "y", &sub);
-                       if (!dbus_message_iter_append_fixed_array(&sub,
-                               DBUS_TYPE_BYTE, (void *)&data, data_size)) {
-                               ERR("[EOM_CLIENT:%s] failed: uint append",
-                                       client_info.name);
-                               return 0;
-                       }
-                       dbus_message_iter_close_container(&iter, &sub);
-               }
-                       break;
-               default:
-                       return 0;
-               }
-       }
-
-       return 1;
-}
-
-static GArray*
-_eom_dbus_convert_message_to_gvalue(DBusMessage *msg)
-{
-       GArray *array;
-       DBusMessageIter iter;
-
-       if (!dbus_message_iter_init(msg, &iter))
-               return NULL;
-
-       array = g_array_new(FALSE, FALSE, sizeof(GValue));
-
-       do {
-               int type = dbus_message_iter_get_arg_type(&iter);
-               GValue v = G_VALUE_INIT;
-
-               INFO("[EOM_CLIENT:%s] type(%c(%d))",
-                       client_info.name, (char)type, type);
-
-               switch (type) {
-               case DBUS_TYPE_INT32:
-               {
-                       int integer = 0;
-
-                       dbus_message_iter_get_basic(&iter, &integer);
-                       g_value_init(&v, G_TYPE_INT);
-                       g_value_set_int(&v, integer);
-                       array = g_array_append_val(array, v);
-                       g_value_unset(&v);
-               }
-                       break;
-               case DBUS_TYPE_UINT32:
-               {
-                       unsigned int uinteger = 0;
-
-                       dbus_message_iter_get_basic(&iter, &uinteger);
-                       g_value_init(&v, G_TYPE_UINT);
-                       g_value_set_uint(&v, uinteger);
-                       array = g_array_append_val(array, v);
-                       g_value_unset(&v);
-               }
-                       break;
-               case DBUS_TYPE_STRING:
-               {
-                       char *string = NULL;
-
-                       dbus_message_iter_get_basic(&iter, &string);
-                       g_value_init(&v, G_TYPE_STRING);
-                       g_value_set_string(&v, string);
-                       array = g_array_append_val(array, v);
-                       g_value_unset(&v);
-               }
-                       break;
-               default:
-                       NEVER_GET_HERE();
-                       g_array_free(array, FALSE);
-                       return NULL;
-               }
-       } while (dbus_message_iter_has_next(&iter) &&
-               dbus_message_iter_next(&iter));
-
-       return array;
-}
-
-static void
-_eom_dbus_client_process_message(EomDBusClientInfo *info, DBusMessage *msg)
-{
-       EomDBusClientMethod **prev;
-       DBusError err;
-
-       dbus_error_init(&err);
-
-       INFO("[CLIENT] Process a message (%s.%s)",
-               dbus_message_get_interface(msg), dbus_message_get_member(msg));
-
-       RET_IF_FAIL(info->conn != NULL);
-
-       for (prev = &info->methods; *prev; prev = &(*prev)->next) {
-               EomDBusClientMethod *method = *prev;
-
-               if (!strcmp(dbus_message_get_member(msg), method->name)) {
-                       GArray *array =
-                               _eom_dbus_convert_message_to_gvalue(msg);
-
-                       if (method->func)
-                               method->func(method->data, array);
-
-                       if (array)
-                               g_array_free(array, FALSE);
-
-                       dbus_error_free(&err);
-
-                       return;
-               }
-       }
-}
-
-
-gboolean
-_eom_dbus_client_cb(GIOChannel *src, GIOCondition cond, gpointer data)
-{
-       EomDBusClientInfo *info = (EomDBusClientInfo *)data;
-
-       if (!info || !info->conn || info->fd < 0)
-               return false;
-
-       do {
-               if (info->conn)
-                       dbus_connection_read_write_dispatch(info->conn, 0);
-       } while (info->conn &&
-                       dbus_connection_get_is_connected(info->conn) &&
-                       dbus_connection_get_dispatch_status(info->conn) ==
-                       DBUS_DISPATCH_DATA_REMAINS);
-
-       return true;
-}
-
-
-static DBusHandlerResult
-_eom_dbus_client_msg_handler(DBusConnection *connection,
-               DBusMessage *msg, void *data)
-{
-       EomDBusClientInfo *info = (EomDBusClientInfo *)data;
-
-       if (!info || !info->conn || !msg)
-               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
-       INFO("[Client] Got a message (%s.%s)",
-               dbus_message_get_interface(msg), dbus_message_get_member(msg));
-
-       _eom_dbus_client_process_message(info, msg);
-
-       return DBUS_HANDLER_RESULT_HANDLED;
-}
-
-static DBusHandlerResult
-_eom_dbus_client_msg_filter(DBusConnection *conn, DBusMessage *msg, void *data)
-{
-       EomDBusClientInfo *info = (EomDBusClientInfo *)data;
-
-       if (!info)
-               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
-       if (dbus_message_is_signal(msg, DBUS_INTERFACE_LOCAL, "Disconnected")) {
-               INFO("[EOM] disconnected by signal");
-               _eom_dbus_client_deinitialize(info);
-
-               return DBUS_HANDLER_RESULT_HANDLED;
-       }
-
-       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-static int
-_eom_dbus_client_initialize(EomDBusClientInfo *info)
-{
-       DBusError err;
-       int ret;
-       DBusObjectPathVTable vtable = {
-               .message_function = _eom_dbus_client_msg_handler,
-       };
-       GIOChannel *channel;
-
-       dbus_error_init(&err);
-
-       if (_eom_dbus_need_private_conn())
-               info->conn = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
-       else
-               info->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
-
-       if (dbus_error_is_set(&err)) {
-               ERR("[EOM] failed: connection (%s)", err.message);
-               goto free_err;
-       }
-       if (!info->conn) {
-               ERR("[EOM] failed: connection NULL");
-               goto free_err;
-       }
-
-       ret = dbus_bus_request_name(info->conn,
-               info->name, DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
-       if (dbus_error_is_set(&err)) {
-               ERR("[EOM] failed: request name (%s)", err.message);
-               goto free_conn;
-       }
-       if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
-               ERR("[EOM] failed: Not Primary Owner (%d)", ret);
-               goto free_conn;
-       }
-
-       snprintf(info->rule, sizeof(info->rule),
-               "interface='%s'", EOM_DBUS_INTERFACE);
-
-       dbus_bus_add_match(info->conn, info->rule, &err);
-       dbus_connection_flush(info->conn);
-       if (dbus_error_is_set(&err)) {
-               ERR("[EOM] failed: add match (%s)", err.message);
-               goto free_name;
-       }
-
-       if (!dbus_connection_register_object_path(info->conn,
-               EOM_DBUS_PATH, &vtable, info)) {
-               ERR("[EOM] failed: register object path");
-               goto free_match;
-       }
-
-       dbus_connection_set_exit_on_disconnect(info->conn, FALSE);
-
-       if (!dbus_connection_add_filter(info->conn,
-               _eom_dbus_client_msg_filter, info, NULL)) {
-               ERR("[EOM] failed: add filter (%s)", err.message);
-               goto free_register;
-       }
-
-       if (!dbus_connection_get_unix_fd(info->conn,
-               &info->fd) || info->fd < 0) {
-               ERR("[EOM] failed: get fd");
-               goto free_filter;
-       }
-
-       dbus_error_free(&err);
-
-       channel = g_io_channel_unix_new(info->fd);
-       g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL);
-
-       info->src = g_io_create_watch(channel, G_IO_IN);
-       g_source_set_callback(info->src,
-               (GSourceFunc)_eom_dbus_client_cb, (gpointer)info, NULL);
-       g_source_attach(info->src, NULL);
-
-       g_io_channel_unref(channel);
-
-       INFO("[EOM_CLIENT] connected");
-
-       return 1;
-
-free_filter:
-       dbus_connection_remove_filter(info->conn,
-               _eom_dbus_client_msg_filter, info);
-free_register:
-       dbus_connection_unregister_object_path(info->conn, EOM_DBUS_PATH);
-free_match:
-       dbus_bus_remove_match(info->conn, info->rule, &err);
-       dbus_error_free(&err);
-free_name:
-       dbus_bus_release_name(info->conn, info->name, &err);
-       dbus_error_free(&err);
-free_conn:
-       dbus_connection_close(info->conn);
-free_err:
-       dbus_error_free(&err);
-       info->conn = NULL;
-       info->fd = -1;
-
-       return 0;
-}
-
-static void
-_eom_dbus_client_deinitialize(EomDBusClientInfo *info)
-{
-       DBusError err;
-
-       if (!info->conn)
-               return;
-
-       if (info->src) {
-               g_source_destroy(info->src);
-               g_source_unref(info->src);
-       }
-
-       if (info->conn) {
-               dbus_error_init(&err);
-               dbus_bus_remove_match(info->conn, info->rule, &err);
-               dbus_error_free(&err);
-               dbus_bus_release_name(info->conn, info->name, &err);
-               dbus_error_free(&err);
-               dbus_connection_unref(info->conn);
-       }
-
-       memset(info, 0, sizeof(EomDBusClientInfo));
-       info->fd = -1;
-
-       INFO("[EOM] disconnected");
-}
-
-
-static bool
-_eom_dbus_client_connect(void)
-{
-       if (client_info.conn)
-               return true;
-
-       snprintf(client_info.name, STR_LEN, "org.eom.client%d", getpid());
-
-       client_info.fd = -1;
-
-       if (!_eom_dbus_client_initialize(&client_info))
-               return false;
-
-       return true;
-}
-
-static void
-_eom_dbus_client_disconnect(void)
-{
-       _eom_dbus_client_deinitialize(&client_info);
-}
-
-static bool
-_eom_dbus_client_add_method(EomDBusClientMethod *method)
-{
-       EomDBusClientMethod **prev;
-
-       for (prev = &client_info.methods; *prev; prev = &(*prev)->next)
-               ;
-
-       method->next = NULL;
-       *prev = method;
-
-       return true;
-}
-
-static void
-_eom_dbus_client_remove_method(EomDBusClientMethod *method)
-{
-       EomDBusClientMethod **prev;
-
-       for (prev = &client_info.methods; *prev; prev = &(*prev)->next)
-               if (*prev == method) {
-                       *prev = method->next;
-                       method->next = NULL;
-                       break;
-               }
-}
-
-bool
-eom_dbus_client_init(notify_func func)
-{
-       if (dbus_initialized)
-               return true;
-
-       if (!_eom_dbus_client_connect())
-               return false;
-
-       snprintf(dbus_method.name, sizeof(dbus_method.name), "%s", "Notify");
-       dbus_method.func = func;
-       dbus_method.data = NULL;
-       _eom_dbus_client_add_method(&dbus_method);
-
-       dbus_initialized = true;
-
-       INFO("dbus init");
-
-       return true;
-}
-
-void
-eom_dbus_client_deinit(GList *cb_info_list)
-{
-       if (!dbus_initialized)
-               return;
-
-       /* An output instance and a callback can be created
-        * and be added only by user. If there is cb_info_list,
-        * it means that user is still watching and interested
-        * with eom dbus message.
-        */
-       if (cb_info_list)
-               return;
-
-       _eom_dbus_client_remove_method(&dbus_method);
-       _eom_dbus_client_disconnect();
-
-       dbus_initialized = false;
-}
-
-GArray*
-eom_dbus_client_send_message(char *method, GArray *array)
-{
-       DBusMessage *msg = NULL;
-       DBusMessage *reply_msg = NULL;
-       GArray *ret_array = NULL;
-       DBusError err;
-
-       RETV_IF_FAIL(client_info.conn != NULL, NULL);
-
-       dbus_error_init(&err);
-
-       msg = dbus_message_new_method_call(EOM_DBUS_SERVER,
-               EOM_DBUS_PATH, EOM_DBUS_INTERFACE, method);
-       GOTO_IF_FAIL(msg != NULL, err_send);
-
-       INFO("[EOM_CLIENT:%s] Send message(%s)", client_info.name, method);
-
-       if (!_eom_dbus_convert_gvalue_to_message(array, msg)) {
-               ERR("[EOM_CLIENT:%s] failed: gvalue_to_message",
-                       client_info.name);
-               goto err_send;
-       }
-
-       reply_msg = dbus_connection_send_with_reply_and_block(client_info.conn,
-               msg, REPLY_TIME, &err);
-       if (dbus_error_is_set(&err)) {
-               ERR("[EOM_CLIENT:%s] failed: send (%s)",
-                       client_info.name, err.message);
-               goto err_send;
-       }
-       GOTO_IF_FAIL(reply_msg != NULL, err_send);
-
-       INFO("[EOM_CLIENT:%s] Got reply", client_info.name);
-
-       ret_array = _eom_dbus_convert_message_to_gvalue(reply_msg);
-
-       dbus_message_unref(msg);
-       dbus_message_unref(reply_msg);
-       dbus_error_free(&err);
-
-       return ret_array;
-err_send:
-       if (msg)
-               dbus_message_unref(msg);
-       if (reply_msg)
-               dbus_message_unref(reply_msg);
-
-       dbus_error_free(&err);
-
-       return NULL;
-}
-
-
-GArray *
-eom_dbus_client_get_output_ids(void)
-{
-       GArray *array = NULL;
-
-       array = eom_dbus_client_send_message("GetOutputIDs", NULL);
-       RETV_IF_FAIL(array != NULL, NULL);
-
-       return array;
-}
-
-GArray *
-eom_dbus_client_get_output_info(eom_output_id output_id)
-{
-       GArray *array = NULL;
-       GArray *msg_array;
-       GValue v = G_VALUE_INIT;
-
-       msg_array = g_array_new(FALSE, FALSE, sizeof(GValue));
-
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, output_id);
-       msg_array = g_array_append_val(msg_array, v);
-
-       array = eom_dbus_client_send_message("GetOutputInfo", msg_array);
-       GOTO_IF_FAIL(array != NULL, fail);
-
-       g_array_free(msg_array, FALSE);
-
-       return array;
-fail:
-       g_array_free(msg_array, FALSE);
-
-       return NULL;
-}
-
-GArray *
-eom_dbus_client_set_attribute(eom_output_id output_id,
-               eom_output_attribute_e attr)
-{
-       GArray *array = NULL;
-       GArray *msg_array;
-       GValue v = G_VALUE_INIT;
-       int pid = 0;
-
-       pid = getpid();
-
-       INFO("output_id: %d, pid: %d, attr: %d\n", output_id, pid, attr);
-
-       msg_array = g_array_new(FALSE, FALSE, sizeof(GValue));
-
-       /* 0:output_id, 1:pid, 2:eom_attribuete_e */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, output_id);
-       msg_array = g_array_append_val(msg_array, v);
-       g_value_set_int(&v, pid);
-       msg_array = g_array_append_val(msg_array, v);
-       g_value_set_int(&v, attr);
-       msg_array = g_array_append_val(msg_array, v);
-
-       array = eom_dbus_client_send_message("SetOutputAttribute", msg_array);
-       GOTO_IF_FAIL(array != NULL, fail);
-
-       g_array_free(msg_array, FALSE);
-
-       return array;
-fail:
-       g_array_free(msg_array, FALSE);
-
-       return NULL;
-}
-
-GArray *
-eom_dbus_client_set_window(eom_output_id output_id, Evas_Object *win)
-{
-       GArray *array = NULL;
-       GArray *msg_array;
-       GValue v = G_VALUE_INIT;
-       int pid = 0;
-       Ecore_X_Window xwin;
-       int ret = 0;
-
-       pid = getpid();
-       xwin = elm_win_xwindow_get(win);
-
-       INFO("output_id: %d, pid: %d, xwin: %d\n", output_id, pid, xwin);
-
-       msg_array = g_array_new(FALSE, FALSE, sizeof(GValue));
-
-       /* 0:output_id, 1:pid, 2:eom_attribuete_e */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, output_id);
-       msg_array = g_array_append_val(msg_array, v);
-       g_value_set_int(&v, pid);
-       msg_array = g_array_append_val(msg_array, v);
-       g_value_set_int(&v, xwin);
-       msg_array = g_array_append_val(msg_array, v);
-
-       array = eom_dbus_client_send_message("SetWindow", msg_array);
-       RETV_IF_FAIL(array != NULL, NULL);
-
-       g_array_free(msg_array, FALSE);
-
-       ret = g_value_get_int(&g_array_index(array, GValue, 0));
-       GOTO_IF_FAIL(ret != 0, fail);
-
-#ifdef HAVE_TIZEN_2_X
-       const char *profile = "desktop";
-
-       elm_win_profiles_set(win, &profile, 1);
-#endif
-       elm_win_fullscreen_set(win, EINA_TRUE);
-
-       return array;
-fail:
-       g_array_free(msg_array, FALSE);
-
-       return NULL;
-}
-
diff --git a/src/dbus/eom-dbus.h b/src/dbus/eom-dbus.h
deleted file mode 100644 (file)
index d97c5df..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**************************************************************************
- *
- * eom (external output manager)
- *
- * Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Contact:
- * SooChan Lim <sc1.lim@samsung.com>
- * Boram Park <boram1288.park@samsung.com>
- * Changyeon Lee <cyeon.lee@samsung.com>
- * JunKyeong Kim <jk0430.kim@samsung.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
-**************************************************************************/
-
-#ifndef __EOM_DBUS_H__
-#define __EOM_DBUS_H__
-
-#include <stdbool.h>
-#include <glib.h>
-#include <glib-object.h>
-#include "eom.h"
-#include "eom-private.h"
-
-bool eom_dbus_client_init(notify_func func);
-void eom_dbus_client_deinit(GList *cb_info_list);
-
-GArray *eom_dbus_client_get_output_ids(void);
-GArray *eom_dbus_client_get_output_info(eom_output_id output_id);
-GArray *eom_dbus_client_set_attribute(eom_output_id output_id,
-                                       eom_output_attribute_e attry);
-GArray *eom_dbus_client_set_window(eom_output_id output_id, Evas_Object *win);
-
-GArray *eom_dbus_client_send_message(char *method, GArray *array);
-
-#endif /* __EOM_DBUS_H__ */
diff --git a/src/eom-wayland.c b/src/eom-wayland.c
new file mode 100644 (file)
index 0000000..8222aec
--- /dev/null
@@ -0,0 +1,1109 @@
+/**************************************************************************
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+**************************************************************************/
+
+#include <config.h>
+#include "eom.h"
+#include "eom_internal.h"
+#include "eom-log.h"
+#include "eom-wayland.h"
+#include "eom-private.h"
+#include "../protocol/eom-client-protocol.h"
+#include "xdg-shell-client-protocol.h"
+#include <Ecore_Wayland.h>
+
+typedef struct _EomWaylandClientInfo {
+       /* wl */
+       struct wl_display *display;
+       struct wl_registry *registry;
+
+       struct wl_eom *eom;
+
+       /* eom wayland output list */
+       struct wl_list eom_wl_output_list;
+       int num_outputs;
+
+       notify_func func;
+} EomWaylandClientInfo;
+
+typedef struct _EomWaylandOutput {
+       eom_output_id id;
+       struct wl_output *output;
+
+       /* current output data */
+       int32_t x;
+       int32_t y;
+       int32_t physical_width;
+       int32_t physical_height;
+       enum wl_output_subpixel subpixel;
+       const char *make;
+       const char *model;
+       enum wl_output_transform transform;
+
+       uint32_t flags;
+       int32_t width;
+       int32_t height;
+       int32_t refresh;
+
+       int32_t factor;
+
+       /* current eom data */
+       enum wl_eom_type eom_type;
+       enum wl_eom_status eom_status;
+       enum wl_eom_mode eom_mode;
+       enum wl_eom_attribute eom_attribute;
+       enum wl_eom_attribute_state eom_attribute_state;
+       enum wl_eom_error error;
+
+       /* client info */
+       EomWaylandClientInfo *client_info;
+
+       struct wl_list link;
+} EomWaylandOutput;
+
+static EomWaylandClientInfo wl_client_info;
+static int eom_wayland_init;
+/*LCOV_EXCL_START*/
+static eom_output_type_e
+_convert_to_eom_output_type(enum wl_eom_type eom_type)
+{
+       eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN;
+
+       switch (eom_type) {
+       case WL_EOM_TYPE_NONE:
+               output_type = EOM_OUTPUT_TYPE_UNKNOWN;
+               break;
+       case WL_EOM_TYPE_VGA:
+               output_type = EOM_OUTPUT_TYPE_VGA;
+               break;
+       case WL_EOM_TYPE_DVII:
+               output_type = EOM_OUTPUT_TYPE_DVII;
+               break;
+       case WL_EOM_TYPE_DVID:
+               output_type = EOM_OUTPUT_TYPE_DVID;
+               break;
+       case WL_EOM_TYPE_DVIA:
+               output_type = EOM_OUTPUT_TYPE_DVIA;
+               break;
+       case WL_EOM_TYPE_COMPOSITE:
+               output_type = EOM_OUTPUT_TYPE_COMPOSITE;
+               break;
+       case WL_EOM_TYPE_SVIDEO:
+               output_type = EOM_OUTPUT_TYPE_SVIDEO;
+               break;
+       case WL_EOM_TYPE_LVDS:
+               output_type = EOM_OUTPUT_TYPE_LVDS;
+               break;
+       case WL_EOM_TYPE_COMPONENT:
+               output_type = EOM_OUTPUT_TYPE_COMPONENT;
+               break;
+       case WL_EOM_TYPE_9PINDIN:
+               output_type = EOM_OUTPUT_TYPE_9PINDIN;
+               break;
+       case WL_EOM_TYPE_DISPLAYPORT:
+               output_type = EOM_OUTPUT_TYPE_DISPLAYPORT;
+               break;
+       case WL_EOM_TYPE_HDMIA:
+               output_type = EOM_OUTPUT_TYPE_HDMIA;
+               break;
+       case WL_EOM_TYPE_HDMIB:
+               output_type = EOM_OUTPUT_TYPE_HDMIB;
+               break;
+       case WL_EOM_TYPE_TV:
+               output_type = EOM_OUTPUT_TYPE_TV;
+               break;
+       case WL_EOM_TYPE_EDP:
+               output_type = EOM_OUTPUT_TYPE_EDP;
+               break;
+       case WL_EOM_TYPE_VIRTUAL:
+               output_type = EOM_OUTPUT_TYPE_VIRTUAL;
+               break;
+       case WL_EOM_TYPE_DSI:
+               output_type = EOM_OUTPUT_TYPE_DSI;
+               break;
+       default:
+               ERR("no type.");
+               break;
+       }
+
+       return output_type;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static eom_output_mode_e
+_convert_to_eom_output_mode(enum wl_eom_mode eom_mode)
+{
+       eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE;
+
+       switch (eom_mode) {
+       case WL_EOM_MODE_NONE:
+               output_mode = EOM_OUTPUT_MODE_NONE;
+               break;
+       case WL_EOM_MODE_MIRROR:
+               output_mode = EOM_OUTPUT_MODE_MIRROR;
+               break;
+       case WL_EOM_MODE_PRESENTATION:
+               output_mode = EOM_OUTPUT_MODE_PRESENTATION;
+               break;
+       default:
+               ERR("no mode.");
+               break;
+       }
+
+       return output_mode;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static eom_output_attribute_e
+_convert_to_eom_output_attribute(enum wl_eom_attribute eom_attribute)
+{
+       eom_output_attribute_e output_attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
+
+       switch (eom_attribute) {
+       case WL_EOM_ATTRIBUTE_NONE:
+               output_attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
+               break;
+       case WL_EOM_ATTRIBUTE_NORMAL:
+               output_attribute = EOM_OUTPUT_ATTRIBUTE_NORMAL;
+               break;
+       case WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE:
+               output_attribute = EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARE;
+               break;
+       case WL_EOM_ATTRIBUTE_EXCLUSIVE:
+               output_attribute = EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE;
+               break;
+       default:
+               ERR("no attribute.");
+               break;
+       }
+
+       return output_attribute;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static eom_output_attribute_state_e
+_convert_to_eom_output_attribute_state(
+               enum wl_eom_attribute_state eom_attribute_state)
+{
+       eom_output_attribute_state_e output_attribute_state =
+               EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
+
+       switch (eom_attribute_state) {
+       case WL_EOM_ATTRIBUTE_STATE_NONE:
+               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
+               break;
+       case WL_EOM_ATTRIBUTE_STATE_ACTIVE:
+               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE;
+               break;
+       case WL_EOM_ATTRIBUTE_STATE_INACTIVE:
+               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE;
+               break;
+       case WL_EOM_ATTRIBUTE_STATE_LOST:
+               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_LOST;
+               break;
+       default:
+               ERR("no attribute state.");
+               break;
+       }
+
+       return output_attribute_state;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static enum wl_eom_attribute
+_convert_to_wl_eom_attribute(eom_output_attribute_e attr)
+{
+       enum wl_eom_attribute eom_attribute = WL_EOM_ATTRIBUTE_NONE;
+
+       switch (attr) {
+       case EOM_OUTPUT_ATTRIBUTE_NONE:
+               eom_attribute = WL_EOM_ATTRIBUTE_NONE;
+               break;
+       case EOM_OUTPUT_ATTRIBUTE_NORMAL:
+               eom_attribute = WL_EOM_ATTRIBUTE_NORMAL;
+               break;
+       case EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARE:
+               eom_attribute = WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE;
+               break;
+       case EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE:
+               eom_attribute = WL_EOM_ATTRIBUTE_EXCLUSIVE;
+               break;
+       default:
+               ERR("no wl attribute.");
+               break;
+       }
+
+       return eom_attribute;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static void
+_eom_wayland_client_call_notify(EomWaylandOutput *eom_wl_output,
+               eom_output_notify_type_e type)
+{
+       GArray *array = NULL;
+       GValue v = G_VALUE_INIT;
+       int current_pid = getpid();
+
+       array = g_array_new(FALSE, FALSE, sizeof(GValue));
+
+       /* 0: notify_type */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, type);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 1:output_id */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->id);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 2:output_type */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v,
+               _convert_to_eom_output_type(eom_wl_output->eom_type));
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 3:output_mode */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v,
+               _convert_to_eom_output_mode(eom_wl_output->eom_mode));
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 4:w */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->width);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 5:h */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->height);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 6:w_mm */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->physical_width);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 7:h_mm */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->physical_height);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 8:pid */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, current_pid);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 9:attri */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v,
+               _convert_to_eom_output_attribute(eom_wl_output->eom_attribute));
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 10:state */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v,
+               _convert_to_eom_output_attribute_state(
+                       eom_wl_output->eom_attribute_state));
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       if (eom_wl_output->client_info && eom_wl_output->client_info->func)
+               eom_wl_output->client_info->func(NULL, array);
+
+       if (array)
+               g_array_free(array, FALSE);
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static EomWaylandOutput *
+_eom_wayland_client_find_output_from_wl_output(
+               struct wl_list *eom_wl_output_list, int output_id)
+{
+       EomWaylandOutput *eom_wl_output = NULL;
+       EomWaylandOutput *tmp = NULL;
+       EomWaylandOutput *ret = NULL;
+
+       if (!wl_list_empty(eom_wl_output_list)) {
+               wl_list_for_each_safe(eom_wl_output,
+                       tmp, eom_wl_output_list, link) {
+                       if (eom_wl_output->id == output_id) {
+                               ret = eom_wl_output;
+                               break;
+                       }
+               }
+       }
+
+       return ret;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static EomWaylandOutput *
+_eom_wayland_client_find_output_from_eom_output(
+               struct wl_list *eom_wl_output_list, eom_output_id id)
+{
+       EomWaylandOutput *eom_wl_output = NULL;
+       EomWaylandOutput *tmp = NULL;
+       EomWaylandOutput *ret = NULL;
+
+       if (!wl_list_empty(eom_wl_output_list)) {
+               wl_list_for_each_safe(eom_wl_output,
+                       tmp, eom_wl_output_list, link) {
+                       if (eom_wl_output->id == id) {
+                               ret = eom_wl_output;
+                               break;
+                       }
+               }
+       }
+
+       return ret;
+}
+/*LCOV_EXCL_STOP*/
+#if 0
+static void
+_eom_wl_output_handle_geometry(void *data,
+                       struct wl_output *wl_output,
+                       int32_t x,
+                       int32_t y,
+                       int32_t physical_width,
+                       int32_t physical_height,
+                       int32_t subpixel,
+                       const char *make,
+                       const char *model,
+                       int32_t transform)
+{
+       EomWaylandOutput *eom_wl_output = (EomWaylandOutput *) data;
+
+       INFO("wl_output:%p x:%d y:%d phy(w:%d h:%d) p:%d m:%s model:%s t:%d\n",
+               wl_output, x, y, physical_width, physical_height,
+               subpixel, make, model, transform);
+
+       /* save vaules if it is different before */
+       if (eom_wl_output->x != x)
+               eom_wl_output->x = x;
+       if (eom_wl_output->y != y)
+               eom_wl_output->y = y;
+       if (eom_wl_output->physical_height)
+               eom_wl_output->physical_height = physical_height;
+       if (eom_wl_output->physical_width)
+               eom_wl_output->physical_width = physical_width;
+       if (eom_wl_output->subpixel)
+               eom_wl_output->subpixel = subpixel;
+       if (eom_wl_output->transform)
+               eom_wl_output->transform = transform;
+
+}
+
+static void
+_eom_wl_output_handle_mode(void *data,
+                       struct wl_output *wl_output,
+                       uint32_t flags,
+                       int32_t width,
+                       int32_t height,
+                       int32_t refresh)
+{
+       EomWaylandOutput *eom_wl_output = (EomWaylandOutput *) data;
+
+       INFO("wl_output:%p flags:%d width:%d height:%d refresh:%d\n",
+               wl_output, flags, width, height, refresh);
+
+       /* save vaules if it is different before */
+       if (eom_wl_output->flags != flags)
+               eom_wl_output->flags = flags;
+       if (eom_wl_output->width != width)
+               eom_wl_output->width = width;
+       if (eom_wl_output->height != height)
+               eom_wl_output->height = height;
+       if (eom_wl_output->refresh != refresh)
+               eom_wl_output->refresh = refresh;
+}
+
+static void
+_eom_wl_output_handle_done(void *data,
+                       struct wl_output *wl_output)
+{
+       INFO("wl_output:%p\n", wl_output);
+}
+
+static void
+_eom_wl_output_handle_scale(void *data,
+                       struct wl_output *wl_output,
+                       int32_t factor)
+{
+       EomWaylandOutput *eom_wl_output = (EomWaylandOutput *) data;
+
+       INFO("wl_output:%p factor:%d\n", wl_output, factor);
+
+       /* save vaules if it is different before */
+       if (eom_wl_output->factor != factor)
+               eom_wl_output->factor = factor;
+}
+
+static const struct wl_output_listener eom_wl_output_listener = {
+       _eom_wl_output_handle_geometry,
+       _eom_wl_output_handle_mode,
+       _eom_wl_output_handle_done,
+       _eom_wl_output_handle_scale,
+};
+#endif
+/*LCOV_EXCL_START*/
+static void
+_eom_wl_eom_output_count(void *data,
+                       struct wl_eom *wl_eom,
+                       uint32_t count)
+{
+       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
+       /*EomWaylandOutput *eom_wl_output = NULL;*/
+
+       INFO("COUNT - %d", count);
+
+       if (count == 0) {
+               INFO("not support external output");
+               return;
+       }
+
+       eom_client_info->num_outputs = count;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static void
+_eom_wl_eom_output_info(void *data,
+                       struct wl_eom *wl_eom,
+                       uint32_t output_id,
+                       uint32_t type,
+                       uint32_t mode,
+                       uint32_t w,
+                       uint32_t h,
+                       uint32_t w_mm,
+                       uint32_t h_mm,
+                       uint32_t connection,
+                       uint32_t skip,
+                       uint32_t attribute,
+                       uint32_t attribute_state,
+                       uint32_t error)
+{
+       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
+       EomWaylandOutput *eom_wl_output = NULL;
+
+       INFO("INFO - id : %d, type : %d, mode : %d, w : %d, h : %d, w_mm : %d, h_mm : %d, conn : %d\n",
+               output_id, type, mode, w, h, w_mm, h_mm, connection);
+
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+                       &eom_client_info->eom_wl_output_list, output_id);
+       if (eom_wl_output) {
+               eom_wl_output->width = w;
+               eom_wl_output->height = h;
+               eom_wl_output->physical_width = w_mm;
+               eom_wl_output->physical_height = h_mm;
+
+               /* save the output type */
+               if (eom_wl_output->eom_type != type)
+                       eom_wl_output->eom_type = type;
+
+               /* check the connection status and call the notify */
+               if (eom_wl_output->eom_status != connection) {
+                       eom_wl_output->eom_status = connection;
+
+                       INFO("INFO send connection: %d", connection);
+
+                       if (connection == WL_EOM_STATUS_CONNECTION)
+                               _eom_wayland_client_call_notify(eom_wl_output,
+                                       EOM_OUTPUT_NOTIFY_ADD);
+                       else if (connection == WL_EOM_STATUS_DISCONNECTION)
+                               _eom_wayland_client_call_notify(eom_wl_output,
+                                       EOM_OUTPUT_NOTIFY_REMOVE);
+               }
+
+               /* check the eom mode and call the notify */
+               if (eom_wl_output->eom_mode != mode) {
+                       eom_wl_output->eom_mode = mode;
+
+                       INFO("INFO send mode:%d", mode);
+
+                       _eom_wayland_client_call_notify(eom_wl_output,
+                               EOM_OUTPUT_NOTIFY_MODE_CHANGED);
+               }
+
+               if (skip)
+                       return;
+
+               /* check the eom attribute and call the notify */
+               if ((eom_wl_output->eom_attribute != attribute) ||
+                       (eom_wl_output->eom_attribute_state != attribute_state)) {
+                       eom_wl_output->eom_attribute = attribute;
+                       eom_wl_output->eom_attribute_state = attribute_state;
+
+                       INFO("INFO   NEW send attribute:%d", attribute);
+                       INFO("INFO   NEW send attribute state:%d", attribute_state);
+
+                       _eom_wayland_client_call_notify(eom_wl_output,
+                               EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED);
+               }
+
+               eom_wl_output->error = error;
+       } else {
+               /* make external output info */
+               eom_wl_output = calloc(1, sizeof(EomWaylandOutput));
+               if (!eom_wl_output) {
+                       ERR("Fail to allocate the eom_output.\n");
+                       return;
+               }
+
+               eom_wl_output->id = output_id;
+               eom_wl_output->eom_type = type;
+               eom_wl_output->eom_mode = mode;
+               eom_wl_output->width = w;
+               eom_wl_output->height = h;
+               eom_wl_output->physical_width = w_mm;
+               eom_wl_output->physical_height = h_mm;
+               eom_wl_output->eom_status = connection;
+               eom_wl_output->client_info = &wl_client_info;
+               eom_wl_output->error = WL_EOM_ERROR_NONE;
+
+               wl_list_insert(&eom_client_info->eom_wl_output_list, &eom_wl_output->link);
+       }
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static void
+_eom_wl_eom_output_type(void *data,
+                       struct wl_eom *wl_eom,
+                       uint32_t output_id,
+                       uint32_t type,
+                       uint32_t status)
+{
+       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
+       EomWaylandOutput *eom_wl_output = NULL;
+
+       INFO("TYPE - id : %d, type : %d, status : %d\n", output_id, type, status);
+
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output_id);
+       RET_IF_FAIL(eom_wl_output != NULL);
+
+       /* save the output type */
+       if (eom_wl_output->eom_type != type)
+               eom_wl_output->eom_type = type;
+
+       /* check the connection status and call the notify */
+       if (eom_wl_output->eom_status != status) {
+               eom_wl_output->eom_status = status;
+
+               if (status == WL_EOM_STATUS_CONNECTION)
+                       _eom_wayland_client_call_notify(eom_wl_output,
+                               EOM_OUTPUT_NOTIFY_ADD);
+               else if (status == WL_EOM_STATUS_DISCONNECTION)
+                       _eom_wayland_client_call_notify(eom_wl_output,
+                               EOM_OUTPUT_NOTIFY_REMOVE);
+       }
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static void
+_eom_wl_eom_output_mode(void *data,
+                       struct wl_eom *wl_eom,
+                       uint32_t output_id,
+                       uint32_t mode)
+{
+       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
+       EomWaylandOutput *eom_wl_output = NULL;
+
+       INFO("MODE - id : %d, mode : %d\n", output_id, mode);
+
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output_id);
+       RET_IF_FAIL(eom_wl_output != NULL);
+
+       /* check the eom mode and call the notify */
+       if (eom_wl_output->eom_mode != mode) {
+               eom_wl_output->eom_mode = mode;
+
+               _eom_wayland_client_call_notify(eom_wl_output,
+                       EOM_OUTPUT_NOTIFY_MODE_CHANGED);
+       }
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+static void
+_eom_wl_eom_output_attribute(void *data,
+                        struct wl_eom *wl_eom,
+                        uint32_t output_id,
+                        uint32_t attribute,
+                        uint32_t attribute_state,
+                        uint32_t error)
+{
+       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
+       EomWaylandOutput *eom_wl_output = NULL;
+
+       INFO("ATTRIBUTE - id : %d, attribute : %d, state : %d\n", output_id, attribute, attribute_state);
+
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output_id);
+       RET_IF_FAIL(eom_wl_output != NULL);
+
+       /* check the eom attribute and call the notify */
+       if ((eom_wl_output->eom_attribute != attribute) ||
+               (eom_wl_output->eom_attribute_state != attribute_state)) {
+               eom_wl_output->eom_attribute = attribute;
+               eom_wl_output->eom_attribute_state = attribute_state;
+
+               _eom_wayland_client_call_notify(eom_wl_output,
+                       EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED);
+       }
+
+       eom_wl_output->error = error;
+}
+
+static void
+_eom_wl_eom_output_set_window(void *data,
+                        struct wl_eom *wl_eom,
+                        uint32_t output_id,
+                        uint32_t error)
+{
+       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
+       EomWaylandOutput *eom_wl_output = NULL;
+
+       INFO("SET_WINODW - id : %d, error : %d\n", output_id, error);
+
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output_id);
+       RET_IF_FAIL(eom_wl_output != NULL);
+
+       eom_wl_output->error = error;
+}
+
+/*LCOV_EXCL_STOP*/
+static const struct wl_eom_listener eom_wl_eom_listener = {
+       _eom_wl_eom_output_count,
+       _eom_wl_eom_output_info,
+       _eom_wl_eom_output_type,
+       _eom_wl_eom_output_mode,
+       _eom_wl_eom_output_attribute,
+       _eom_wl_eom_output_set_window,
+};
+
+
+static void
+_eom_wl_registry_handle_global(void *data, struct wl_registry *registry,
+               uint32_t name, const char *interface, uint32_t version)
+{
+       EomWaylandClientInfo *ci = (EomWaylandClientInfo *)data;
+       /*EomWaylandOutput *eom_wl_output = NULL;*/
+       struct wl_output *output = NULL;
+       struct wl_eom *eom = NULL;
+
+       if (strcmp(interface, "wl_output") == 0) {
+               output = wl_registry_bind(registry, name,
+                       &wl_output_interface, 1);
+               if (!output)
+                       ERR("Error. fail to bind  %s.\n", interface);/*LCOV_EXCL_LINE*/
+               else {
+                       INFO("bind %s.\n", interface);
+#if 0
+                       /* create the eom_wl_output */
+                       eom_wl_output = calloc(1, sizeof(EomWaylandOutput));
+                       if (!eom_wl_output) {
+                               ERR("Fail to allocate the eom_output.\n");
+                               return;
+                       }
+                       ci->num_outputs++;
+                       eom_wl_output->id = ci->num_outputs;
+                       eom_wl_output->output = output;
+                       wl_list_insert(&ci->eom_wl_output_list,
+                               &eom_wl_output->link);
+
+                       /* add listener */
+                       wl_output_add_listener(eom_wl_output->output,
+                               &eom_wl_output_listener, eom_wl_output);
+#endif
+               }
+       } else if (strcmp(interface, "wl_eom") == 0) {
+               eom = wl_registry_bind(registry, name, &wl_eom_interface, 1);
+               if (!eom)
+                       ERR("Error. fail to bind  %s.\n", interface);/*LCOV_EXCL_LINE*/
+               else {
+                       INFO("bind %s.\n", interface);/*LCOV_EXCL_LINE*/
+
+                       ci->eom = eom;
+
+                       /* add listener */
+                       wl_eom_add_listener(ci->eom, &eom_wl_eom_listener, ci);
+               }
+       } else
+               INFO("Not bind %s.\n", interface);
+}
+/*LCOV_EXCL_START*/
+static void
+_eom_wl_registry_handle_global_remove(void *data,
+               struct wl_registry *registry, uint32_t name)
+{
+
+}
+/*LCOV_EXCL_STOP*/
+static const struct wl_registry_listener eom_registry_listener = {
+       _eom_wl_registry_handle_global,
+       _eom_wl_registry_handle_global_remove
+};
+
+static bool
+_eom_wayland_client_initialize()
+{
+       int ecore_count = -1;
+
+       ecore_count = ecore_wl_init(NULL);
+       RETV_IF_FAIL(ecore_count > 0, false);
+
+       wl_list_init(&wl_client_info.eom_wl_output_list);
+
+       wl_client_info.display = ecore_wl_display_get();
+       GOTO_IF_FAIL(wl_client_info.display != NULL, fail);
+
+       /* get the registry */
+       wl_client_info.registry =
+               wl_display_get_registry(wl_client_info.display);
+       GOTO_IF_FAIL(wl_client_info.registry != NULL, fail);
+
+       /* get the global objects */
+       wl_registry_add_listener(wl_client_info.registry,
+               &eom_registry_listener, &wl_client_info);
+       wl_display_dispatch(wl_client_info.display);
+       wl_display_roundtrip(wl_client_info.display);
+#if 0
+       /* remove type none eom_wl_outputs */
+       if (!wl_list_empty(&wl_client_info.eom_wl_output_list)) {
+               EomWaylandOutput *eom_wl_output = NULL;
+               EomWaylandOutput *tmp = NULL;
+
+               wl_list_for_each_safe(eom_wl_output, tmp,
+                       &wl_client_info.eom_wl_output_list, link) {
+                       if (eom_wl_output->eom_type == WL_EOM_TYPE_NONE) {
+                               WARN("[EOM_CLIENT] eom_type is NONE. remove output:%d\n",
+                                       eom_wl_output->id);
+                               wl_output_destroy(eom_wl_output->output);
+                               wl_list_remove(&eom_wl_output->link);
+                               free(eom_wl_output);
+                               eom_wl_output = NULL;
+                       }
+               }
+       }
+#endif
+       if (wl_client_info.num_outputs == 0)
+               WARN("[EOM_CLIENT] not support external output at this device.\n");
+
+       /* output list */
+       if (wl_list_empty(&wl_client_info.eom_wl_output_list))
+               WARN("[EOM_CLIENT] no wl output at this device.\n");
+
+       INFO("[EOM_CLIENT] wayland client init.");
+
+       return true;
+fail:
+
+       if (wl_client_info.registry) {
+               wl_registry_destroy(wl_client_info.registry);
+               wl_client_info.registry = NULL;
+       }
+
+       ecore_wl_shutdown();
+
+       return false;
+}
+
+static void
+_eom_wayland_client_deinitialize()
+{
+       EomWaylandOutput *eom_wl_output = NULL;
+       EomWaylandOutput *tmp = NULL;
+
+       /* remove all eom_wl_outputs */
+       if (!wl_list_empty(&wl_client_info.eom_wl_output_list)) {
+               wl_list_for_each_safe(eom_wl_output, tmp,
+                       &wl_client_info.eom_wl_output_list, link) {
+                       if (eom_wl_output->output)
+                               wl_output_destroy(eom_wl_output->output);
+                       free(eom_wl_output);
+                       eom_wl_output = NULL;
+               }
+       }
+
+       if (wl_client_info.registry) {
+               wl_registry_destroy(wl_client_info.registry);
+               wl_client_info.registry = NULL;
+       }
+       ecore_wl_shutdown();
+
+       INFO("[EOM_CLIENT] wayland client deinit.");
+}
+
+bool
+eom_wayland_client_init(notify_func func)
+{
+       bool ret = false;
+
+       if (eom_wayland_init)
+               return true;
+
+       ret = _eom_wayland_client_initialize();
+       GOTO_IF_FAIL(ret != false, fail);
+
+       wl_client_info.func = func;
+
+       eom_wayland_init = 1;
+
+       return ret;
+fail:
+       return false;
+}
+
+void
+eom_wayland_client_deinit(GList *cb_info_list)
+{
+       if (!eom_wayland_init)
+               return;
+
+       _eom_wayland_client_deinitialize();
+
+       eom_wayland_init = 0;
+
+       memset(&wl_client_info, 0x0, sizeof(EomWaylandClientInfo));
+}
+
+GArray *
+eom_wayland_client_get_output_ids(void)
+{
+       GArray *array = NULL;
+       GValue v = G_VALUE_INIT;
+       EomWaylandOutput *eom_wl_output = NULL;
+       EomWaylandOutput *tmp = NULL;
+
+       if (wl_list_empty(&wl_client_info.eom_wl_output_list)) {
+               ERR("error. no outputs.\n");
+               return NULL;
+       }
+/*LCOV_EXCL_START*/
+       array = g_array_new(FALSE, FALSE, sizeof(GValue));
+
+       wl_list_for_each_safe(eom_wl_output, tmp,
+               &wl_client_info.eom_wl_output_list, link) {
+
+               if (eom_wl_output) {
+                       g_value_init(&v, G_TYPE_INT);
+                       g_value_set_int(&v, eom_wl_output->id);
+                       array = g_array_append_val(array, v);
+                       g_value_unset(&v);
+               }
+       }
+
+       /* returned array will be freed by caller */
+       return array;
+/*LCOV_EXCL_STOP*/
+}
+/*LCOV_EXCL_START*/
+GArray *
+eom_wayland_client_get_output_info(eom_output_id output_id)
+{
+       GArray *array = NULL;
+       GValue v = G_VALUE_INIT;
+       EomWaylandOutput *eom_wl_output = NULL;
+
+       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
+               &wl_client_info.eom_wl_output_list, output_id);
+       RETV_IF_FAIL(eom_wl_output != NULL, NULL);
+
+       array = g_array_new(FALSE, FALSE, sizeof(GValue));
+
+       /* 0:output_id */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->id);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 1:output_type */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->eom_type);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 2:output_mode */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->eom_mode);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 3:w */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->width);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 4:h */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->height);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 5:w_mm */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->physical_width);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 6:h_mm */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->physical_height);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* 7:attribute */
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, eom_wl_output->eom_attribute);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* returned array will be freed by caller */
+       return array;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+GArray *
+eom_wayland_client_set_attribute(eom_output_id output_id,
+               eom_output_attribute_e attr)
+{
+       GArray *array = NULL;
+       GValue v = G_VALUE_INIT;
+       EomWaylandOutput *eom_wl_output = NULL;
+       int ret = 0;
+
+       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
+               &wl_client_info.eom_wl_output_list, output_id);
+       GOTO_IF_FAIL(eom_wl_output != NULL, fail);
+
+       wl_eom_set_attribute(wl_client_info.eom, eom_wl_output->id,
+               _convert_to_wl_eom_attribute(attr));
+
+       /* TODO:
+         * wait for the result of set_attribute.
+         * this should be the blocking call.
+         */
+       wl_display_dispatch(wl_client_info.display);
+       wl_display_roundtrip(wl_client_info.display);
+
+       if (eom_wl_output->error == WL_EOM_ERROR_NONE)
+               ret = 1;
+
+       array = g_array_new(FALSE, FALSE, sizeof(GValue));
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, ret);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* returned array will be freed by caller */
+       return array;
+fail:
+
+       return NULL;
+}
+/*LCOV_EXCL_STOP*/
+/*LCOV_EXCL_START*/
+GArray *
+eom_wayland_client_set_window(eom_output_id output_id, Evas_Object *win)
+{
+       GArray *array = NULL;
+       GValue v = G_VALUE_INIT;
+       Ecore_Wl_Window *e_wl_win = NULL;
+       EomWaylandOutput *eom_wl_output = NULL;
+       struct wl_shell_surface *shell_surface = NULL;
+       struct xdg_surface *xdg_shell_surface = NULL;
+       int ret = 0;
+
+       evas_object_show(win);
+
+       e_wl_win = elm_win_wl_window_get(win);
+       GOTO_IF_FAIL(e_wl_win != NULL, fail);
+
+       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
+               &wl_client_info.eom_wl_output_list, output_id);
+       GOTO_IF_FAIL(eom_wl_output != NULL, fail);
+
+#if 0
+       elm_win_aux_hint_add(win, "wm.policy.win.user.geometry", "1");
+#endif
+
+       /* set full screen at output */
+       xdg_shell_surface = ecore_wl_window_xdg_surface_get(e_wl_win);
+       if (xdg_shell_surface) {
+               wl_eom_set_xdg_window(wl_client_info.eom, output_id, xdg_shell_surface);
+       } else {
+               shell_surface = ecore_wl_window_shell_surface_get(e_wl_win);
+               if (shell_surface) {
+                       wl_eom_set_shell_window(wl_client_info.eom, output_id, shell_surface);
+               } else {
+                       ERR("no wl surface.\n");
+                       goto fail;
+               }
+       }
+
+       /* TODO:
+         * wait for the result of set_window.
+         * this should be the blocking call.
+         */
+       wl_display_dispatch(wl_client_info.display);
+       wl_display_roundtrip(wl_client_info.display);
+
+       if (eom_wl_output->error == WL_EOM_ERROR_NONE)
+               ret = 1;
+
+       array = g_array_new(FALSE, FALSE, sizeof(GValue));
+       g_value_init(&v, G_TYPE_INT);
+       g_value_set_int(&v, ret);
+       array = g_array_append_val(array, v);
+       g_value_unset(&v);
+
+       /* returned array will be freed by caller */
+       return array;
+fail:
+
+       return NULL;
+}
+/*LCOV_EXCL_STOP*/
+
diff --git a/src/eom-wayland.h b/src/eom-wayland.h
new file mode 100644 (file)
index 0000000..5385dea
--- /dev/null
@@ -0,0 +1,56 @@
+/**************************************************************************
+ *
+ * eom (external output manager)
+ *
+ * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
+ *
+ * Contact:
+ * SooChan Lim <sc1.lim@samsung.com>
+ * Boram Park <boram1288.park@samsung.com>
+ * Changyeon Lee <cyeon.lee@samsung.com>
+ * JunKyeong Kim <jk0430.kim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+**************************************************************************/
+
+#ifndef __EOM_WAYLAND_H__
+#define __EOM_WAYLAND_H__
+
+#include <stdbool.h>
+#include <glib.h>
+#include <glib-object.h>
+#include "eom.h"
+#include "eom-private.h"
+
+bool eom_wayland_client_init(notify_func func);
+void eom_wayland_client_deinit(GList *cb_info_list);
+
+GArray *eom_wayland_client_get_output_ids(void);
+GArray *eom_wayland_client_get_output_info(eom_output_id output_id);
+GArray *eom_wayland_client_set_attribute(eom_output_id output_id,
+               eom_output_attribute_e attry);
+GArray *eom_wayland_client_set_window(eom_output_id output_id,
+               Evas_Object *win);
+
+
+#endif /* __EOM_WAYLAND_H__ */
+
index 0045c26b49eacd249c0b9b336e3495bb879f25cc..8dc35bc02002002e64e9db550a0ce69eea83fbd0 100644 (file)
--- a/src/eom.c
+++ b/src/eom.c
 #include "eom.h"
 #include "eom_internal.h"
 #include "eom-log.h"
-#ifdef HAVE_WAYLAND
 #include "eom-wayland.h"
-#else
-#include "eom-dbus.h"
-#endif
 #include "eom-private.h"
 
 typedef struct {
@@ -545,13 +541,7 @@ eom_init(void)
        _eom_get_debug_evn();
 
        _eom_mutex_lock();
-
-#ifdef HAVE_WAYLAND
        ret = eom_wayland_client_init(_eom_output_process_notify_cb);
-#else
-       ret = eom_dbus_client_init(_eom_output_process_notify_cb);
-#endif
-
        _eom_mutex_unlock();
 
        INFO("eom init %s", (ret) ? "success" : "failed");
@@ -565,11 +555,8 @@ eom_deinit(void)
        GList *l = NULL;
 
        _eom_mutex_lock();
-#ifdef HAVE_WAYLAND
        eom_wayland_client_deinit(cb_info_list);
-#else
-       eom_dbus_client_deinit(cb_info_list);
-#endif
+
        for (l = cb_info_list; l; l = cb_info_list) {
                eom_output_notify_cb_info *cb_info = (eom_output_notify_cb_info *)l->data;
 
@@ -612,11 +599,8 @@ eom_get_eom_output_ids(int *count)
 
        _eom_mutex_lock();
 
-#ifdef HAVE_WAYLAND
        ret_array = eom_wayland_client_get_output_ids();
-#else
-       ret_array = eom_dbus_client_get_output_ids();
-#endif
+
        if (!ret_array) {
                *count = 0;
                _eom_mutex_unlock();
@@ -656,11 +640,7 @@ eom_get_eom_output_ids(int *count)
                if (output_info)
                        continue;
 
-#ifdef HAVE_WAYLAND
                ret_array = eom_wayland_client_get_output_info(output_id);
-#else
-               ret_array = eom_dbus_client_get_output_info(output_id);
-#endif
                if (ret_array) {
                /*
                  * 0:output_id, 1:output_type, 2:output_mode,
@@ -1030,13 +1010,10 @@ eom_set_output_attribute(eom_output_id output_id,
 /*LCOV_EXCL_START*/
        INFO("output_id: %d, attr: %d\n", output_id, attr);
 
-#ifdef HAVE_WAYLAND
        _eom_mutex_unlock();
        ret_array = eom_wayland_client_set_attribute(output_id, attr);
        _eom_mutex_lock();
-#else
-       ret_array = eom_dbus_client_set_attribute(output_id, attr);
-#endif
+
        if (!ret_array) {
                _eom_mutex_unlock();
                return EOM_ERROR_MESSAGE_SENDING_FAILURE;
@@ -1252,13 +1229,10 @@ eom_set_output_window(eom_output_id output_id, Evas_Object *win)
 /*LCOV_EXCL_START*/
        INFO("output_id: %d, evas_win: %p\n", output_id, win);
 
-#ifdef HAVE_WAYLAND
        _eom_mutex_unlock();
        ret_array = eom_wayland_client_set_window(output_id, win);
        _eom_mutex_lock();
-#else
-       ret_array = eom_dbus_client_set_window(output_id, win);
-#endif
+
        if (!ret_array) {
                _eom_mutex_unlock();
                return EOM_ERROR_MESSAGE_SENDING_FAILURE;
diff --git a/src/wayland/eom-wayland.c b/src/wayland/eom-wayland.c
deleted file mode 100644 (file)
index c298281..0000000
+++ /dev/null
@@ -1,1109 +0,0 @@
-/**************************************************************************
- *
- * eom (external output manager)
- *
- * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Contact:
- * SooChan Lim <sc1.lim@samsung.com>
- * Boram Park <boram1288.park@samsung.com>
- * Changyeon Lee <cyeon.lee@samsung.com>
- * JunKyeong Kim <jk0430.kim@samsung.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
-**************************************************************************/
-
-#include <config.h>
-#include "eom.h"
-#include "eom_internal.h"
-#include "eom-log.h"
-#include "eom-wayland.h"
-#include "eom-private.h"
-#include "eom-client-protocol.h"
-#include "xdg-shell-client-protocol.h"
-#include <Ecore_Wayland.h>
-
-typedef struct _EomWaylandClientInfo {
-       /* wl */
-       struct wl_display *display;
-       struct wl_registry *registry;
-
-       struct wl_eom *eom;
-
-       /* eom wayland output list */
-       struct wl_list eom_wl_output_list;
-       int num_outputs;
-
-       notify_func func;
-} EomWaylandClientInfo;
-
-typedef struct _EomWaylandOutput {
-       eom_output_id id;
-       struct wl_output *output;
-
-       /* current output data */
-       int32_t x;
-       int32_t y;
-       int32_t physical_width;
-       int32_t physical_height;
-       enum wl_output_subpixel subpixel;
-       const char *make;
-       const char *model;
-       enum wl_output_transform transform;
-
-       uint32_t flags;
-       int32_t width;
-       int32_t height;
-       int32_t refresh;
-
-       int32_t factor;
-
-       /* current eom data */
-       enum wl_eom_type eom_type;
-       enum wl_eom_status eom_status;
-       enum wl_eom_mode eom_mode;
-       enum wl_eom_attribute eom_attribute;
-       enum wl_eom_attribute_state eom_attribute_state;
-       enum wl_eom_error error;
-
-       /* client info */
-       EomWaylandClientInfo *client_info;
-
-       struct wl_list link;
-} EomWaylandOutput;
-
-static EomWaylandClientInfo wl_client_info;
-static int eom_wayland_init;
-/*LCOV_EXCL_START*/
-static eom_output_type_e
-_convert_to_eom_output_type(enum wl_eom_type eom_type)
-{
-       eom_output_type_e output_type = EOM_OUTPUT_TYPE_UNKNOWN;
-
-       switch (eom_type) {
-       case WL_EOM_TYPE_NONE:
-               output_type = EOM_OUTPUT_TYPE_UNKNOWN;
-               break;
-       case WL_EOM_TYPE_VGA:
-               output_type = EOM_OUTPUT_TYPE_VGA;
-               break;
-       case WL_EOM_TYPE_DVII:
-               output_type = EOM_OUTPUT_TYPE_DVII;
-               break;
-       case WL_EOM_TYPE_DVID:
-               output_type = EOM_OUTPUT_TYPE_DVID;
-               break;
-       case WL_EOM_TYPE_DVIA:
-               output_type = EOM_OUTPUT_TYPE_DVIA;
-               break;
-       case WL_EOM_TYPE_COMPOSITE:
-               output_type = EOM_OUTPUT_TYPE_COMPOSITE;
-               break;
-       case WL_EOM_TYPE_SVIDEO:
-               output_type = EOM_OUTPUT_TYPE_SVIDEO;
-               break;
-       case WL_EOM_TYPE_LVDS:
-               output_type = EOM_OUTPUT_TYPE_LVDS;
-               break;
-       case WL_EOM_TYPE_COMPONENT:
-               output_type = EOM_OUTPUT_TYPE_COMPONENT;
-               break;
-       case WL_EOM_TYPE_9PINDIN:
-               output_type = EOM_OUTPUT_TYPE_9PINDIN;
-               break;
-       case WL_EOM_TYPE_DISPLAYPORT:
-               output_type = EOM_OUTPUT_TYPE_DISPLAYPORT;
-               break;
-       case WL_EOM_TYPE_HDMIA:
-               output_type = EOM_OUTPUT_TYPE_HDMIA;
-               break;
-       case WL_EOM_TYPE_HDMIB:
-               output_type = EOM_OUTPUT_TYPE_HDMIB;
-               break;
-       case WL_EOM_TYPE_TV:
-               output_type = EOM_OUTPUT_TYPE_TV;
-               break;
-       case WL_EOM_TYPE_EDP:
-               output_type = EOM_OUTPUT_TYPE_EDP;
-               break;
-       case WL_EOM_TYPE_VIRTUAL:
-               output_type = EOM_OUTPUT_TYPE_VIRTUAL;
-               break;
-       case WL_EOM_TYPE_DSI:
-               output_type = EOM_OUTPUT_TYPE_DSI;
-               break;
-       default:
-               ERR("no type.");
-               break;
-       }
-
-       return output_type;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static eom_output_mode_e
-_convert_to_eom_output_mode(enum wl_eom_mode eom_mode)
-{
-       eom_output_mode_e output_mode = EOM_OUTPUT_MODE_NONE;
-
-       switch (eom_mode) {
-       case WL_EOM_MODE_NONE:
-               output_mode = EOM_OUTPUT_MODE_NONE;
-               break;
-       case WL_EOM_MODE_MIRROR:
-               output_mode = EOM_OUTPUT_MODE_MIRROR;
-               break;
-       case WL_EOM_MODE_PRESENTATION:
-               output_mode = EOM_OUTPUT_MODE_PRESENTATION;
-               break;
-       default:
-               ERR("no mode.");
-               break;
-       }
-
-       return output_mode;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static eom_output_attribute_e
-_convert_to_eom_output_attribute(enum wl_eom_attribute eom_attribute)
-{
-       eom_output_attribute_e output_attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
-
-       switch (eom_attribute) {
-       case WL_EOM_ATTRIBUTE_NONE:
-               output_attribute = EOM_OUTPUT_ATTRIBUTE_NONE;
-               break;
-       case WL_EOM_ATTRIBUTE_NORMAL:
-               output_attribute = EOM_OUTPUT_ATTRIBUTE_NORMAL;
-               break;
-       case WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE:
-               output_attribute = EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARE;
-               break;
-       case WL_EOM_ATTRIBUTE_EXCLUSIVE:
-               output_attribute = EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE;
-               break;
-       default:
-               ERR("no attribute.");
-               break;
-       }
-
-       return output_attribute;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static eom_output_attribute_state_e
-_convert_to_eom_output_attribute_state(
-               enum wl_eom_attribute_state eom_attribute_state)
-{
-       eom_output_attribute_state_e output_attribute_state =
-               EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
-
-       switch (eom_attribute_state) {
-       case WL_EOM_ATTRIBUTE_STATE_NONE:
-               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_NONE;
-               break;
-       case WL_EOM_ATTRIBUTE_STATE_ACTIVE:
-               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_ACTIVE;
-               break;
-       case WL_EOM_ATTRIBUTE_STATE_INACTIVE:
-               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_INACTIVE;
-               break;
-       case WL_EOM_ATTRIBUTE_STATE_LOST:
-               output_attribute_state = EOM_OUTPUT_ATTRIBUTE_STATE_LOST;
-               break;
-       default:
-               ERR("no attribute state.");
-               break;
-       }
-
-       return output_attribute_state;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static enum wl_eom_attribute
-_convert_to_wl_eom_attribute(eom_output_attribute_e attr)
-{
-       enum wl_eom_attribute eom_attribute = WL_EOM_ATTRIBUTE_NONE;
-
-       switch (attr) {
-       case EOM_OUTPUT_ATTRIBUTE_NONE:
-               eom_attribute = WL_EOM_ATTRIBUTE_NONE;
-               break;
-       case EOM_OUTPUT_ATTRIBUTE_NORMAL:
-               eom_attribute = WL_EOM_ATTRIBUTE_NORMAL;
-               break;
-       case EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE_SHARE:
-               eom_attribute = WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE;
-               break;
-       case EOM_OUTPUT_ATTRIBUTE_EXCLUSIVE:
-               eom_attribute = WL_EOM_ATTRIBUTE_EXCLUSIVE;
-               break;
-       default:
-               ERR("no wl attribute.");
-               break;
-       }
-
-       return eom_attribute;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static void
-_eom_wayland_client_call_notify(EomWaylandOutput *eom_wl_output,
-               eom_output_notify_type_e type)
-{
-       GArray *array = NULL;
-       GValue v = G_VALUE_INIT;
-       int current_pid = getpid();
-
-       array = g_array_new(FALSE, FALSE, sizeof(GValue));
-
-       /* 0: notify_type */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, type);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 1:output_id */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->id);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 2:output_type */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v,
-               _convert_to_eom_output_type(eom_wl_output->eom_type));
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 3:output_mode */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v,
-               _convert_to_eom_output_mode(eom_wl_output->eom_mode));
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 4:w */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->width);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 5:h */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->height);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 6:w_mm */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->physical_width);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 7:h_mm */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->physical_height);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 8:pid */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, current_pid);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 9:attri */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v,
-               _convert_to_eom_output_attribute(eom_wl_output->eom_attribute));
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 10:state */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v,
-               _convert_to_eom_output_attribute_state(
-                       eom_wl_output->eom_attribute_state));
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       if (eom_wl_output->client_info && eom_wl_output->client_info->func)
-               eom_wl_output->client_info->func(NULL, array);
-
-       if (array)
-               g_array_free(array, FALSE);
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static EomWaylandOutput *
-_eom_wayland_client_find_output_from_wl_output(
-               struct wl_list *eom_wl_output_list, int output_id)
-{
-       EomWaylandOutput *eom_wl_output = NULL;
-       EomWaylandOutput *tmp = NULL;
-       EomWaylandOutput *ret = NULL;
-
-       if (!wl_list_empty(eom_wl_output_list)) {
-               wl_list_for_each_safe(eom_wl_output,
-                       tmp, eom_wl_output_list, link) {
-                       if (eom_wl_output->id == output_id) {
-                               ret = eom_wl_output;
-                               break;
-                       }
-               }
-       }
-
-       return ret;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static EomWaylandOutput *
-_eom_wayland_client_find_output_from_eom_output(
-               struct wl_list *eom_wl_output_list, eom_output_id id)
-{
-       EomWaylandOutput *eom_wl_output = NULL;
-       EomWaylandOutput *tmp = NULL;
-       EomWaylandOutput *ret = NULL;
-
-       if (!wl_list_empty(eom_wl_output_list)) {
-               wl_list_for_each_safe(eom_wl_output,
-                       tmp, eom_wl_output_list, link) {
-                       if (eom_wl_output->id == id) {
-                               ret = eom_wl_output;
-                               break;
-                       }
-               }
-       }
-
-       return ret;
-}
-/*LCOV_EXCL_STOP*/
-#if 0
-static void
-_eom_wl_output_handle_geometry(void *data,
-                       struct wl_output *wl_output,
-                       int32_t x,
-                       int32_t y,
-                       int32_t physical_width,
-                       int32_t physical_height,
-                       int32_t subpixel,
-                       const char *make,
-                       const char *model,
-                       int32_t transform)
-{
-       EomWaylandOutput *eom_wl_output = (EomWaylandOutput *) data;
-
-       INFO("wl_output:%p x:%d y:%d phy(w:%d h:%d) p:%d m:%s model:%s t:%d\n",
-               wl_output, x, y, physical_width, physical_height,
-               subpixel, make, model, transform);
-
-       /* save vaules if it is different before */
-       if (eom_wl_output->x != x)
-               eom_wl_output->x = x;
-       if (eom_wl_output->y != y)
-               eom_wl_output->y = y;
-       if (eom_wl_output->physical_height)
-               eom_wl_output->physical_height = physical_height;
-       if (eom_wl_output->physical_width)
-               eom_wl_output->physical_width = physical_width;
-       if (eom_wl_output->subpixel)
-               eom_wl_output->subpixel = subpixel;
-       if (eom_wl_output->transform)
-               eom_wl_output->transform = transform;
-
-}
-
-static void
-_eom_wl_output_handle_mode(void *data,
-                       struct wl_output *wl_output,
-                       uint32_t flags,
-                       int32_t width,
-                       int32_t height,
-                       int32_t refresh)
-{
-       EomWaylandOutput *eom_wl_output = (EomWaylandOutput *) data;
-
-       INFO("wl_output:%p flags:%d width:%d height:%d refresh:%d\n",
-               wl_output, flags, width, height, refresh);
-
-       /* save vaules if it is different before */
-       if (eom_wl_output->flags != flags)
-               eom_wl_output->flags = flags;
-       if (eom_wl_output->width != width)
-               eom_wl_output->width = width;
-       if (eom_wl_output->height != height)
-               eom_wl_output->height = height;
-       if (eom_wl_output->refresh != refresh)
-               eom_wl_output->refresh = refresh;
-}
-
-static void
-_eom_wl_output_handle_done(void *data,
-                       struct wl_output *wl_output)
-{
-       INFO("wl_output:%p\n", wl_output);
-}
-
-static void
-_eom_wl_output_handle_scale(void *data,
-                       struct wl_output *wl_output,
-                       int32_t factor)
-{
-       EomWaylandOutput *eom_wl_output = (EomWaylandOutput *) data;
-
-       INFO("wl_output:%p factor:%d\n", wl_output, factor);
-
-       /* save vaules if it is different before */
-       if (eom_wl_output->factor != factor)
-               eom_wl_output->factor = factor;
-}
-
-static const struct wl_output_listener eom_wl_output_listener = {
-       _eom_wl_output_handle_geometry,
-       _eom_wl_output_handle_mode,
-       _eom_wl_output_handle_done,
-       _eom_wl_output_handle_scale,
-};
-#endif
-/*LCOV_EXCL_START*/
-static void
-_eom_wl_eom_output_count(void *data,
-                       struct wl_eom *wl_eom,
-                       uint32_t count)
-{
-       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
-       /*EomWaylandOutput *eom_wl_output = NULL;*/
-
-       INFO("COUNT - %d", count);
-
-       if (count == 0) {
-               INFO("not support external output");
-               return;
-       }
-
-       eom_client_info->num_outputs = count;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static void
-_eom_wl_eom_output_info(void *data,
-                       struct wl_eom *wl_eom,
-                       uint32_t output_id,
-                       uint32_t type,
-                       uint32_t mode,
-                       uint32_t w,
-                       uint32_t h,
-                       uint32_t w_mm,
-                       uint32_t h_mm,
-                       uint32_t connection,
-                       uint32_t skip,
-                       uint32_t attribute,
-                       uint32_t attribute_state,
-                       uint32_t error)
-{
-       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
-       EomWaylandOutput *eom_wl_output = NULL;
-
-       INFO("INFO - id : %d, type : %d, mode : %d, w : %d, h : %d, w_mm : %d, h_mm : %d, conn : %d\n",
-               output_id, type, mode, w, h, w_mm, h_mm, connection);
-
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
-                       &eom_client_info->eom_wl_output_list, output_id);
-       if (eom_wl_output) {
-               eom_wl_output->width = w;
-               eom_wl_output->height = h;
-               eom_wl_output->physical_width = w_mm;
-               eom_wl_output->physical_height = h_mm;
-
-               /* save the output type */
-               if (eom_wl_output->eom_type != type)
-                       eom_wl_output->eom_type = type;
-
-               /* check the connection status and call the notify */
-               if (eom_wl_output->eom_status != connection) {
-                       eom_wl_output->eom_status = connection;
-
-                       INFO("INFO send connection: %d", connection);
-
-                       if (connection == WL_EOM_STATUS_CONNECTION)
-                               _eom_wayland_client_call_notify(eom_wl_output,
-                                       EOM_OUTPUT_NOTIFY_ADD);
-                       else if (connection == WL_EOM_STATUS_DISCONNECTION)
-                               _eom_wayland_client_call_notify(eom_wl_output,
-                                       EOM_OUTPUT_NOTIFY_REMOVE);
-               }
-
-               /* check the eom mode and call the notify */
-               if (eom_wl_output->eom_mode != mode) {
-                       eom_wl_output->eom_mode = mode;
-
-                       INFO("INFO send mode:%d", mode);
-
-                       _eom_wayland_client_call_notify(eom_wl_output,
-                               EOM_OUTPUT_NOTIFY_MODE_CHANGED);
-               }
-
-               if (skip)
-                       return;
-
-               /* check the eom attribute and call the notify */
-               if ((eom_wl_output->eom_attribute != attribute) ||
-                       (eom_wl_output->eom_attribute_state != attribute_state)) {
-                       eom_wl_output->eom_attribute = attribute;
-                       eom_wl_output->eom_attribute_state = attribute_state;
-
-                       INFO("INFO   NEW send attribute:%d", attribute);
-                       INFO("INFO   NEW send attribute state:%d", attribute_state);
-
-                       _eom_wayland_client_call_notify(eom_wl_output,
-                               EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED);
-               }
-
-               eom_wl_output->error = error;
-       } else {
-               /* make external output info */
-               eom_wl_output = calloc(1, sizeof(EomWaylandOutput));
-               if (!eom_wl_output) {
-                       ERR("Fail to allocate the eom_output.\n");
-                       return;
-               }
-
-               eom_wl_output->id = output_id;
-               eom_wl_output->eom_type = type;
-               eom_wl_output->eom_mode = mode;
-               eom_wl_output->width = w;
-               eom_wl_output->height = h;
-               eom_wl_output->physical_width = w_mm;
-               eom_wl_output->physical_height = h_mm;
-               eom_wl_output->eom_status = connection;
-               eom_wl_output->client_info = &wl_client_info;
-               eom_wl_output->error = WL_EOM_ERROR_NONE;
-
-               wl_list_insert(&eom_client_info->eom_wl_output_list, &eom_wl_output->link);
-       }
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static void
-_eom_wl_eom_output_type(void *data,
-                       struct wl_eom *wl_eom,
-                       uint32_t output_id,
-                       uint32_t type,
-                       uint32_t status)
-{
-       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
-       EomWaylandOutput *eom_wl_output = NULL;
-
-       INFO("TYPE - id : %d, type : %d, status : %d\n", output_id, type, status);
-
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
-               &eom_client_info->eom_wl_output_list, output_id);
-       RET_IF_FAIL(eom_wl_output != NULL);
-
-       /* save the output type */
-       if (eom_wl_output->eom_type != type)
-               eom_wl_output->eom_type = type;
-
-       /* check the connection status and call the notify */
-       if (eom_wl_output->eom_status != status) {
-               eom_wl_output->eom_status = status;
-
-               if (status == WL_EOM_STATUS_CONNECTION)
-                       _eom_wayland_client_call_notify(eom_wl_output,
-                               EOM_OUTPUT_NOTIFY_ADD);
-               else if (status == WL_EOM_STATUS_DISCONNECTION)
-                       _eom_wayland_client_call_notify(eom_wl_output,
-                               EOM_OUTPUT_NOTIFY_REMOVE);
-       }
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static void
-_eom_wl_eom_output_mode(void *data,
-                       struct wl_eom *wl_eom,
-                       uint32_t output_id,
-                       uint32_t mode)
-{
-       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
-       EomWaylandOutput *eom_wl_output = NULL;
-
-       INFO("MODE - id : %d, mode : %d\n", output_id, mode);
-
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
-               &eom_client_info->eom_wl_output_list, output_id);
-       RET_IF_FAIL(eom_wl_output != NULL);
-
-       /* check the eom mode and call the notify */
-       if (eom_wl_output->eom_mode != mode) {
-               eom_wl_output->eom_mode = mode;
-
-               _eom_wayland_client_call_notify(eom_wl_output,
-                       EOM_OUTPUT_NOTIFY_MODE_CHANGED);
-       }
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-static void
-_eom_wl_eom_output_attribute(void *data,
-                        struct wl_eom *wl_eom,
-                        uint32_t output_id,
-                        uint32_t attribute,
-                        uint32_t attribute_state,
-                        uint32_t error)
-{
-       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
-       EomWaylandOutput *eom_wl_output = NULL;
-
-       INFO("ATTRIBUTE - id : %d, attribute : %d, state : %d\n", output_id, attribute, attribute_state);
-
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
-               &eom_client_info->eom_wl_output_list, output_id);
-       RET_IF_FAIL(eom_wl_output != NULL);
-
-       /* check the eom attribute and call the notify */
-       if ((eom_wl_output->eom_attribute != attribute) ||
-               (eom_wl_output->eom_attribute_state != attribute_state)) {
-               eom_wl_output->eom_attribute = attribute;
-               eom_wl_output->eom_attribute_state = attribute_state;
-
-               _eom_wayland_client_call_notify(eom_wl_output,
-                       EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED);
-       }
-
-       eom_wl_output->error = error;
-}
-
-static void
-_eom_wl_eom_output_set_window(void *data,
-                        struct wl_eom *wl_eom,
-                        uint32_t output_id,
-                        uint32_t error)
-{
-       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
-       EomWaylandOutput *eom_wl_output = NULL;
-
-       INFO("SET_WINODW - id : %d, error : %d\n", output_id, error);
-
-       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
-               &eom_client_info->eom_wl_output_list, output_id);
-       RET_IF_FAIL(eom_wl_output != NULL);
-
-       eom_wl_output->error = error;
-}
-
-/*LCOV_EXCL_STOP*/
-static const struct wl_eom_listener eom_wl_eom_listener = {
-       _eom_wl_eom_output_count,
-       _eom_wl_eom_output_info,
-       _eom_wl_eom_output_type,
-       _eom_wl_eom_output_mode,
-       _eom_wl_eom_output_attribute,
-       _eom_wl_eom_output_set_window,
-};
-
-
-static void
-_eom_wl_registry_handle_global(void *data, struct wl_registry *registry,
-               uint32_t name, const char *interface, uint32_t version)
-{
-       EomWaylandClientInfo *ci = (EomWaylandClientInfo *)data;
-       /*EomWaylandOutput *eom_wl_output = NULL;*/
-       struct wl_output *output = NULL;
-       struct wl_eom *eom = NULL;
-
-       if (strcmp(interface, "wl_output") == 0) {
-               output = wl_registry_bind(registry, name,
-                       &wl_output_interface, 1);
-               if (!output)
-                       ERR("Error. fail to bind  %s.\n", interface);/*LCOV_EXCL_LINE*/
-               else {
-                       INFO("bind %s.\n", interface);
-#if 0
-                       /* create the eom_wl_output */
-                       eom_wl_output = calloc(1, sizeof(EomWaylandOutput));
-                       if (!eom_wl_output) {
-                               ERR("Fail to allocate the eom_output.\n");
-                               return;
-                       }
-                       ci->num_outputs++;
-                       eom_wl_output->id = ci->num_outputs;
-                       eom_wl_output->output = output;
-                       wl_list_insert(&ci->eom_wl_output_list,
-                               &eom_wl_output->link);
-
-                       /* add listener */
-                       wl_output_add_listener(eom_wl_output->output,
-                               &eom_wl_output_listener, eom_wl_output);
-#endif
-               }
-       } else if (strcmp(interface, "wl_eom") == 0) {
-               eom = wl_registry_bind(registry, name, &wl_eom_interface, 1);
-               if (!eom)
-                       ERR("Error. fail to bind  %s.\n", interface);/*LCOV_EXCL_LINE*/
-               else {
-                       INFO("bind %s.\n", interface);/*LCOV_EXCL_LINE*/
-
-                       ci->eom = eom;
-
-                       /* add listener */
-                       wl_eom_add_listener(ci->eom, &eom_wl_eom_listener, ci);
-               }
-       } else
-               INFO("Not bind %s.\n", interface);
-}
-/*LCOV_EXCL_START*/
-static void
-_eom_wl_registry_handle_global_remove(void *data,
-               struct wl_registry *registry, uint32_t name)
-{
-
-}
-/*LCOV_EXCL_STOP*/
-static const struct wl_registry_listener eom_registry_listener = {
-       _eom_wl_registry_handle_global,
-       _eom_wl_registry_handle_global_remove
-};
-
-static bool
-_eom_wayland_client_initialize()
-{
-       int ecore_count = -1;
-
-       ecore_count = ecore_wl_init(NULL);
-       RETV_IF_FAIL(ecore_count > 0, false);
-
-       wl_list_init(&wl_client_info.eom_wl_output_list);
-
-       wl_client_info.display = ecore_wl_display_get();
-       GOTO_IF_FAIL(wl_client_info.display != NULL, fail);
-
-       /* get the registry */
-       wl_client_info.registry =
-               wl_display_get_registry(wl_client_info.display);
-       GOTO_IF_FAIL(wl_client_info.registry != NULL, fail);
-
-       /* get the global objects */
-       wl_registry_add_listener(wl_client_info.registry,
-               &eom_registry_listener, &wl_client_info);
-       wl_display_dispatch(wl_client_info.display);
-       wl_display_roundtrip(wl_client_info.display);
-#if 0
-       /* remove type none eom_wl_outputs */
-       if (!wl_list_empty(&wl_client_info.eom_wl_output_list)) {
-               EomWaylandOutput *eom_wl_output = NULL;
-               EomWaylandOutput *tmp = NULL;
-
-               wl_list_for_each_safe(eom_wl_output, tmp,
-                       &wl_client_info.eom_wl_output_list, link) {
-                       if (eom_wl_output->eom_type == WL_EOM_TYPE_NONE) {
-                               WARN("[EOM_CLIENT] eom_type is NONE. remove output:%d\n",
-                                       eom_wl_output->id);
-                               wl_output_destroy(eom_wl_output->output);
-                               wl_list_remove(&eom_wl_output->link);
-                               free(eom_wl_output);
-                               eom_wl_output = NULL;
-                       }
-               }
-       }
-#endif
-       if (wl_client_info.num_outputs == 0)
-               WARN("[EOM_CLIENT] not support external output at this device.\n");
-
-       /* output list */
-       if (wl_list_empty(&wl_client_info.eom_wl_output_list))
-               WARN("[EOM_CLIENT] no wl output at this device.\n");
-
-       INFO("[EOM_CLIENT] wayland client init.");
-
-       return true;
-fail:
-
-       if (wl_client_info.registry) {
-               wl_registry_destroy(wl_client_info.registry);
-               wl_client_info.registry = NULL;
-       }
-
-       ecore_wl_shutdown();
-
-       return false;
-}
-
-static void
-_eom_wayland_client_deinitialize()
-{
-       EomWaylandOutput *eom_wl_output = NULL;
-       EomWaylandOutput *tmp = NULL;
-
-       /* remove all eom_wl_outputs */
-       if (!wl_list_empty(&wl_client_info.eom_wl_output_list)) {
-               wl_list_for_each_safe(eom_wl_output, tmp,
-                       &wl_client_info.eom_wl_output_list, link) {
-                       if (eom_wl_output->output)
-                               wl_output_destroy(eom_wl_output->output);
-                       free(eom_wl_output);
-                       eom_wl_output = NULL;
-               }
-       }
-
-       if (wl_client_info.registry) {
-               wl_registry_destroy(wl_client_info.registry);
-               wl_client_info.registry = NULL;
-       }
-       ecore_wl_shutdown();
-
-       INFO("[EOM_CLIENT] wayland client deinit.");
-}
-
-bool
-eom_wayland_client_init(notify_func func)
-{
-       bool ret = false;
-
-       if (eom_wayland_init)
-               return true;
-
-       ret = _eom_wayland_client_initialize();
-       GOTO_IF_FAIL(ret != false, fail);
-
-       wl_client_info.func = func;
-
-       eom_wayland_init = 1;
-
-       return ret;
-fail:
-       return false;
-}
-
-void
-eom_wayland_client_deinit(GList *cb_info_list)
-{
-       if (!eom_wayland_init)
-               return;
-
-       _eom_wayland_client_deinitialize();
-
-       eom_wayland_init = 0;
-
-       memset(&wl_client_info, 0x0, sizeof(EomWaylandClientInfo));
-}
-
-GArray *
-eom_wayland_client_get_output_ids(void)
-{
-       GArray *array = NULL;
-       GValue v = G_VALUE_INIT;
-       EomWaylandOutput *eom_wl_output = NULL;
-       EomWaylandOutput *tmp = NULL;
-
-       if (wl_list_empty(&wl_client_info.eom_wl_output_list)) {
-               ERR("error. no outputs.\n");
-               return NULL;
-       }
-/*LCOV_EXCL_START*/
-       array = g_array_new(FALSE, FALSE, sizeof(GValue));
-
-       wl_list_for_each_safe(eom_wl_output, tmp,
-               &wl_client_info.eom_wl_output_list, link) {
-
-               if (eom_wl_output) {
-                       g_value_init(&v, G_TYPE_INT);
-                       g_value_set_int(&v, eom_wl_output->id);
-                       array = g_array_append_val(array, v);
-                       g_value_unset(&v);
-               }
-       }
-
-       /* returned array will be freed by caller */
-       return array;
-/*LCOV_EXCL_STOP*/
-}
-/*LCOV_EXCL_START*/
-GArray *
-eom_wayland_client_get_output_info(eom_output_id output_id)
-{
-       GArray *array = NULL;
-       GValue v = G_VALUE_INIT;
-       EomWaylandOutput *eom_wl_output = NULL;
-
-       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
-               &wl_client_info.eom_wl_output_list, output_id);
-       RETV_IF_FAIL(eom_wl_output != NULL, NULL);
-
-       array = g_array_new(FALSE, FALSE, sizeof(GValue));
-
-       /* 0:output_id */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->id);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 1:output_type */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->eom_type);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 2:output_mode */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->eom_mode);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 3:w */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->width);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 4:h */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->height);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 5:w_mm */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->physical_width);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 6:h_mm */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->physical_height);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* 7:attribute */
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, eom_wl_output->eom_attribute);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* returned array will be freed by caller */
-       return array;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-GArray *
-eom_wayland_client_set_attribute(eom_output_id output_id,
-               eom_output_attribute_e attr)
-{
-       GArray *array = NULL;
-       GValue v = G_VALUE_INIT;
-       EomWaylandOutput *eom_wl_output = NULL;
-       int ret = 0;
-
-       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
-               &wl_client_info.eom_wl_output_list, output_id);
-       GOTO_IF_FAIL(eom_wl_output != NULL, fail);
-
-       wl_eom_set_attribute(wl_client_info.eom, eom_wl_output->id,
-               _convert_to_wl_eom_attribute(attr));
-
-       /* TODO:
-         * wait for the result of set_attribute.
-         * this should be the blocking call.
-         */
-       wl_display_dispatch(wl_client_info.display);
-       wl_display_roundtrip(wl_client_info.display);
-
-       if (eom_wl_output->error == WL_EOM_ERROR_NONE)
-               ret = 1;
-
-       array = g_array_new(FALSE, FALSE, sizeof(GValue));
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, ret);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* returned array will be freed by caller */
-       return array;
-fail:
-
-       return NULL;
-}
-/*LCOV_EXCL_STOP*/
-/*LCOV_EXCL_START*/
-GArray *
-eom_wayland_client_set_window(eom_output_id output_id, Evas_Object *win)
-{
-       GArray *array = NULL;
-       GValue v = G_VALUE_INIT;
-       Ecore_Wl_Window *e_wl_win = NULL;
-       EomWaylandOutput *eom_wl_output = NULL;
-       struct wl_shell_surface *shell_surface = NULL;
-       struct xdg_surface *xdg_shell_surface = NULL;
-       int ret = 0;
-
-       evas_object_show(win);
-
-       e_wl_win = elm_win_wl_window_get(win);
-       GOTO_IF_FAIL(e_wl_win != NULL, fail);
-
-       eom_wl_output = _eom_wayland_client_find_output_from_eom_output(
-               &wl_client_info.eom_wl_output_list, output_id);
-       GOTO_IF_FAIL(eom_wl_output != NULL, fail);
-
-#if 0
-       elm_win_aux_hint_add(win, "wm.policy.win.user.geometry", "1");
-#endif
-
-       /* set full screen at output */
-       xdg_shell_surface = ecore_wl_window_xdg_surface_get(e_wl_win);
-       if (xdg_shell_surface) {
-               wl_eom_set_xdg_window(wl_client_info.eom, output_id, xdg_shell_surface);
-       } else {
-               shell_surface = ecore_wl_window_shell_surface_get(e_wl_win);
-               if (shell_surface) {
-                       wl_eom_set_shell_window(wl_client_info.eom, output_id, shell_surface);
-               } else {
-                       ERR("no wl surface.\n");
-                       goto fail;
-               }
-       }
-
-       /* TODO:
-         * wait for the result of set_window.
-         * this should be the blocking call.
-         */
-       wl_display_dispatch(wl_client_info.display);
-       wl_display_roundtrip(wl_client_info.display);
-
-       if (eom_wl_output->error == WL_EOM_ERROR_NONE)
-               ret = 1;
-
-       array = g_array_new(FALSE, FALSE, sizeof(GValue));
-       g_value_init(&v, G_TYPE_INT);
-       g_value_set_int(&v, ret);
-       array = g_array_append_val(array, v);
-       g_value_unset(&v);
-
-       /* returned array will be freed by caller */
-       return array;
-fail:
-
-       return NULL;
-}
-/*LCOV_EXCL_STOP*/
-
diff --git a/src/wayland/eom-wayland.h b/src/wayland/eom-wayland.h
deleted file mode 100644 (file)
index 5385dea..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**************************************************************************
- *
- * eom (external output manager)
- *
- * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Contact:
- * SooChan Lim <sc1.lim@samsung.com>
- * Boram Park <boram1288.park@samsung.com>
- * Changyeon Lee <cyeon.lee@samsung.com>
- * JunKyeong Kim <jk0430.kim@samsung.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
-**************************************************************************/
-
-#ifndef __EOM_WAYLAND_H__
-#define __EOM_WAYLAND_H__
-
-#include <stdbool.h>
-#include <glib.h>
-#include <glib-object.h>
-#include "eom.h"
-#include "eom-private.h"
-
-bool eom_wayland_client_init(notify_func func);
-void eom_wayland_client_deinit(GList *cb_info_list);
-
-GArray *eom_wayland_client_get_output_ids(void);
-GArray *eom_wayland_client_get_output_info(eom_output_id output_id);
-GArray *eom_wayland_client_set_attribute(eom_output_id output_id,
-               eom_output_attribute_e attry);
-GArray *eom_wayland_client_set_window(eom_output_id output_id,
-               Evas_Object *win);
-
-
-#endif /* __EOM_WAYLAND_H__ */
-
diff --git a/src/wayland/protocol/eom-client-protocol.h b/src/wayland/protocol/eom-client-protocol.h
deleted file mode 100644 (file)
index c88784e..0000000
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that\n the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission.  The copyright holders make no
- * representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#ifndef WL_EOM_CLIENT_PROTOCOL_H
-#define WL_EOM_CLIENT_PROTOCOL_H
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-client.h"
-
-struct wl_client;
-struct wl_resource;
-
-struct wl_eom;
-struct wl_shell_surface;
-struct xdg_surface;
-
-extern const struct wl_interface wl_eom_interface;
-
-#ifndef WL_EOM_ERROR_ENUM
-#define WL_EOM_ERROR_ENUM
-enum wl_eom_error {
-       WL_EOM_ERROR_NONE = 0,
-       WL_EOM_ERROR_NO_OUTPUT = 1,
-       WL_EOM_ERROR_NO_ATTRIBUTE = 2,
-       WL_EOM_ERROR_OUTPUT_OCCUPIED = 3,
-};
-#endif /* WL_EOM_ERROR_ENUM */
-
-#ifndef WL_EOM_TYPE_ENUM
-#define WL_EOM_TYPE_ENUM
-/**
- * wl_eom_type - connector type
- * @WL_EOM_TYPE_NONE: none
- * @WL_EOM_TYPE_VGA: VGA output connector type
- * @WL_EOM_TYPE_DVII: DVI-I output connector type
- * @WL_EOM_TYPE_DVID: DVI-D output connector type
- * @WL_EOM_TYPE_DVIA: DVI-A output connector type
- * @WL_EOM_TYPE_COMPOSITE: Composite output connector type
- * @WL_EOM_TYPE_SVIDEO: S-Video output connector type
- * @WL_EOM_TYPE_LVDS: LVDS output connector type
- * @WL_EOM_TYPE_COMPONENT: Component output connector type
- * @WL_EOM_TYPE_9PINDIN: 9 pin DIN output connector type
- * @WL_EOM_TYPE_DISPLAYPORT: DisplayPort output connector type
- * @WL_EOM_TYPE_HDMIA: HDMI type A output connector type
- * @WL_EOM_TYPE_HDMIB: HDMI type B output connector type
- * @WL_EOM_TYPE_TV: TV output connector type
- * @WL_EOM_TYPE_EDP: eDP output connector type
- * @WL_EOM_TYPE_VIRTUAL: Virtual output connector type
- * @WL_EOM_TYPE_DSI: DSI output connector type
- *
- * Define several connectors type of the external outputs
- */
-enum wl_eom_type {
-       WL_EOM_TYPE_NONE = 0,
-       WL_EOM_TYPE_VGA = 1,
-       WL_EOM_TYPE_DVII = 2,
-       WL_EOM_TYPE_DVID = 3,
-       WL_EOM_TYPE_DVIA = 4,
-       WL_EOM_TYPE_COMPOSITE = 5,
-       WL_EOM_TYPE_SVIDEO = 6,
-       WL_EOM_TYPE_LVDS = 7,
-       WL_EOM_TYPE_COMPONENT = 8,
-       WL_EOM_TYPE_9PINDIN = 9,
-       WL_EOM_TYPE_DISPLAYPORT = 10,
-       WL_EOM_TYPE_HDMIA = 11,
-       WL_EOM_TYPE_HDMIB = 12,
-       WL_EOM_TYPE_TV = 13,
-       WL_EOM_TYPE_EDP = 14,
-       WL_EOM_TYPE_VIRTUAL = 15,
-       WL_EOM_TYPE_DSI = 16,
-};
-#endif /* WL_EOM_TYPE_ENUM */
-
-#ifndef WL_EOM_STATUS_ENUM
-#define WL_EOM_STATUS_ENUM
-/**
- * wl_eom_status - connection status of the external output
- * @WL_EOM_STATUS_NONE: none
- * @WL_EOM_STATUS_CONNECTION: output connected
- * @WL_EOM_STATUS_DISCONNECTION: output disconnected
- *
- * The status of external output is connected or not.
- */
-enum wl_eom_status {
-       WL_EOM_STATUS_NONE = 0,
-       WL_EOM_STATUS_CONNECTION = 1,
-       WL_EOM_STATUS_DISCONNECTION = 2,
-};
-#endif /* WL_EOM_STATUS_ENUM */
-
-#ifndef WL_EOM_MODE_ENUM
-#define WL_EOM_MODE_ENUM
-/**
- * wl_eom_mode - mode of the external output
- * @WL_EOM_MODE_NONE: none
- * @WL_EOM_MODE_MIRROR: mirror mode
- * @WL_EOM_MODE_PRESENTATION: presentation mode
- *
- * There are two modes for external output. Mirror mode is showing main
- * display screen to external output. Presentation mode is showing app's
- * specific buffer contents to external output.
- */
-enum wl_eom_mode {
-       WL_EOM_MODE_NONE = 0,
-       WL_EOM_MODE_MIRROR = 1,
-       WL_EOM_MODE_PRESENTATION = 2,
-};
-#endif /* WL_EOM_MODE_ENUM */
-
-#ifndef WL_EOM_ATTRIBUTE_ENUM
-#define WL_EOM_ATTRIBUTE_ENUM
-/**
- * wl_eom_attribute - attribute of the external output
- * @WL_EOM_ATTRIBUTE_NONE: none
- * @WL_EOM_ATTRIBUTE_NORMAL: nomal attribute
- * @WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE: exclusive share attribute
- * @WL_EOM_ATTRIBUTE_EXCLUSIVE: exclusive attribute
- *
- * Application can use external output by attribute.
- *
- * If application succeed to set attribute and set external output window,
- * the external output's mode will be changed to Presentation mode.
- *
- * Attribute has priority. If attribute is set to normal, it can be changed
- * by normal, exclusive_share, exclusive. If attribute is set to
- * exclusive_share, it can be changed by exclusive_share, exclusive. If
- * attribute is set to exclusive, it cannot be changed by other
- * application. If application which set attribute is quit or set to none,
- * the mode will be changed to Mirror if connected.
- */
-enum wl_eom_attribute {
-       WL_EOM_ATTRIBUTE_NONE = 0,
-       WL_EOM_ATTRIBUTE_NORMAL = 1,
-       WL_EOM_ATTRIBUTE_EXCLUSIVE_SHARE = 2,
-       WL_EOM_ATTRIBUTE_EXCLUSIVE = 3,
-};
-#endif /* WL_EOM_ATTRIBUTE_ENUM */
-
-#ifndef WL_EOM_ATTRIBUTE_STATE_ENUM
-#define WL_EOM_ATTRIBUTE_STATE_ENUM
-/**
- * wl_eom_attribute_state - state of the external output attribute
- * @WL_EOM_ATTRIBUTE_STATE_NONE: none
- * @WL_EOM_ATTRIBUTE_STATE_ACTIVE: attribute is active on the output
- * @WL_EOM_ATTRIBUTE_STATE_INACTIVE: attribute is inactive on the output
- * @WL_EOM_ATTRIBUTE_STATE_LOST: the connection of output is lost
- *
- * It means the state of attribute. The applicatoin which set attribute
- * successful can get state.
- *
- * Active means the external window is set to external output succefully.
- * So application can use that window. Inactive means cannot use external
- * output, because of dissconnecting or some other reasons. But if
- * connected again, the application can use external output. Lost means the
- * application is lost it's right to external output by other application's
- * attribute set.
- */
-enum wl_eom_attribute_state {
-       WL_EOM_ATTRIBUTE_STATE_NONE = 0,
-       WL_EOM_ATTRIBUTE_STATE_ACTIVE = 1,
-       WL_EOM_ATTRIBUTE_STATE_INACTIVE = 2,
-       WL_EOM_ATTRIBUTE_STATE_LOST = 3,
-};
-#endif /* WL_EOM_ATTRIBUTE_STATE_ENUM */
-
-/**
- * wl_eom - an interface for external outputs
- * @output_count: external output count
- * @output_info: 
- * @output_type: output type and connection info
- * @output_mode: output mode info
- * @output_attribute: output attribute info
- * @output_set_window: reslut of set_window
- *
- * An interface to get information of external outputs and to use
- * external outputs.
- */
-struct wl_eom_listener {
-       /**
-        * output_count - external output count
-        * @count: (none)
-        *
-        * Get the number of external output devices that are supported
-        * by this device.
-        */
-       void (*output_count)(void *data,
-                            struct wl_eom *wl_eom,
-                            uint32_t count);
-       /**
-        * output_info - 
-        * @output_id: (none)
-        * @type: (none)
-        * @mode: (none)
-        * @w: (none)
-        * @h: (none)
-        * @w_mm: (none)
-        * @h_mm: (none)
-        * @connection: (none)
-        * @skip: (none)
-        * @attribute: (none)
-        * @attribute_state: (none)
-        * @error: (none)
-        *
-        * Send information of specific external output to client.
-        *
-        * Output_id is numbering of external outputs. It is fixed when
-        * booting time. The type, mode attribute, attribute_state is
-        * mentioned above. The w and h is the resolution of external
-        * output. The w_mm and h_mm is the physical size of external
-        * output. The unit is mm.
-        */
-       void (*output_info)(void *data,
-                           struct wl_eom *wl_eom,
-                           uint32_t output_id,
-                           uint32_t type,
-                           uint32_t mode,
-                           uint32_t w,
-                           uint32_t h,
-                           uint32_t w_mm,
-                           uint32_t h_mm,
-                           uint32_t connection,
-                           uint32_t skip,
-                           uint32_t attribute,
-                           uint32_t attribute_state,
-                           uint32_t error);
-       /**
-        * output_type - output type and connection info
-        * @output_id: (none)
-        * @type: (none)
-        * @status: (none)
-        *
-        * Send information of output type and connection.
-        */
-       void (*output_type)(void *data,
-                           struct wl_eom *wl_eom,
-                           uint32_t output_id,
-                           uint32_t type,
-                           uint32_t status);
-       /**
-        * output_mode - output mode info
-        * @output_id: (none)
-        * @mode: (none)
-        *
-        * Send information of output mode.
-        */
-       void (*output_mode)(void *data,
-                           struct wl_eom *wl_eom,
-                           uint32_t output_id,
-                           uint32_t mode);
-       /**
-        * output_attribute - output attribute info
-        * @output_id: (none)
-        * @attribute: (none)
-        * @attribute_state: (none)
-        * @error: (none)
-        *
-        * Send information of output attribute and attribute state.
-        */
-       void (*output_attribute)(void *data,
-                                struct wl_eom *wl_eom,
-                                uint32_t output_id,
-                                uint32_t attribute,
-                                uint32_t attribute_state,
-                                uint32_t error);
-       /**
-        * output_set_window - reslut of set_window
-        * @output_id: (none)
-        * @error: (none)
-        *
-        * Send the result of set_window to client.
-        */
-       void (*output_set_window)(void *data,
-                                 struct wl_eom *wl_eom,
-                                 uint32_t output_id,
-                                 uint32_t error);
-};
-
-static inline int
-wl_eom_add_listener(struct wl_eom *wl_eom,
-                   const struct wl_eom_listener *listener, void *data)
-{
-       return wl_proxy_add_listener((struct wl_proxy *) wl_eom,
-                                    (void (**)(void)) listener, data);
-}
-
-#define WL_EOM_SET_ATTRIBUTE   0
-#define WL_EOM_SET_XDG_WINDOW  1
-#define WL_EOM_SET_SHELL_WINDOW        2
-#define WL_EOM_GET_OUTPUT_INFO 3
-
-#define WL_EOM_SET_ATTRIBUTE_SINCE_VERSION     1
-#define WL_EOM_SET_XDG_WINDOW_SINCE_VERSION    1
-#define WL_EOM_SET_SHELL_WINDOW_SINCE_VERSION  1
-#define WL_EOM_GET_OUTPUT_INFO_SINCE_VERSION   1
-
-static inline void
-wl_eom_set_user_data(struct wl_eom *wl_eom, void *user_data)
-{
-       wl_proxy_set_user_data((struct wl_proxy *) wl_eom, user_data);
-}
-
-static inline void *
-wl_eom_get_user_data(struct wl_eom *wl_eom)
-{
-       return wl_proxy_get_user_data((struct wl_proxy *) wl_eom);
-}
-
-static inline uint32_t
-wl_eom_get_version(struct wl_eom *wl_eom)
-{
-       return wl_proxy_get_version((struct wl_proxy *) wl_eom);
-}
-
-static inline void
-wl_eom_destroy(struct wl_eom *wl_eom)
-{
-       wl_proxy_destroy((struct wl_proxy *) wl_eom);
-}
-
-static inline void
-wl_eom_set_attribute(struct wl_eom *wl_eom, uint32_t output_id, uint32_t attribute)
-{
-       wl_proxy_marshal((struct wl_proxy *) wl_eom,
-                        WL_EOM_SET_ATTRIBUTE, output_id, attribute);
-}
-
-static inline void
-wl_eom_set_xdg_window(struct wl_eom *wl_eom, uint32_t output_id, struct xdg_surface *surface)
-{
-       wl_proxy_marshal((struct wl_proxy *) wl_eom,
-                        WL_EOM_SET_XDG_WINDOW, output_id, surface);
-}
-
-static inline void
-wl_eom_set_shell_window(struct wl_eom *wl_eom, uint32_t output_id, struct wl_shell_surface *surface)
-{
-       wl_proxy_marshal((struct wl_proxy *) wl_eom,
-                        WL_EOM_SET_SHELL_WINDOW, output_id, surface);
-}
-
-static inline void
-wl_eom_get_output_info(struct wl_eom *wl_eom, uint32_t output_id)
-{
-       wl_proxy_marshal((struct wl_proxy *) wl_eom,
-                        WL_EOM_GET_OUTPUT_INFO, output_id);
-}
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/wayland/protocol/eom-protocol.c b/src/wayland/protocol/eom-protocol.c
deleted file mode 100644 (file)
index 3ca9b25..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
- * without fee, provided that\n the above copyright notice appear in
- * all copies and that both that copyright notice and this permission
- * notice appear in supporting documentation, and that the name of
- * the copyright holders not be used in advertising or publicity
- * pertaining to distribution of the software without specific,
- * written prior permission.  The copyright holders make no
- * representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied
- * warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- * THIS SOFTWARE.
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-extern const struct wl_interface wl_shell_surface_interface;
-extern const struct wl_interface xdg_surface_interface;
-
-static const struct wl_interface *types[] = {
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       NULL,
-       &xdg_surface_interface,
-       NULL,
-       &wl_shell_surface_interface,
-};
-
-static const struct wl_message wl_eom_requests[] = {
-       { "set_attribute", "uu", types + 0 },
-       { "set_xdg_window", "uo", types + 12 },
-       { "set_shell_window", "uo", types + 14 },
-       { "get_output_info", "u", types + 0 },
-};
-
-static const struct wl_message wl_eom_events[] = {
-       { "output_count", "u", types + 0 },
-       { "output_info", "uuuuuuuuuuuu", types + 0 },
-       { "output_type", "uuu", types + 0 },
-       { "output_mode", "uu", types + 0 },
-       { "output_attribute", "uuuu", types + 0 },
-       { "output_set_window", "uu", types + 0 },
-};
-
-WL_EXPORT const struct wl_interface wl_eom_interface = {
-       "wl_eom", 1,
-       4, wl_eom_requests,
-       6, wl_eom_events,
-};
-
diff --git a/src/wayland/protocol/eom.xml b/src/wayland/protocol/eom.xml
deleted file mode 100644 (file)
index b1fd312..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="wl_eom">
-
-  <copyright>
-    Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
-
-    Permission to use, copy, modify, distribute, and sell this
-    software and its documentation for any purpose is hereby granted
-    without fee, provided that\n the above copyright notice appear in
-    all copies and that both that copyright notice and this permission
-    notice appear in supporting documentation, and that the name of
-    the copyright holders not be used in advertising or publicity
-    pertaining to distribution of the software without specific,
-    written prior permission.  The copyright holders make no
-    representations about the suitability of this software for any
-    purpose.  It is provided "as is" without express or implied
-    warranty.
-
-    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-    THIS SOFTWARE.
-  </copyright>
-
-  <interface name="wl_eom" version="1">
-    <description summary="an interface for external outputs">
-      An interface to get information of external outputs and to use external outputs.
-    </description>
-
-    <enum name="error">
-      <entry name="none" value="0" summary="no error"/>
-      <entry name="no_output" value="1" summary="Given output is invalid."/>
-      <entry name="no_attribute" value="2" summary="Given attribute is invalid."/>
-      <entry name="output_occupied" value="3" summary="The key has been grabbed already."/>
-    </enum>
-
-    <enum name="type">
-      <description summary="connector type">
-        Define several connectors type of the external outputs
-      </description>
-      <entry name="none" value="0" summary="none"/>
-      <entry name="vga" value="1" summary="VGA output connector type"/>
-      <entry name="dvii" value="2" summary="DVI-I output connector type"/>
-      <entry name="dvid" value="3" summary="DVI-D output connector type"/>
-      <entry name="dvia" value="4" summary="DVI-A output connector type"/>
-      <entry name="composite" value="5" summary="Composite output connector type"/>
-      <entry name="svideo" value="6" summary="S-Video output connector type"/>
-      <entry name="lvds" value="7" summary="LVDS output connector type"/>
-      <entry name="component" value="8" summary="Component output connector type"/>
-      <entry name="9pindin" value="9" summary="9 pin DIN output connector type"/>
-      <entry name="displayport" value="10" summary="DisplayPort output connector type"/>
-      <entry name="hdmia" value="11" summary="HDMI type A output connector type"/>
-      <entry name="hdmib" value="12" summary="HDMI type B output connector type"/>
-      <entry name="tv" value="13" summary="TV output connector type"/>
-      <entry name="edp" value="14" summary="eDP output connector type"/>
-      <entry name="virtual" value="15" summary="Virtual output connector type"/>
-      <entry name="dsi" value="16" summary="DSI output connector type"/>
-    </enum>
-
-    <enum name="status">
-      <description summary="connection status of the external output">
-        The status of external output is connected or not.
-      </description>
-      <entry name="none" value="0" summary="none"/>
-      <entry name="connection" value="1" summary="output connected"/>
-      <entry name="disconnection" value="2" summary="output disconnected"/>
-    </enum>
-
-    <enum name="mode">
-      <description summary="mode of the external output">
-        There are two modes for external output.
-        Mirror mode is showing main display screen to external output.
-        Presentation mode is showing app's specific buffer contents to external output.
-      </description>
-      <entry name="none" value="0" summary="none"/>
-      <entry name="mirror" value="1" summary="mirror mode"/>
-      <entry name="presentation" value="2" summary="presentation mode"/>
-    </enum>
-
-    <enum name="attribute">
-      <description summary="attribute of the external output">
-        Application can use external output by attribute.
-
-        If application succeed to set attribute and set external output window,
-        the external output's mode will be changed to Presentation mode.
-
-        Attribute has priority.
-        If attribute is set to normal, it can be changed by normal, exclusive_share, exclusive.
-        If attribute is set to exclusive_share, it can be changed by exclusive_share, exclusive.
-        If attribute is set to exclusive, it cannot be changed by other application.
-        If application which set attribute is quit or set to none,
-        the mode will be changed to Mirror if connected.
-      </description>
-      <entry name="none" value="0" summary="none"/>
-      <entry name="normal" value="1" summary="nomal attribute"/>
-      <entry name="exclusive_share" value="2" summary="exclusive share attribute"/>
-      <entry name="exclusive" value="3" summary="exclusive attribute"/>
-    </enum>
-
-    <enum name="attribute_state">
-      <description summary="state of the external output attribute">
-        It means the state of attribute.
-        The applicatoin which set attribute successful can get state.
-
-        Active means the external window is set to external output succefully.
-        So application can use that window.
-        Inactive means cannot use external output, because of dissconnecting or some other reasons.
-        But if connected again, the application can use external output.
-        Lost means the application is lost it's right to external output by other application's attribute set.
-      </description>
-      <entry name="none" value="0" summary="none"/>
-      <entry name="active" value="1" summary="attribute is active on the output"/>
-      <entry name="inactive" value="2" summary="attribute is inactive on the output"/>
-      <entry name="lost" value="3" summary="the connection of output is lost"/>
-    </enum>
-
-    <request name="set_attribute">
-      <description summary="api to set attribute to specific external output">
-        Application can have right to external output by set_attribute.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="attribute" type="uint"/>
-    </request>
-
-    <request name="set_xdg_window">
-      <description summary="set xdg surface to external window">
-        Use xdg_shell_surface to external output.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="surface" type="object" interface="xdg_surface" allow-null="false"/>
-    </request>
-
-    <request name="set_shell_window">
-      <description summary="">
-        Use shell_surface to external output.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="surface" type="object" interface="wl_shell_surface" allow-null="false"/>
-    </request>
-
-    <request name="get_output_info">
-      <description summary="get information of external output">
-        Request to server to send information of specific external output to client by output id.
-      </description>
-      <arg name="output_id" type="uint"/>
-    </request>
-
-    <event name="output_count">
-      <description summary="external output count">
-        Get the number of external output devices that are supported by this device.
-      </description>
-      <arg name="count" type="uint"/>
-    </event>
-
-    <event name="output_info">
-      <description summary="">
-        Send information of specific external output to client.
-
-        Output_id is numbering of external outputs. It is fixed when booting time.
-        The type, mode attribute, attribute_state is mentioned above.
-        The w and h is the resolution of external output.
-        The w_mm and h_mm is the physical size of external output. The unit is mm.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="type" type="uint"/>
-      <arg name="mode" type="uint"/>
-      <arg name="w" type="uint"/>
-      <arg name="h" type="uint"/>
-      <arg name="w_mm" type="uint"/>
-      <arg name="h_mm" type="uint"/>
-      <arg name="connection" type="uint"/>
-      <arg name="skip" type="uint"/>
-      <arg name="attribute" type="uint"/>
-      <arg name="attribute_state" type="uint"/>
-      <arg name="error" type="uint"/>
-    </event>
-
-    <event name="output_type">
-      <description summary="output type and connection info">
-        Send information of output type and connection.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="type" type="uint"/>
-      <arg name="status" type="uint"/>
-    </event>
-
-    <event name="output_mode">
-      <description summary="output mode info">
-        Send information of output mode.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="mode" type="uint"/>
-    </event>
-
-    <event name="output_attribute">
-      <description summary="output attribute info">
-        Send information of output attribute and attribute state.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="attribute" type="uint"/>
-      <arg name="attribute_state" type="uint"/>
-      <arg name="error" type="uint"/>
-    </event>
-
-    <event name="output_set_window">
-      <description summary="reslut of set_window">
-        Send the result of set_window to client.
-      </description>
-      <arg name="output_id" type="uint"/>
-      <arg name="error" type="uint"/>
-    </event>
-
-  </interface>
-
-</protocol>