From b4e27848fbdae566d777742214061777f28f094b Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Fri, 28 Aug 2020 13:30:03 +0900 Subject: [PATCH] ecore_wl2: remove hard-coded tizen-policy-ext protocol Use tizen-policy-ext protocol in wayland-extension instead of hard-coded protocol Change-Id: Ic287f62bea5b7a223d15719538970c73fc45d409 --- packaging/efl.spec | 1 + src/lib/ecore_wl2/meson.build | 5 +- .../ecore_wl2/tizen-policy-ext-client-protocol.h | 222 --------------------- src/lib/ecore_wl2/tizen-policy-ext-protocol.c | 54 ----- 4 files changed, 3 insertions(+), 279 deletions(-) delete mode 100644 src/lib/ecore_wl2/tizen-policy-ext-client-protocol.h delete mode 100644 src/lib/ecore_wl2/tizen-policy-ext-protocol.c diff --git a/packaging/efl.spec b/packaging/efl.spec index 6c20c0a..be9c1fa 100644 --- a/packaging/efl.spec +++ b/packaging/efl.spec @@ -45,6 +45,7 @@ BuildRequires: pkgconfig(wayland-tbm-server) BuildRequires: pkgconfig(tizen-extension-client) BuildRequires: pkgconfig(tizen-launch-client) BuildRequires: pkgconfig(tizen-remote-surface-client) +BuildRequires: pkgconfig(tizen-policy-ext-client) BuildRequires: wayland-protocols Requires: libwayland-extension-client Requires: libwayland-egl-tizen diff --git a/src/lib/ecore_wl2/meson.build b/src/lib/ecore_wl2/meson.build index 905c8b8..5453344 100644 --- a/src/lib/ecore_wl2/meson.build +++ b/src/lib/ecore_wl2/meson.build @@ -29,10 +29,9 @@ ecore_wl2_ext_deps += [ dependency('wayland-tbm-client'), dependency('wayland-egl'), dependency('wayland-egl-tizen'), + dependency('tizen-policy-ext-client'), ] ecore_wl2_src += files([ - 'tizen-policy-ext-client-protocol.h', - 'tizen-policy-ext-protocol.c', 'ecore_wl2_tbmsurface.c', ]) # TIZEN_ONLY(20190109: introduce mesonbuild on tizen env -----> @@ -55,7 +54,7 @@ ecore_wl2 = declare_dependency( ecore_wl2_internal_headers = declare_dependency( include_directories: include_directories('.'), - dependencies: [wayland_protocol_simple, libdrm, dependency('wayland-client'), dependency('wayland-server'), dependency('xkbcommon'),], + dependencies: [wayland_protocol_simple, libdrm, dependency('wayland-client'), dependency('wayland-server'), dependency('xkbcommon'), dependency('tizen-policy-ext-client'),], ) install_headers(ecore_wl2_header_src, diff --git a/src/lib/ecore_wl2/tizen-policy-ext-client-protocol.h b/src/lib/ecore_wl2/tizen-policy-ext-client-protocol.h deleted file mode 100644 index b3b04f0..0000000 --- a/src/lib/ecore_wl2/tizen-policy-ext-client-protocol.h +++ /dev/null @@ -1,222 +0,0 @@ -#ifndef TIZEN_POLICY_EXT_CLIENT_PROTOCOL_H -#define TIZEN_POLICY_EXT_CLIENT_PROTOCOL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "wayland-client.h" - -struct wl_client; -struct wl_resource; - -struct tizen_policy_ext; -struct tizen_rotation; -struct wl_surface; - -extern const struct wl_interface tizen_policy_ext_interface; -extern const struct wl_interface tizen_rotation_interface; - -struct tizen_policy_ext_listener { - /** - * active_angle - (none) - * @angle: (none) - */ - void (*active_angle)(void *data, - struct tizen_policy_ext *tizen_policy_ext, - uint32_t angle); -}; - -static inline int -tizen_policy_ext_add_listener(struct tizen_policy_ext *tizen_policy_ext, - const struct tizen_policy_ext_listener *listener, void *data) -{ - return wl_proxy_add_listener((struct wl_proxy *) tizen_policy_ext, - (void (**)(void)) listener, data); -} - -#define TIZEN_POLICY_EXT_GET_ROTATION 0 -#define TIZEN_POLICY_EXT_GET_ACTIVE_ANGLE 1 - -#define TIZEN_POLICY_EXT_GET_ROTATION_SINCE_VERSION 1 -#define TIZEN_POLICY_EXT_GET_ACTIVE_ANGLE_SINCE_VERSION 1 - -static inline void -tizen_policy_ext_set_user_data(struct tizen_policy_ext *tizen_policy_ext, void *user_data) -{ - wl_proxy_set_user_data((struct wl_proxy *) tizen_policy_ext, user_data); -} - -static inline void * -tizen_policy_ext_get_user_data(struct tizen_policy_ext *tizen_policy_ext) -{ - return wl_proxy_get_user_data((struct wl_proxy *) tizen_policy_ext); -} - -static inline uint32_t -tizen_policy_ext_get_version(struct tizen_policy_ext *tizen_policy_ext) -{ - return wl_proxy_get_version((struct wl_proxy *) tizen_policy_ext); -} - -static inline void -tizen_policy_ext_destroy(struct tizen_policy_ext *tizen_policy_ext) -{ - wl_proxy_destroy((struct wl_proxy *) tizen_policy_ext); -} - -static inline struct tizen_rotation * -tizen_policy_ext_get_rotation(struct tizen_policy_ext *tizen_policy_ext, struct wl_surface *surface) -{ - struct wl_proxy *id; - - id = wl_proxy_marshal_constructor((struct wl_proxy *) tizen_policy_ext, - TIZEN_POLICY_EXT_GET_ROTATION, &tizen_rotation_interface, NULL, surface); - - return (struct tizen_rotation *) id; -} - -static inline void -tizen_policy_ext_get_active_angle(struct tizen_policy_ext *tizen_policy_ext, struct wl_surface *surface) -{ - wl_proxy_marshal((struct wl_proxy *) tizen_policy_ext, - TIZEN_POLICY_EXT_GET_ACTIVE_ANGLE, surface); -} - -#ifndef TIZEN_ROTATION_ANGLE_ENUM -#define TIZEN_ROTATION_ANGLE_ENUM -enum tizen_rotation_angle { - TIZEN_ROTATION_ANGLE_NONE = 0, - TIZEN_ROTATION_ANGLE_0 = 1, - TIZEN_ROTATION_ANGLE_90 = 2, - TIZEN_ROTATION_ANGLE_180 = 4, - TIZEN_ROTATION_ANGLE_270 = 8, -}; -#endif /* TIZEN_ROTATION_ANGLE_ENUM */ - -struct tizen_rotation_listener { - /** - * available_angles_done - (none) - * @angles: (none) - */ - void (*available_angles_done)(void *data, - struct tizen_rotation *tizen_rotation, - uint32_t angles); - /** - * preferred_angle_done - (none) - * @angle: (none) - */ - void (*preferred_angle_done)(void *data, - struct tizen_rotation *tizen_rotation, - uint32_t angle); - /** - * angle_change - suggest a angle_change - * @angle: (none) - * @serial: (none) - * - * - */ - void (*angle_change)(void *data, - struct tizen_rotation *tizen_rotation, - uint32_t angle, - uint32_t serial); - /** - * angle_change_with_resize - suggest a angle change with resize - * of window - * @angle: (none) - * @serial: (none) - * @width: (none) - * @height: (none) - * - * - * @since: 2 - */ - void (*angle_change_with_resize)(void *data, - struct tizen_rotation *tizen_rotation, - uint32_t angle, - uint32_t serial, - uint32_t width, - uint32_t height); -}; - -static inline int -tizen_rotation_add_listener(struct tizen_rotation *tizen_rotation, - const struct tizen_rotation_listener *listener, void *data) -{ - return wl_proxy_add_listener((struct wl_proxy *) tizen_rotation, - (void (**)(void)) listener, data); -} - -#define TIZEN_ROTATION_DESTROY 0 -#define TIZEN_ROTATION_SET_AVAILABLE_ANGLES 1 -#define TIZEN_ROTATION_SET_PREFERRED_ANGLE 2 -#define TIZEN_ROTATION_ACK_ANGLE_CHANGE 3 -#define TIZEN_ROTATION_SET_GEOMETRY_HINT 4 - -#define TIZEN_ROTATION_DESTROY_SINCE_VERSION 1 -#define TIZEN_ROTATION_SET_AVAILABLE_ANGLES_SINCE_VERSION 1 -#define TIZEN_ROTATION_SET_PREFERRED_ANGLE_SINCE_VERSION 1 -#define TIZEN_ROTATION_ACK_ANGLE_CHANGE_SINCE_VERSION 1 - -static inline void -tizen_rotation_set_user_data(struct tizen_rotation *tizen_rotation, void *user_data) -{ - wl_proxy_set_user_data((struct wl_proxy *) tizen_rotation, user_data); -} - -static inline void * -tizen_rotation_get_user_data(struct tizen_rotation *tizen_rotation) -{ - return wl_proxy_get_user_data((struct wl_proxy *) tizen_rotation); -} - -static inline uint32_t -tizen_rotation_get_version(struct tizen_rotation *tizen_rotation) -{ - return wl_proxy_get_version((struct wl_proxy *) tizen_rotation); -} - -static inline void -tizen_rotation_destroy(struct tizen_rotation *tizen_rotation) -{ - wl_proxy_marshal((struct wl_proxy *) tizen_rotation, - TIZEN_ROTATION_DESTROY); - - wl_proxy_destroy((struct wl_proxy *) tizen_rotation); -} - -static inline void -tizen_rotation_set_available_angles(struct tizen_rotation *tizen_rotation, uint32_t angles) -{ - wl_proxy_marshal((struct wl_proxy *) tizen_rotation, - TIZEN_ROTATION_SET_AVAILABLE_ANGLES, angles); -} - -static inline void -tizen_rotation_set_preferred_angle(struct tizen_rotation *tizen_rotation, uint32_t angle) -{ - wl_proxy_marshal((struct wl_proxy *) tizen_rotation, - TIZEN_ROTATION_SET_PREFERRED_ANGLE, angle); -} - -static inline void -tizen_rotation_ack_angle_change(struct tizen_rotation *tizen_rotation, uint32_t serial) -{ - wl_proxy_marshal((struct wl_proxy *) tizen_rotation, - TIZEN_ROTATION_ACK_ANGLE_CHANGE, serial); -} - -static inline void -tizen_rotation_set_geometry_hint(struct tizen_rotation *tizen_rotation, uint32_t angle, uint32_t x, uint32_t y, uint32_t w, uint32_t h) -{ - wl_proxy_marshal((struct wl_proxy *) tizen_rotation, - TIZEN_ROTATION_SET_GEOMETRY_HINT, angle, x, y, w, h); -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/lib/ecore_wl2/tizen-policy-ext-protocol.c b/src/lib/ecore_wl2/tizen-policy-ext-protocol.c deleted file mode 100644 index a8af24c..0000000 --- a/src/lib/ecore_wl2/tizen-policy-ext-protocol.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include "wayland-util.h" - -extern const struct wl_interface tizen_rotation_interface; -extern const struct wl_interface wl_surface_interface; - -static const struct wl_interface *types[] = { - NULL, - NULL, - NULL, - NULL, - NULL, - &tizen_rotation_interface, - &wl_surface_interface, - &wl_surface_interface, -}; - -static const struct wl_message tizen_policy_ext_requests[] = { - { "get_rotation", "no", types + 5 }, - { "get_active_angle", "?o", types + 7 }, -}; - -static const struct wl_message tizen_policy_ext_events[] = { - { "active_angle", "u", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tizen_policy_ext_interface = { - "tizen_policy_ext", 3, - 2, tizen_policy_ext_requests, - 1, tizen_policy_ext_events, -}; - -static const struct wl_message tizen_rotation_requests[] = { - { "destroy", "", types + 0 }, - { "set_available_angles", "u", types + 0 }, - { "set_preferred_angle", "u", types + 0 }, - { "ack_angle_change", "u", types + 0 }, - { "set_geometry_hint", "3uuuuu", types + 0 }, -}; - -static const struct wl_message tizen_rotation_events[] = { - { "available_angles_done", "u", types + 0 }, - { "preferred_angle_done", "u", types + 0 }, - { "angle_change", "uu", types + 0 }, - { "angle_change_with_resize", "2uuuu", types + 0 }, -}; - -WL_EXPORT const struct wl_interface tizen_rotation_interface = { - "tizen_rotation", 3, - 5, tizen_rotation_requests, - 4, tizen_rotation_events, -}; - -- 2.7.4