build for wayland... 91/40591/1 submit/tizen/20150605.094953
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 5 Jun 2015 09:04:07 +0000 (18:04 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 5 Jun 2015 09:04:07 +0000 (18:04 +0900)
just build.. eom does not work on wayland yet

Change-Id: I82667d9c6bc13832776e01fdb347b333d4810a40

configure.ac
include/eom.h
packaging/libeom.spec
src/eom-dbus.c
src/eom.c

index 3f0a38c..c2a0ef2 100755 (executable)
@@ -50,6 +50,13 @@ 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)
+
+
 # Checks for pkg-config packages
 PKG_CHECK_MODULES(DBUS, dbus-1)
 PKG_CHECK_MODULES(GLIB, glib-2.0 gobject-2.0)
@@ -58,6 +65,23 @@ 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_CLAGS "
+    LIBEOM_LIBS="$LIBEOM_LIBS "
+fi
+
+if test "x$EOM_PLATFORM" = "xWAYLAND"; then
+    PKG_CHECK_MODULES(WAYLAND_CLIENT, wayland-client)
+    LIBEOM_CFLAGS="$LIBEOM_CFLAGS $WAYLAND_CLIENT_CFLAGS"
+    LIBEOM_LIBS="$LIBEOM_LIBS $WAYLAND_CLIENT_LIBS"
+
+       WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
+    AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
+                   [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
+fi
+
+
+
 PKG_CHECK_MODULES(CAPI, [capi-base-common >= 0.1.1], [CAPI_VER="yes"], [CAPI_VER="no"])
 if test "x$CAPI_VER" = "xyes"; then
     AC_DEFINE(HAVE_CAPI_0_1_1,1,[The version of capi-base-common is over 0.1.1])
@@ -76,6 +100,15 @@ 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")
+
 # Checks for header files.
 AC_HEADER_STDC
 
index 55f3d17..e32ba4f 100755 (executable)
@@ -466,6 +466,7 @@ int eom_get_output_physical_size (eom_output_id output_id, int *phy_width, int *
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EOM_ERROR_NO_SUCH_DEVICE Invalid external output instance
  * @retval #EOM_ERROR_MESSAGE_SENDING_FAILURE Communication failure with EOM module
  * @retval #EOM_ERROR_MESSAGE_OPERATION_FAILURE Operation failure
  * @pre eom_init()
@@ -483,6 +484,7 @@ int eom_set_output_attribute (eom_output_id output_id, eom_output_attribute_e at
  * @return 0 on success, otherwise a negative error value
  * @retval #EOM_ERROR_NONE Successful
  * @retval #EOM_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EOM_ERROR_NO_SUCH_DEVICE Invalid external output instance
  * @retval #EOM_ERROR_MESSAGE_SENDING_FAILURE Communication failure with EOM module
  * @retval #EOM_ERROR_MESSAGE_OPERATION_FAILURE Operation failure
  * @pre eom_init()
index 3128578..26968f8 100644 (file)
@@ -1,3 +1,6 @@
+%bcond_with x
+%bcond_with wayland
+
 Name: libeom
 Summary: External Output Manager Library
 Version: 1.0.0
@@ -7,6 +10,10 @@ License: MIT
 Source0: %{name}-%{version}.tar.gz
 Source1001:    libeom.manifest
 
+%if %{with wayland}
+BuildRequires:  pkgconfig(wayland-client)
+%else
+%endif
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(gio-unix-2.0)
@@ -32,7 +39,12 @@ cp %{SOURCE1001} .
 %build
 export CFLAGS="-g -O0 -Wall -Werror -Wno-error=deprecated-declarations"
 export LDFLAGS="$LDFLAGS -Wl,--hash-style=both -Wl,--as-needed"
-%reconfigure --disable-dlog --disable-static
+%if %{with wayland}
+%reconfigure --disable-dlog --disable-static --with-eom-platform=WAYLAND
+%else
+%reconfigure --disable-dlog --disable-static --with-eom-platform=X11
+%endif
+
 make %{?_smp_mflags}
 
 %install
index bf5bf6a..9ffe3c7 100755 (executable)
@@ -90,7 +90,7 @@ _eom_dbus_convert_gvalue_to_message (GValueArray *array, DBusMessage *msg)
         GValue *v = g_value_array_get_nth (array, i);
         GType type = v->g_type;
 
-        INFO ("[EOM_CLIENT:%s] type(%d)", client_info.name, type);
+        INFO ("[EOM_CLIENT:%s] type(%d)", client_info.name, (int)type);
 
         switch (type)
         {
index d60bf50..6d9543b 100755 (executable)
--- a/src/eom.c
+++ b/src/eom.c
@@ -980,6 +980,7 @@ eom_unset_attribute_changed_cb (eom_attribute_changed_cb callback)
 API int
 eom_set_output_attribute (eom_output_id output_id, eom_output_attribute_e attr)
 {
+    eom_output_info *output_info = NULL;
     bool ret = false;
     GValueArray *msg_array;
     GValueArray *ret_array;
@@ -992,6 +993,14 @@ eom_set_output_attribute (eom_output_id output_id, eom_output_attribute_e attr)
 
     _eom_mutex_lock ();
 
+    output_info = _eom_find_output_info (output_id);
+    if (!output_info)
+    {
+        set_last_result (EOM_ERROR_NO_SUCH_DEVICE);
+        _eom_mutex_unlock ();
+        return EOM_ERROR_NO_SUCH_DEVICE;
+    }
+
     pid = getpid();
 
     INFO ("output_id: %d, pid: %d, mode: %d\n", output_id, pid, attr);
@@ -1194,6 +1203,8 @@ eom_get_output_physical_size (eom_output_id output_id, int *phy_width, int *phy_
 API int
 eom_set_output_window (eom_output_id output_id, Evas_Object *win)
 {
+#ifdef HAVE_X11
+    eom_output_info *output_info = NULL;
     bool ret = false;
     GValueArray *msg_array;
     GValueArray *ret_array;
@@ -1206,6 +1217,14 @@ eom_set_output_window (eom_output_id output_id, Evas_Object *win)
 
     _eom_mutex_lock ();
 
+    output_info = _eom_find_output_info (output_id);
+    if (!output_info)
+    {
+        set_last_result (EOM_ERROR_NO_SUCH_DEVICE);
+        _eom_mutex_unlock ();
+        return EOM_ERROR_NO_SUCH_DEVICE;
+    }
+
     pid = getpid();
     xwin = elm_win_xwindow_get (win);
 
@@ -1244,10 +1263,11 @@ eom_set_output_window (eom_output_id output_id, Evas_Object *win)
         return EOM_ERROR_NONE;
     }
 
-
     INFO ("SetWindow: failed\n");
     _eom_mutex_unlock ();
-
     return EOM_ERROR_MESSAGE_OPERATION_FAILURE;
+#else
+    return EOM_ERROR_NONE;
+#endif
 }