DSWaylandServer: swap tizen_policy_ext files to tizen-policy-ext 64/243464/1
authorJunseok, Kim <juns.kim@samsung.com>
Wed, 2 Sep 2020 12:38:23 +0000 (21:38 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 7 Sep 2020 10:36:13 +0000 (19:36 +0900)
The tizen_policy_ext protocol renamed as tizen-policy-ext and merged
into wayland-extension.
So, adjust like that

Change-Id: I0b585e3c9f505429d1c7f45a6e519605ce0fa6f5
Signed-off-by: Junseok, Kim <juns.kim@samsung.com>
src/DSWaylandServer/DSWaylandTizenPolicyExtPrivate.h
src/DSWaylandServer/dswayland-server-tizen-policy-ext.cpp [moved from src/DSWaylandServer/dswayland-server-tizen_policy_ext.cpp with 98% similarity]
src/DSWaylandServer/dswayland-server-tizen-policy-ext.h [moved from src/DSWaylandServer/dswayland-server-tizen_policy_ext.h with 98% similarity]
src/DSWaylandServer/tizen_policy_ext-protocol.c [deleted file]
src/DSWaylandServer/tizen_policy_ext-server-protocol.h [deleted file]
src/meson.build

index cfa4e79..74ce5f6 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef _DS_WAYLAND_TIZEN_POLICY_EXT_PRIVATE_H_
 #define _DS_WAYLAND_TIZEN_POLICY_EXT_PRIVATE_H_
 
-#include "dswayland-server-tizen_policy_ext.h"
+#include "dswayland-server-tizen-policy-ext.h"
 #include "DSWaylandTizenPolicyExt.h"
 
 namespace display_server
@@ -1,8 +1,6 @@
-/* Protocol XML file : wayland-extension/tizen_policy_ext.xml */
+/* Protocol XML file : wayland-extension/tizen-policy-ext.xml */
 
-#include <wayland-server.h>
-#include "tizen_policy_ext-server-protocol.h"
-#include "dswayland-server-tizen_policy_ext.h"
+#include "dswayland-server-tizen-policy-ext.h"
 
 #ifndef DS_UNLIKELY
 #define DS_UNLIKELY(X) X
@@ -107,7 +105,7 @@ namespace DSWaylandServer {
 
     void tizen_policy_ext::init(struct ::wl_display *display, int version)
     {
-        m_global = wl_global_create(display, &::tizen_policy_ext_interface3, version, this, bind_func);
+        m_global = wl_global_create(display, &::tizen_policy_ext_interface, version, this, bind_func);
         m_globalVersion = version;
         m_displayDestroyedListener.notify = tizen_policy_ext::display_destroy_func;
         m_displayDestroyedListener.parent = this;
@@ -116,7 +114,7 @@ namespace DSWaylandServer {
 
     const struct wl_interface *tizen_policy_ext::interface()
     {
-        return &::tizen_policy_ext_interface3;
+        return &::tizen_policy_ext_interface;
     }
 
     tizen_policy_ext::Resource *tizen_policy_ext::tizen_policy_ext_allocate()
@@ -158,7 +156,7 @@ namespace DSWaylandServer {
     tizen_policy_ext::Resource *tizen_policy_ext::bind(struct ::wl_client *client, uint32_t id, int version)
     {
         DS_ASSERT_X(!wl_client_get_object(client, id), "DSWaylandObject bind", "binding to object %u more than once", id);
-        struct ::wl_resource *handle = wl_resource_create(client, &::tizen_policy_ext_interface3, version, id);
+        struct ::wl_resource *handle = wl_resource_create(client, &::tizen_policy_ext_interface, version, id);
         return bind(handle);
     }
 
@@ -176,7 +174,7 @@ namespace DSWaylandServer {
     {
         if (DS_UNLIKELY(!resource))
             return NULL;
-        if (wl_resource_instance_of(resource, &::tizen_policy_ext_interface3, &m_tizen_policy_ext_interface))
+        if (wl_resource_instance_of(resource, &::tizen_policy_ext_interface, &m_tizen_policy_ext_interface))
             return static_cast<Resource *>(wl_resource_get_user_data(resource));
         return NULL;
     }
@@ -1,11 +1,10 @@
-/* Protocol XML file : wayland-extension/tizen_policy_ext.xml */
+/* Protocol XML file : wayland-extension/tizen-policy-ext.xml */
 
 #ifndef __DS_TIZEN_POLICY_EXT_PROTOCOL_H__
 #define __DS_TIZEN_POLICY_EXT_PROTOCOL_H__
 
 #include "wayland-server-core.h"
-#include <wayland-server.h>
-#include "tizen_policy_ext-server-protocol.h"
+#include "tizen-policy-ext-server-protocol.h"
 #include <cstdio>
 #include <cassert>
 #include <string>
diff --git a/src/DSWaylandServer/tizen_policy_ext-protocol.c b/src/DSWaylandServer/tizen_policy_ext-protocol.c
deleted file mode 100644 (file)
index 6b49f50..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <stdlib.h>
-#include <stdint.h>
-#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_interface3 = {
-       "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,
-};
-
diff --git a/src/DSWaylandServer/tizen_policy_ext-server-protocol.h b/src/DSWaylandServer/tizen_policy_ext-server-protocol.h
deleted file mode 100644 (file)
index 4a08b79..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#ifndef TIZEN_POLICY_EXT_SERVER_PROTOCOL_H
-#define TIZEN_POLICY_EXT_SERVER_PROTOCOL_H
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-server.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_interface3;
-extern const struct wl_interface tizen_rotation_interface;
-
-struct tizen_policy_ext_interface {
-       /**
-        * get_rotation - (none)
-        * @id: new rotation object
-        * @surface: surface object
-        */
-       void (*get_rotation)(struct wl_client *client,
-                            struct wl_resource *resource,
-                            uint32_t id,
-                            struct wl_resource *surface);
-       /**
-        * get_active_angle - get a current active angle
-        * @surface: (none)
-        *
-        * 
-        */
-       void (*get_active_angle)(struct wl_client *client,
-                                struct wl_resource *resource,
-                                struct wl_resource *surface);
-};
-
-#define TIZEN_POLICY_EXT_ACTIVE_ANGLE  0
-
-#define TIZEN_POLICY_EXT_ACTIVE_ANGLE_SINCE_VERSION    1
-
-static inline void
-tizen_policy_ext_send_active_angle(struct wl_resource *resource_, uint32_t angle)
-{
-       wl_resource_post_event(resource_, TIZEN_POLICY_EXT_ACTIVE_ANGLE, angle);
-}
-
-#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_interface {
-       /**
-        * destroy - destroy tizen_rotation
-        *
-        * 
-        */
-       void (*destroy)(struct wl_client *client,
-                       struct wl_resource *resource);
-       /**
-        * set_available_angles - (none)
-        * @angles: (none)
-        */
-       void (*set_available_angles)(struct wl_client *client,
-                                    struct wl_resource *resource,
-                                    uint32_t angles);
-       /**
-        * set_preferred_angle - (none)
-        * @angle: (none)
-        */
-       void (*set_preferred_angle)(struct wl_client *client,
-                                   struct wl_resource *resource,
-                                   uint32_t angle);
-       /**
-        * ack_angle_change - ack a angle_change
-        * @serial: a serial to angle_change for
-        *
-        * 
-        */
-       void (*ack_angle_change)(struct wl_client *client,
-                                struct wl_resource *resource,
-                                uint32_t serial);
-       /**
-        * set_geometry_hint - (none)
-        * @angle: (none)
-        * @x: (none)
-        * @y: (none)
-        * @width: (none)
-        * @height: (none)
-        * @since: 3
-        */
-       void (*set_geometry_hint)(struct wl_client *client,
-                                 struct wl_resource *resource,
-                                 uint32_t angle,
-                                 uint32_t x,
-                                 uint32_t y,
-                                 uint32_t w,
-                                 uint32_t h);
-};
-
-#define TIZEN_ROTATION_AVAILABLE_ANGLES_DONE   0
-#define TIZEN_ROTATION_PREFERRED_ANGLE_DONE    1
-#define TIZEN_ROTATION_ANGLE_CHANGE    2
-#define TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE        3
-
-#define TIZEN_ROTATION_AVAILABLE_ANGLES_DONE_SINCE_VERSION     1
-#define TIZEN_ROTATION_PREFERRED_ANGLE_DONE_SINCE_VERSION      1
-#define TIZEN_ROTATION_ANGLE_CHANGE_SINCE_VERSION      1
-#define TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE_SINCE_VERSION  2
-
-static inline void
-tizen_rotation_send_available_angles_done(struct wl_resource *resource_, uint32_t angles)
-{
-       wl_resource_post_event(resource_, TIZEN_ROTATION_AVAILABLE_ANGLES_DONE, angles);
-}
-
-static inline void
-tizen_rotation_send_preferred_angle_done(struct wl_resource *resource_, uint32_t angle)
-{
-       wl_resource_post_event(resource_, TIZEN_ROTATION_PREFERRED_ANGLE_DONE, angle);
-}
-
-static inline void
-tizen_rotation_send_angle_change(struct wl_resource *resource_, uint32_t angle, uint32_t serial)
-{
-       wl_resource_post_event(resource_, TIZEN_ROTATION_ANGLE_CHANGE, angle, serial);
-}
-
-static inline void
-tizen_rotation_send_angle_change_with_resize(struct wl_resource *resource_, uint32_t angle, uint32_t serial, uint32_t width, uint32_t height)
-{
-       wl_resource_post_event(resource_, TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE, angle, serial, width, height);
-}
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif
index b786585..5b39ed4 100644 (file)
@@ -100,8 +100,8 @@ libds_wayland_srcs = [
        'DSWaylandServer/dswayland-server-tizen-launch.h',
        'DSWaylandServer/dswayland-server-input-method.cpp',
        'DSWaylandServer/dswayland-server-input-method.h',
-       'DSWaylandServer/dswayland-server-tizen_policy_ext.cpp',
-       'DSWaylandServer/dswayland-server-tizen_policy_ext.h',
+       'DSWaylandServer/dswayland-server-tizen-policy-ext.cpp',
+       'DSWaylandServer/dswayland-server-tizen-policy-ext.h',
        'DSWaylandServer/DSWaylandCallback.cpp',
        'DSWaylandServer/DSWaylandCallback.h',
        'DSWaylandServer/DSWaylandCallbackPrivate.h',
@@ -186,8 +186,6 @@ libds_wayland_srcs = [
        'DSWaylandServer/DSWaylandTizenPolicyExt.h',
        'DSWaylandServer/DSWaylandTizenPolicyExtPrivate.h',
        'DSWaylandServer/DSWaylandTizenPolicyExt.cpp',
-       'DSWaylandServer/tizen_policy_ext-server-protocol.h',
-       'DSWaylandServer/tizen_policy_ext-protocol.c',  
        ]
 
 libds_srcs += libds_wayland_srcs
@@ -217,6 +215,7 @@ tizen_surface_dep = dependency('tizen-surface-server')
 input_method_dep = dependency('input-method-server')
 text_dep = dependency('text-server')
 tizen_launch_dep = dependency('tizen-launch-server')
+tizen_policy_ext_dep = dependency('tizen-policy-ext-server')
 
 dali_core_dep = dependency('dali2-core')
 dali_adaptor_dep = dependency('dali2-adaptor')
@@ -224,7 +223,7 @@ dali_toolkit_dep = dependency('dali2-toolkit')
 
 dali_deps = [dali_core_dep, dali_adaptor_dep, dali_toolkit_dep]
 tizen_ext_deps = [tizen_ext_dep, input_method_dep, text_dep, tizen_launch_dep, tizen_surface_dep]
-tizen_ext_deps = [tizen_ext_deps, xdg_shell_unstable_v6_dep, xdg_shell_dep]
+tizen_ext_deps += [xdg_shell_unstable_v6_dep, xdg_shell_dep, tizen_policy_ext_dep]
 libds_deps = [ecore_dep]
 
 libds_include_dirs = include_directories(