From a65ed8644b2eaa670f319c354b3f67145d80cecb Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Thu, 22 Oct 2015 21:17:33 +0900 Subject: [PATCH] tzsh: Use tzsh-server package instead of using pre-generated [ch] files. Change-Id: I824e04a42b19d5ffd446f1a23436b7e74311676e --- configure.ac | 3 + packaging/e-mod-tizen-wm-policy.spec | 1 + src/Makefile.am | 8 +- src/e_mod_wl.c | 2 +- src/tizen_ws_shell-protocol.c | 98 --------- src/tizen_ws_shell-server-protocol.h | 309 --------------------------- 6 files changed, 8 insertions(+), 413 deletions(-) delete mode 100644 src/tizen_ws_shell-protocol.c delete mode 100644 src/tizen_ws_shell-server-protocol.h diff --git a/configure.ac b/configure.ac index a662f2d..71dc5de 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,9 @@ AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture") datadir=$(pkg-config --variable=modules enlightenment)/${PACKAGE} +# for Tzsh +PKG_CHECK_MODULES([TZSH_SERVER], [tzsh-server]) + AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT diff --git a/packaging/e-mod-tizen-wm-policy.spec b/packaging/e-mod-tizen-wm-policy.spec index 2cbbf01..dafdeca 100644 --- a/packaging/e-mod-tizen-wm-policy.spec +++ b/packaging/e-mod-tizen-wm-policy.spec @@ -17,6 +17,7 @@ BuildRequires: pkgconfig(tizen-extension-server) BuildRequires: pkgconfig(eina) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(tzsh-server) %endif %description diff --git a/src/Makefile.am b/src/Makefile.am index 415eebf..0931612 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,15 +27,13 @@ module_la_SOURCES += e_mod_wl.c \ e_mod_rotation_wl.c \ e_mod_rotation_wl.h \ tizen_policy_ext-protocol.c \ - tizen_policy_ext-server-protocol.h \ - tizen_ws_shell-protocol.c \ - tizen_ws_shell-server-protocol.h + tizen_policy_ext-server-protocol.h else module_la_SOURCES += e_mod_atoms.c \ e_mod_atoms.h endif module_la_LIBADD = -module_la_CFLAGS = @ENLIGHTENMENT_CFLAGS@ -module_la_LDFLAGS = -module -avoid-version @ENLIGHTENMENT_LIBS@ +module_la_CFLAGS = @ENLIGHTENMENT_CFLAGS@ @TZSH_SERVER_CFLAGS@ +module_la_LDFLAGS = -module -avoid-version @ENLIGHTENMENT_LIBS@ @TZSH_SERVER_LIBS@ module_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/src/e_mod_wl.c b/src/e_mod_wl.c index fb3a390..b28f05a 100644 --- a/src/e_mod_wl.c +++ b/src/e_mod_wl.c @@ -3,7 +3,7 @@ #include #include -#include "tizen_ws_shell-server-protocol.h" +#include typedef enum _Tzsh_Srv_Role { diff --git a/src/tizen_ws_shell-protocol.c b/src/tizen_ws_shell-protocol.c deleted file mode 100644 index ed857da..0000000 --- a/src/tizen_ws_shell-protocol.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - */ - -#include -#include -#include "wayland-util.h" - -extern const struct wl_interface tws_quickpanel_interface; -extern const struct wl_interface tws_region_interface; -extern const struct wl_interface tws_service_interface; -extern const struct wl_interface tws_tvsrv_interface; - -static const struct wl_interface *types[] = { - NULL, - NULL, - NULL, - NULL, - &tws_service_interface, - NULL, - NULL, - &tws_region_interface, - &tws_quickpanel_interface, - NULL, - &tws_tvsrv_interface, - NULL, - NULL, - NULL, - &tws_region_interface, -}; - -static const struct wl_message tizen_ws_shell_requests[] = { - { "destroy", "", types + 0 }, - { "service_create", "nus", types + 4 }, - { "region_create", "n", types + 7 }, - { "quickpanel_get", "nu", types + 8 }, - { "tvsrv_get", "nu", types + 10 }, -}; - -static const struct wl_message tizen_ws_shell_events[] = { - { "service_register", "s", types + 0 }, - { "service_unregister", "s", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tizen_ws_shell_interface = { - "tizen_ws_shell", 1, - 5, tizen_ws_shell_requests, - 2, tizen_ws_shell_events, -}; - -static const struct wl_message tws_quickpanel_requests[] = { - { "release", "", types + 0 }, - { "show", "", types + 0 }, - { "hide", "", types + 0 }, - { "enable", "", types + 0 }, - { "disable", "", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tws_quickpanel_interface = { - "tws_quickpanel", 1, - 5, tws_quickpanel_requests, - 0, NULL, -}; - -static const struct wl_message tws_region_requests[] = { - { "destroy", "", types + 0 }, - { "add", "iiii", types + 0 }, - { "subtract", "iiii", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tws_region_interface = { - "tws_region", 1, - 3, tws_region_requests, - 0, NULL, -}; - -static const struct wl_message tws_service_requests[] = { - { "destroy", "", types + 0 }, - { "region_set", "iio", types + 12 }, -}; - -WL_EXPORT const struct wl_interface tws_service_interface = { - "tws_service", 1, - 2, tws_service_requests, - 0, NULL, -}; - -static const struct wl_message tws_tvsrv_requests[] = { - { "release", "", types + 0 }, - { "bind", "", types + 0 }, - { "unbind", "", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tws_tvsrv_interface = { - "tws_tvsrv", 1, - 3, tws_tvsrv_requests, - 0, NULL, -}; - diff --git a/src/tizen_ws_shell-server-protocol.h b/src/tizen_ws_shell-server-protocol.h deleted file mode 100644 index 47e7f0a..0000000 --- a/src/tizen_ws_shell-server-protocol.h +++ /dev/null @@ -1,309 +0,0 @@ -/* - */ - -#ifndef TIZEN_WS_SHELL_SERVER_PROTOCOL_H -#define TIZEN_WS_SHELL_SERVER_PROTOCOL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "wayland-server.h" - -struct wl_client; -struct wl_resource; - -struct tizen_ws_shell; -struct tws_quickpanel; -struct tws_region; -struct tws_service; -struct tws_tvsrv; - -extern const struct wl_interface tizen_ws_shell_interface; -extern const struct wl_interface tws_quickpanel_interface; -extern const struct wl_interface tws_region_interface; -extern const struct wl_interface tws_service_interface; -extern const struct wl_interface tws_tvsrv_interface; - -/** - * tizen_ws_shell - Tizsn Shell support - * @destroy: destroy tizen_ws_shell - * @service_create: create new service - * @region_create: create new region - * @quickpanel_get: get the handle of quickpanel service - * @tvsrv_get: get the handle of tvsrv service - * - * - */ -struct tizen_ws_shell_interface { - /** - * destroy - destroy tizen_ws_shell - * - * - */ - void (*destroy)(struct wl_client *client, - struct wl_resource *resource); - /** - * service_create - create new service - * @id: (none) - * @win: (none) - * @name: (none) - * - * - */ - void (*service_create)(struct wl_client *client, - struct wl_resource *resource, - uint32_t id, - uint32_t win, - const char *name); - /** - * region_create - create new region - * @id: (none) - * - * Ask the tzsh server to create a new region. - */ - void (*region_create)(struct wl_client *client, - struct wl_resource *resource, - uint32_t id); - /** - * quickpanel_get - get the handle of quickpanel service - * @id: (none) - * @win: (none) - * - * - */ - void (*quickpanel_get)(struct wl_client *client, - struct wl_resource *resource, - uint32_t id, - uint32_t win); - /** - * tvsrv_get - get the handle of tvsrv service - * @id: (none) - * @win: (none) - * - * - */ - void (*tvsrv_get)(struct wl_client *client, - struct wl_resource *resource, - uint32_t id, - uint32_t win); -}; - -#define TIZEN_WS_SHELL_SERVICE_REGISTER 0 -#define TIZEN_WS_SHELL_SERVICE_UNREGISTER 1 - -#define TIZEN_WS_SHELL_SERVICE_REGISTER_SINCE_VERSION 1 -#define TIZEN_WS_SHELL_SERVICE_UNREGISTER_SINCE_VERSION 1 - -static inline void -tizen_ws_shell_send_service_register(struct wl_resource *resource_, const char *name) -{ - wl_resource_post_event(resource_, TIZEN_WS_SHELL_SERVICE_REGISTER, name); -} - -static inline void -tizen_ws_shell_send_service_unregister(struct wl_resource *resource_, const char *name) -{ - wl_resource_post_event(resource_, TIZEN_WS_SHELL_SERVICE_UNREGISTER, name); -} - -#ifndef TWS_QUICKPANEL_ERROR_ENUM -#define TWS_QUICKPANEL_ERROR_ENUM -enum tws_quickpanel_error { - TWS_QUICKPANEL_ERROR_REQUEST_REJECTED = 0, -}; -#endif /* TWS_QUICKPANEL_ERROR_ENUM */ - -/** - * tws_quickpanel - - * @release: release the handle of tws_quickpanel - * @show: show the quickpanel window - * @hide: hide the quickpanel window - * @enable: enable the operation of quickpanel on user window - * @disable: disable the operation of quickpanel on user window - * - * - */ -struct tws_quickpanel_interface { - /** - * release - release the handle of tws_quickpanel - * - * - */ - void (*release)(struct wl_client *client, - struct wl_resource *resource); - /** - * show - show the quickpanel window - * - * This request shows the quickpanel window immedietly, if it's - * possible. In other words, this request may be denied by server. - * Basically, this request will be denied, when application window - * is laying on background. - */ - void (*show)(struct wl_client *client, - struct wl_resource *resource); - /** - * hide - hide the quickpanel window - * - * - */ - void (*hide)(struct wl_client *client, - struct wl_resource *resource); - /** - * enable - enable the operation of quickpanel on user window - * - * - */ - void (*enable)(struct wl_client *client, - struct wl_resource *resource); - /** - * disable - disable the operation of quickpanel on user window - * - * - */ - void (*disable)(struct wl_client *client, - struct wl_resource *resource); -}; - - -/** - * tws_region - region interface - * @destroy: destroy region - * @add: add rectangle to region - * @subtract: subtract rectangle from region - * - * A region object describes an area. - * - * Region objects are used to describe the content and handler regions of a - * service window. - */ -struct tws_region_interface { - /** - * destroy - destroy region - * - * Destroy the region. This will invalidate the object ID. - */ - void (*destroy)(struct wl_client *client, - struct wl_resource *resource); - /** - * add - add rectangle to region - * @x: (none) - * @y: (none) - * @w: (none) - * @h: (none) - * - * Add the specified rectangle to the region. - */ - void (*add)(struct wl_client *client, - struct wl_resource *resource, - int32_t x, - int32_t y, - int32_t w, - int32_t h); - /** - * subtract - subtract rectangle from region - * @x: (none) - * @y: (none) - * @w: (none) - * @h: (none) - * - * Subtract the specified rectangle from the region. - */ - void (*subtract)(struct wl_client *client, - struct wl_resource *resource, - int32_t x, - int32_t y, - int32_t w, - int32_t h); -}; - - -#ifndef TWS_SERVICE_REGION_TYPE_ENUM -#define TWS_SERVICE_REGION_TYPE_ENUM -enum tws_service_region_type { - TWS_SERVICE_REGION_TYPE_HANDLER = 0, - TWS_SERVICE_REGION_TYPE_CONTENT = 1, -}; -#endif /* TWS_SERVICE_REGION_TYPE_ENUM */ - -/** - * tws_service - - * @destroy: destroy service - * @region_set: (none) - * - * - */ -struct tws_service_interface { - /** - * destroy - destroy service - * - * - */ - void (*destroy)(struct wl_client *client, - struct wl_resource *resource); - /** - * region_set - (none) - * @type: (none) - * @angle: (none) - * @region: (none) - */ - void (*region_set)(struct wl_client *client, - struct wl_resource *resource, - int32_t type, - int32_t angle, - struct wl_resource *region); -}; - - -#ifndef TWS_TVSRV_ERROR_ENUM -#define TWS_TVSRV_ERROR_ENUM -enum tws_tvsrv_error { - TWS_TVSRV_ERROR_REQUEST_REJECTED = 0, -}; -#endif /* TWS_TVSRV_ERROR_ENUM */ - -/** - * tws_tvsrv - interface for tv application - * @release: release the handle of tws_tvsrv - * @bind: request for binding with tv service window - * @unbind: request for unbinding with tv service window - * - * This interface provides protocol to request for binding with tv - * service window. - */ -struct tws_tvsrv_interface { - /** - * release - release the handle of tws_tvsrv - * - * - */ - void (*release)(struct wl_client *client, - struct wl_resource *resource); - /** - * bind - request for binding with tv service window - * - * Request for binding with tv service window, user window can - * set tv service window as transient-for window through this - * request. - */ - void (*bind)(struct wl_client *client, - struct wl_resource *resource); - /** - * unbind - request for unbinding with tv service window - * - * Request for un-binding with tv service window, user window can - * unset transient-for relation with tv service window through this - * request. - */ - void (*unbind)(struct wl_client *client, - struct wl_resource *resource); -}; - - -#ifdef __cplusplus -} -#endif - -#endif -- 2.34.1