using tizen-extension wayland protocol instead of including *protocol.c directly 30/44430/1 accepted/tizen/mobile/20150723.121253 accepted/tizen/tv/20150723.121331 accepted/tizen/wearable/20150723.121355 submit/tizen/20150722.053256 submit/tizen/20150723.044444
authorBoram Park <boram1288.park@samsung.com>
Mon, 20 Jul 2015 10:59:33 +0000 (19:59 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 21 Jul 2015 01:01:50 +0000 (10:01 +0900)
Change-Id: I66bba71559bf9d7d94d00a5c124c66c1acf8d37f

CMakeLists.txt
include/tizen-transient-for-client-protocol.h [deleted file]
packaging/aul.spec
src/app_group.c
src/tizen-transient-for-protocol.c [deleted file]

index 9cca957..2b172dd 100644 (file)
@@ -30,7 +30,7 @@ pkg_check_modules(pkgs REQUIRED  ${AUL-1_PKG_CHECK_MODULES} )
 
 SET(AUL-1_LIB_PKG_CHECK_MODULES dlog bundle dbus-glib-1 ail xdgmime app-checker libtzplatform-config pkgmgr-info libsystemd-daemon security-manager)
 IF (with_wayland)
-       pkg_check_modules(libpkgs REQUIRED ${AUL-1_LIB_PKG_CHECK_MODULES} wayland-client)
+       pkg_check_modules(libpkgs REQUIRED ${AUL-1_LIB_PKG_CHECK_MODULES} wayland-client tizen-extension-client)
 ENDIF (with_wayland)
 IF (with_x11)
        pkg_check_modules(libpkgs REQUIRED ${AUL-1_LIB_PKG_CHECK_MODULES})
@@ -82,9 +82,6 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 
 # aul_mods : modules (static library)
 SET(SRCS_aul_mods src/app_sock.c src/simple_util.c)
-IF (with_wayland)
-       SET(SRCS_aul_mods ${SRCS_aul_mods} src/tizen-transient-for-protocol.c)
-ENDIF (with_wayland)
 add_library(aul_mods STATIC
                ${SRCS_aul_mods}
                )
diff --git a/include/tizen-transient-for-client-protocol.h b/include/tizen-transient-for-client-protocol.h
deleted file mode 100644 (file)
index 1271fb9..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef TIZEN_TRANSIENT_FOR_CLIENT_PROTOCOL_H
-#define TIZEN_TRANSIENT_FOR_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 tizen_transient_for;
-
-extern const struct wl_interface tizen_transient_for_interface;
-
-struct tizen_transient_for_listener {
-       /**
-        * done - (none)
-        * @child_id: (none)
-        */
-       void (*done)(void *data,
-                    struct tizen_transient_for *tizen_transient_for,
-                    uint32_t child_id);
-};
-
-static inline int
-tizen_transient_for_add_listener(struct tizen_transient_for *tizen_transient_for,
-                                const struct tizen_transient_for_listener *listener, void *data)
-{
-       return wl_proxy_add_listener((struct wl_proxy *) tizen_transient_for,
-                                    (void (**)(void)) listener, data);
-}
-
-#define TIZEN_TRANSIENT_FOR_SET        0
-#define TIZEN_TRANSIENT_FOR_UNSET      1
-
-static inline void
-tizen_transient_for_set_user_data(struct tizen_transient_for *tizen_transient_for, void *user_data)
-{
-       wl_proxy_set_user_data((struct wl_proxy *) tizen_transient_for, user_data);
-}
-
-static inline void *
-tizen_transient_for_get_user_data(struct tizen_transient_for *tizen_transient_for)
-{
-       return wl_proxy_get_user_data((struct wl_proxy *) tizen_transient_for);
-}
-
-static inline void
-tizen_transient_for_destroy(struct tizen_transient_for *tizen_transient_for)
-{
-       wl_proxy_destroy((struct wl_proxy *) tizen_transient_for);
-}
-
-static inline void
-tizen_transient_for_set(struct tizen_transient_for *tizen_transient_for, uint32_t child_id, uint32_t parent_id)
-{
-       wl_proxy_marshal((struct wl_proxy *) tizen_transient_for,
-                        TIZEN_TRANSIENT_FOR_SET, child_id, parent_id);
-}
-
-static inline void
-tizen_transient_for_unset(struct tizen_transient_for *tizen_transient_for, uint32_t child_id)
-{
-       wl_proxy_marshal((struct wl_proxy *) tizen_transient_for,
-                        TIZEN_TRANSIENT_FOR_UNSET, child_id);
-}
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif
index f417ec3..2ce7551 100644 (file)
@@ -42,6 +42,7 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(libsystemd-daemon)
 %if %{with wayland}
 BuildRequires:  pkgconfig(wayland-client)
+BuildRequires:  pkgconfig(tizen-extension-client)
 %endif
 
 %description
index e5b2dbe..99f88e4 100644 (file)
 
 #ifdef WAYLAND
 #include <wayland-client.h>
-#include "tizen-transient-for-client-protocol.h"
-static struct tizen_transient_for *tz_transient_for = NULL;
+#include <tizen-extension-client-protocol.h>
+static struct tizen_policy *tz_policy = NULL;
 
 static void
 _reg_handle_global(void *data, struct wl_registry *reg, uint32_t id, const char *interface, uint32_t ver)
 {
-   if (!strcmp(interface, "tizen_transient_for"))
+   if (!strcmp(interface, "tizen_policy"))
      {
-        tz_transient_for = wl_registry_bind(reg,
+        tz_policy = wl_registry_bind(reg,
                                        id,
-                                       &tizen_transient_for_interface,
+                                       &tizen_policy_interface,
                                        1);
      }
 }
@@ -87,18 +87,18 @@ SLPAPI void aul_app_group_attach_window(int parent_wid, int child_wid)
        wl_registry_add_listener(reg, &reg_listener, NULL);
        wl_display_roundtrip(dpy);
 
-       if (!tz_transient_for)
+       if (!tz_policy)
        {
-               _E("ERR: no tizen_surface_extension global interface");
+               _E("ERR: no tizen_policy global interface");
                wl_registry_destroy(reg);
                wl_display_disconnect(dpy);
                return;
        }
 
-       tizen_transient_for_set(tz_transient_for, child_wid, parent_wid);
+       tizen_policy_set_transient_for(tz_policy, child_wid, parent_wid);
        wl_display_roundtrip(dpy);
 
-       tizen_transient_for_destroy(tz_transient_for);
+       tizen_policy_destroy(tz_policy);
        wl_registry_destroy(reg);
        wl_display_disconnect(dpy);
 #else
@@ -117,18 +117,18 @@ SLPAPI void aul_app_group_detach_window(int child_wid)
        wl_registry_add_listener(reg, &reg_listener, NULL);
        wl_display_roundtrip(dpy);
 
-       if (!tz_transient_for)
+       if (!tz_policy)
        {
-               _E("ERR: no tizen_surface_extension global interface");
+               _E("ERR: no tz_policy global interface");
                wl_registry_destroy(reg);
                wl_display_disconnect(dpy);
                return;
        }
 
-       tizen_transient_for_unset(tz_transient_for, child_wid);
+       tizen_policy_unset_transient_for(tz_policy, child_wid);
        wl_display_roundtrip(dpy);
 
-       tizen_transient_for_destroy(tz_transient_for);
+       tizen_policy_destroy(tz_policy);
        wl_registry_destroy(reg);
        wl_display_disconnect(dpy);
 #else
diff --git a/src/tizen-transient-for-protocol.c b/src/tizen-transient-for-protocol.c
deleted file mode 100644 (file)
index 5864df8..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-
-static const struct wl_interface *types[] = {
-       NULL,
-       NULL,
-};
-
-static const struct wl_message tizen_transient_for_requests[] = {
-       { "set", "uu", types + 0 },
-       { "unset", "u", types + 0 },
-};
-
-static const struct wl_message tizen_transient_for_events[] = {
-       { "done", "u", types + 0 },
-};
-
-WL_EXPORT const struct wl_interface tizen_transient_for_interface = {
-       "tizen_transient_for", 1,
-       2, tizen_transient_for_requests,
-       1, tizen_transient_for_events,
-};
-