remove tizen_notification protocol 38/44438/1
authorBoram Park <boram1288.park@samsung.com>
Tue, 21 Jul 2015 12:22:27 +0000 (21:22 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 21 Jul 2015 12:22:27 +0000 (21:22 +0900)
Change-Id: I65d45ff9d67eb15728207a6495702f5226626709

src/Makefile.am
src/e_mod_wl.c
src/tizen_notification-protocol.c [deleted file]
src/tizen_notification-server-protocol.h [deleted file]
src/tizen_notification.xml [deleted file]

index 75b322f7bd982a9198f54e0f24e97132f6e2bc2c..a0d8f364724b169857cbda4eb7537cff5733f7aa 100644 (file)
@@ -24,8 +24,6 @@ module_la_SOURCES      = e_mod_config.c \
 if HAVE_WAYLAND_ONLY
 module_la_SOURCES += e_mod_wl.c \
                                         e_mod_wl.h \
-                                        tizen_notification-server-protocol.h \
-                                        tizen_notification-protocol.c \
                                         e_mod_rotation_wl.c \
                                         e_mod_rotation_wl.h \
                                         tizen_policy_ext-protocol.c \
index d88e4862cd445cfe43cfc73384cda84ed7826d66..5b5073746168344cd91927f04eeaf83d42a56fd2 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <wayland-server.h>
 #include <tizen-extension-server-protocol.h>
-#include "tizen_notification-server-protocol.h"
 
 typedef struct _Pol_Wayland
 {
@@ -720,115 +719,6 @@ _e_tizen_policy_cb_bind(struct wl_client *client, void *data, uint32_t version,
    wl_resource_set_implementation(res, &_e_tizen_policy_interface, cdata, NULL);
 }
 
-static void
-_e_tizen_notification_set_level_cb(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_resource, uint32_t level)
-{
-   E_Pixmap *ep;
-   E_Client *ec;
-   Notification_Level *nl;
-
-   /* get the pixmap from this surface so we can find the client */
-   if (!(ep = wl_resource_get_user_data(surface_resource)))
-     {
-        wl_resource_post_error(surface_resource,
-                               WL_DISPLAY_ERROR_INVALID_OBJECT,
-                               "No Pixmap Set On Surface");
-        return;
-     }
-
-   /* make sure it's a wayland pixmap */
-   if (e_pixmap_type_get(ep) != E_PIXMAP_TYPE_WL) return;
-
-   /* find the client for this pixmap */
-   ec = e_pixmap_client_get(ep);
-   if (ec)
-     {
-        /* remove not processed level set */
-        nl = eina_hash_find(hash_notification_levels, &surface_resource);
-        if (nl) eina_hash_del_by_key(hash_notification_levels, &surface_resource);
-
-        e_mod_pol_notification_level_apply(ec, level);
-
-        /* Add other error handling code on notification send done. */
-        tizen_notification_send_done(resource,
-                                     surface_resource,
-                                     level,
-                                     TIZEN_NOTIFICATION_ERROR_STATE_NONE);
-     }
-   else
-     {
-         nl = eina_hash_find(hash_notification_levels, &surface_resource);
-         if (!nl)
-           {
-              nl = E_NEW(Notification_Level, 1);
-              EINA_SAFETY_ON_NULL_RETURN(nl);
-              eina_hash_add(hash_notification_levels, &surface_resource, nl);
-           }
-
-         nl->level = level;
-         nl->interface = resource;
-         nl->surface = surface_resource;
-     }
-}
-
-static const struct tizen_notification_interface _e_tizen_notification_interface =
-{
-   _e_tizen_notification_set_level_cb
-};
-
-static Eina_Bool
-_e_tizen_notification_levels_remove(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
-                                    const void *tp EINA_UNUSED, const void *resource)
-{
-   Notification_Level *nl = eina_hash_find(hash_notification_levels, key);
-   if (!nl)
-     return EINA_TRUE;
-
-   if (nl->interface != resource)
-     return EINA_TRUE;
-
-   eina_hash_del_by_key(hash_notification_levels, key);
-
-   return EINA_TRUE;
-}
-
-static void
-_e_tizen_notification_destroy(struct wl_resource *resource)
-{
-   if (!resource) return;
-
-   eina_hash_foreach(hash_notification_levels,
-                     (Eina_Hash_Foreach)_e_tizen_notification_levels_remove, resource);
-}
-
-static void
-_e_tizen_notification_bind_cb(struct wl_client *client, void *data, uint32_t version, uint32_t id)
-{
-   E_Comp_Data *cdata;
-   struct wl_resource *res;
-
-   if (!(cdata = data))
-     {
-        wl_client_post_no_memory(client);
-        return;
-     }
-
-   if (!(res = wl_resource_create(client,
-                                  &tizen_notification_interface,
-                                  version,
-                                  id)))
-     {
-        ERR("Could not create tizen_notification resource: %m");
-        wl_client_post_no_memory(client);
-        return;
-     }
-
-   wl_resource_set_implementation(res,
-                                  &_e_tizen_notification_interface,
-                                  cdata,
-                                  _e_tizen_notification_destroy);
-}
-
 static void
 _hook_client_del(void *d EINA_UNUSED, E_Client *ec)
 {
@@ -885,16 +775,6 @@ e_mod_pol_wl_init(void)
         return EINA_FALSE;
      }
 
-   if (!wl_global_create(cdata->wl.disp,
-                         &tizen_notification_interface,
-                         1,
-                         cdata,
-                         _e_tizen_notification_bind_cb))
-     {
-        ERR("Could not add tizen_notification to wayland globals: %m");
-        return EINA_FALSE;
-     }
-
    hash_pol_wayland = eina_hash_pointer_new(free);
    hash_notification_levels = eina_hash_pointer_new(free);
    hash_policy_conformants = eina_hash_pointer_new(free);
@@ -997,10 +877,10 @@ e_mod_pol_wl_notification_level_fetch(E_Client *ec)
         e_mod_pol_notification_level_apply(ec, nl->level);
 
         // Add other error handling code on notification send done.
-        tizen_notification_send_done(nl->interface,
-                                     nl->surface,
-                                     nl->level,
-                                     TIZEN_NOTIFICATION_ERROR_STATE_NONE);
+        tizen_policy_send_notification_done(nl->interface,
+                                            nl->surface,
+                                            nl->level,
+                                            TIZEN_POLICY_ERROR_STATE_NONE);
 
         eina_hash_del_by_key(hash_notification_levels, &surface);
      }
diff --git a/src/tizen_notification-protocol.c b/src/tizen_notification-protocol.c
deleted file mode 100644 (file)
index 1138b56..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-extern const struct wl_interface wl_surface_interface;
-
-static const struct wl_interface *types[] = {
-       &wl_surface_interface,
-       NULL,
-       &wl_surface_interface,
-       NULL,
-       NULL,
-};
-
-static const struct wl_message tizen_notification_requests[] = {
-       { "set_level", "oi", types + 0 },
-};
-
-static const struct wl_message tizen_notification_events[] = {
-       { "done", "oiu", types + 2 },
-};
-
-WL_EXPORT const struct wl_interface tizen_notification_interface = {
-       "tizen_notification", 1,
-       1, tizen_notification_requests,
-       1, tizen_notification_events,
-};
-
diff --git a/src/tizen_notification-server-protocol.h b/src/tizen_notification-server-protocol.h
deleted file mode 100644 (file)
index e57c203..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef TIZEN_NOTIFICATION_SERVER_PROTOCOL_H
-#define TIZEN_NOTIFICATION_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_notification;
-
-extern const struct wl_interface tizen_notification_interface;
-
-#ifndef TIZEN_NOTIFICATION_LEVEL_ENUM
-#define TIZEN_NOTIFICATION_LEVEL_ENUM
-enum tizen_notification_level {
-       TIZEN_NOTIFICATION_LEVEL_1 = 0,
-       TIZEN_NOTIFICATION_LEVEL_2 = 1,
-       TIZEN_NOTIFICATION_LEVEL_3 = 2,
-       TIZEN_NOTIFICATION_LEVEL_NONE = -1,
-       TIZEN_NOTIFICATION_LEVEL_DEFAULT = 10,
-       TIZEN_NOTIFICATION_LEVEL_MEDIUM = 20,
-       TIZEN_NOTIFICATION_LEVEL_HIGH = 30,
-       TIZEN_NOTIFICATION_LEVEL_TOP = 40,
-};
-#endif /* TIZEN_NOTIFICATION_LEVEL_ENUM */
-
-#ifndef TIZEN_NOTIFICATION_ERROR_STATE_ENUM
-#define TIZEN_NOTIFICATION_ERROR_STATE_ENUM
-enum tizen_notification_error_state {
-       TIZEN_NOTIFICATION_ERROR_STATE_NONE = 0,
-       TIZEN_NOTIFICATION_ERROR_STATE_PERMISSION_DENIED = 1,
-};
-#endif /* TIZEN_NOTIFICATION_ERROR_STATE_ENUM */
-
-struct tizen_notification_interface {
-       /**
-        * set_level - (none)
-        * @surface: (none)
-        * @level: (none)
-        */
-       void (*set_level)(struct wl_client *client,
-                         struct wl_resource *resource,
-                         struct wl_resource *surface,
-                         int32_t level);
-};
-
-#define TIZEN_NOTIFICATION_DONE        0
-
-#define TIZEN_NOTIFICATION_DONE_SINCE_VERSION  1
-
-static inline void
-tizen_notification_send_done(struct wl_resource *resource_, struct wl_resource *surface, int32_t level, uint32_t error_state)
-{
-       wl_resource_post_event(resource_, TIZEN_NOTIFICATION_DONE, surface, level, error_state);
-}
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/tizen_notification.xml b/src/tizen_notification.xml
deleted file mode 100644 (file)
index 1456cea..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<protocol name="tizen_notification">
-  <interface name="tizen_notification" version="1">
-     <enum name="level">
-       <entry name="1" value="0"/>
-       <entry name="2" value="1"/>
-       <entry name="3" value="2"/>
-       <entry name="none" value="-1"/>
-       <entry name="default" value="10"/>
-       <entry name="medium" value="20"/>
-       <entry name="high" value="30"/>
-       <entry name="top" value="40"/>
-     </enum>
-
-     <request name="set_level">
-       <arg name="surface" type="object" interface="wl_surface"/>
-       <arg name="level" type="int"/>
-     </request>
-
-     <enum name="error_state">
-       <entry name="none" value="0"/>
-       <entry name="permission_denied" value="1"/>
-     </enum>
-
-     <event name="done">
-       <arg name="surface" type="object" interface="wl_surface"/>
-       <arg name="level" type="int"/>
-       <arg name="error_state" type="uint"/>
-     </event>
-
-  </interface>
-</protocol>