From d612c6b07fde08443140072c4d1b44b7418486e5 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 20 Jul 2015 19:41:21 +0900 Subject: [PATCH] using tizen-extension wayland protocol instead of including *protocol.c directly Change-Id: I14fed47b467157c604b2db4bad9bf939b345a6f5 --- configure.ac | 2 +- packaging/e-mod-tizen-keyrouter.spec | 1 + protocol/keyrouter-protocol.c | 36 ----------- protocol/keyrouter-protocol.h | 117 ----------------------------------- protocol/wl_keyrouter.xml | 62 ------------------- src/Makefile.am | 4 +- src/e_mod_main_wl.c | 2 +- 7 files changed, 4 insertions(+), 220 deletions(-) delete mode 100644 protocol/keyrouter-protocol.c delete mode 100644 protocol/keyrouter-protocol.h delete mode 100644 protocol/wl_keyrouter.xml diff --git a/configure.ac b/configure.ac index 21dd3ea..3e75c67 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,7 @@ dnl ======================================================================== # checks for wayland only argument dnl ======================================================================== if test "x${have_wayland_only}" = "xyes"; then - PKG_CHECK_MODULES(WAYLAND, [wayland-server]) + PKG_CHECK_MODULES(WAYLAND, [wayland-server, tizen-extension-server]) fi release=$(pkg-config --variable=release enlightenment) diff --git a/packaging/e-mod-tizen-keyrouter.spec b/packaging/e-mod-tizen-keyrouter.spec index 1e8fff6..9b8aab6 100644 --- a/packaging/e-mod-tizen-keyrouter.spec +++ b/packaging/e-mod-tizen-keyrouter.spec @@ -20,6 +20,7 @@ BuildRequires: pkgconfig(utilX) %endif %if %{with wayland} BuildRequires: pkgconfig(wayland-server) +BuildRequires: pkgconfig(tizen-extension-server) %endif BuildRequires: pkgconfig(dlog) %if "%{?profile}" == "common" diff --git a/protocol/keyrouter-protocol.c b/protocol/keyrouter-protocol.c deleted file mode 100644 index fc90d23..0000000 --- a/protocol/keyrouter-protocol.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include "wayland-util.h" - -extern const struct wl_interface wl_surface_interface; - -static const struct wl_interface *types[] = { - &wl_surface_interface, - NULL, - NULL, - &wl_surface_interface, - NULL, - &wl_surface_interface, - NULL, - &wl_surface_interface, - NULL, - NULL, - NULL, -}; - -static const struct wl_message wl_keyrouter_requests[] = { - { "set_keygrab", "?ouu", types + 0 }, - { "unset_keygrab", "?ou", types + 3 }, - { "get_keygrab_status", "?ou", types + 5 }, -}; - -static const struct wl_message wl_keyrouter_events[] = { - { "keygrab_notify", "?ouuu", types + 7 }, -}; - -WL_EXPORT const struct wl_interface wl_keyrouter_interface = { - "wl_keyrouter", 1, - 3, wl_keyrouter_requests, - 1, wl_keyrouter_events, -}; - diff --git a/protocol/keyrouter-protocol.h b/protocol/keyrouter-protocol.h deleted file mode 100644 index 1f1a650..0000000 --- a/protocol/keyrouter-protocol.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef KEYROUTER_SERVER_PROTOCOL_H -#define KEYROUTER_SERVER_PROTOCOL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "wayland-server.h" - -struct wl_client; -struct wl_resource; - -struct wl_keyrouter; - -extern const struct wl_interface wl_keyrouter_interface; - -#ifndef WL_KEYROUTER_ERROR_ENUM -#define WL_KEYROUTER_ERROR_ENUM -enum wl_keyrouter_error { - WL_KEYROUTER_ERROR_NONE = 0, - WL_KEYROUTER_ERROR_INVALID_SURFACE = 1, - WL_KEYROUTER_ERROR_INVALID_KEY = 2, - WL_KEYROUTER_ERROR_INVALID_MODE = 3, - WL_KEYROUTER_ERROR_GRABBED_ALREADY = 4, - WL_KEYROUTER_ERROR_NO_PERMISSION = 5, - WL_KEYROUTER_ERROR_NO_SYSTEM_RESOURCES = 6, -}; -#endif /* WL_KEYROUTER_ERROR_ENUM */ - -#ifndef WL_KEYROUTER_MODE_ENUM -#define WL_KEYROUTER_MODE_ENUM -/** - * wl_keyrouter_mode - mode for a key grab - * @WL_KEYROUTER_MODE_NONE: none - * @WL_KEYROUTER_MODE_SHARED: mode to get a key grab with the other - * client surfaces when the focused client surface gets the key - * @WL_KEYROUTER_MODE_TOPMOST: mode to get a key grab when the client - * surface is the top most surface - * @WL_KEYROUTER_MODE_OVERRIDABLE_EXCLUSIVE: mode to get a key grab - * exclusively, overridably regardless of the order in the surface stack - * @WL_KEYROUTER_MODE_EXCLUSIVE: mode to get a key grab exclusively - * regardless of the order in surface stack - * - * This value is used to set a mode for a key grab. With this mode and - * the order of the surface between surfaces' stack, the compositor will - * determine the destination client surface. - */ -enum wl_keyrouter_mode { - WL_KEYROUTER_MODE_NONE = 0, - WL_KEYROUTER_MODE_SHARED = 1, - WL_KEYROUTER_MODE_TOPMOST = 2, - WL_KEYROUTER_MODE_OVERRIDABLE_EXCLUSIVE = 3, - WL_KEYROUTER_MODE_EXCLUSIVE = 4, -}; -#endif /* WL_KEYROUTER_MODE_ENUM */ - -/** - * wl_keyrouter - an interface to set each focus for each key - * @set_keygrab: (none) - * @unset_keygrab: (none) - * @get_keygrab_status: (none) - * - * In tradition, all the keys in a keyboard and a device on which some - * keys are attached will be sent to focus surface by default. Currently - * it's possible to set up each focus for each key in a keyboard and a - * device. Therefore, by setting a key grab for a surface, the owner of the - * surface will get the key event when it has the key grab for the key. - */ -struct wl_keyrouter_interface { - /** - * set_keygrab - (none) - * @surface: (none) - * @key: (none) - * @mode: (none) - */ - void (*set_keygrab)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *surface, - uint32_t key, - uint32_t mode); - /** - * unset_keygrab - (none) - * @surface: (none) - * @key: (none) - */ - void (*unset_keygrab)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *surface, - uint32_t key); - /** - * get_keygrab_status - (none) - * @surface: (none) - * @key: (none) - */ - void (*get_keygrab_status)(struct wl_client *client, - struct wl_resource *resource, - struct wl_resource *surface, - uint32_t key); -}; - -#define WL_KEYROUTER_KEYGRAB_NOTIFY 0 - -#define WL_KEYROUTER_KEYGRAB_NOTIFY_SINCE_VERSION 1 - -static inline void -wl_keyrouter_send_keygrab_notify(struct wl_resource *resource_, struct wl_resource *surface, uint32_t key, uint32_t mode, uint32_t error) -{ - wl_resource_post_event(resource_, WL_KEYROUTER_KEYGRAB_NOTIFY, surface, key, mode, error); -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/protocol/wl_keyrouter.xml b/protocol/wl_keyrouter.xml deleted file mode 100644 index 2ad1fd0..0000000 --- a/protocol/wl_keyrouter.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - In tradition, all the keys in a keyboard and a device on which - some keys are attached will be sent to focus surface by default. - Currently it's possible to set up each focus for each key in a keyboard and a device. - Therefore, by setting a key grab for a surface, the owner of the - surface will get the key event when it has the key grab for the key. - - - - - - - - - - - - - - - This value is used to set a mode for a key grab. With this mode and - the order of the surface between surfaces' stack, the compositor will determine the destination client - surface. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Makefile.am b/src/Makefile.am index b683d75..e3b6f24 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,9 +7,7 @@ pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH pkg_LTLIBRARIES = module.la if WAYLAND_ONLY module_la_SOURCES = e_mod_main_wl.c \ - e_mod_main_wl.h \ - $(top_srcdir)/protocol/keyrouter-protocol.c \ - $(top_srcdir)/protocol/keyrouter-protocol.h + e_mod_main_wl.h module_la_CFLAGS = @ENLIGHTENMENT_CFLAGS@ @WAYLAND_CFLAGS@ -DHAVE_WAYLAND_ONLY module_la_LDFLAGS = -module -avoid-version @WAYLAND_LIBS@ @ENLIGHTENMENT_LIBS@ else diff --git a/src/e_mod_main_wl.c b/src/e_mod_main_wl.c index 8189b39..00f936a 100644 --- a/src/e_mod_main_wl.c +++ b/src/e_mod_main_wl.c @@ -1,7 +1,7 @@ #define E_COMP_WL #include "e.h" #include "e_mod_main_wl.h" -#include "protocol/keyrouter-protocol.h" +#include #include E_KeyrouterPtr krt; -- 2.7.4