e_server: move the init/shutdown of e_devicemgr_wl 86/312186/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 31 May 2024 09:13:37 +0000 (18:13 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 5 Jun 2024 03:09:27 +0000 (12:09 +0900)
to the e_server directory

Change-Id: I197e2f8707ebcd6032d01ae1906200b0f36b4588

12 files changed:
src/bin/debug/e_input_log.h
src/bin/inputmgr/e_devicemgr.c
src/bin/inputmgr/e_devicemgr_block.c
src/bin/inputmgr/e_devicemgr_input.c
src/bin/inputmgr/e_devicemgr_inputgen.c
src/bin/inputmgr/e_devicemgr_intern.h
src/bin/inputmgr/e_devicemgr_keyboard_grab.c
src/bin/server/e_devicemgr_wl.c
src/bin/server/e_devicemgr_wl_intern.h [new file with mode: 0644]
src/bin/server/e_server.c
src/bin/server/e_server_intern.h
src/include/e_devicemgr.h

index fdbfef5..e7827ed 100644 (file)
@@ -22,4 +22,9 @@ extern int _e_input_log_dom;
 #define EIINF(msg, ARG...) INF("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
 #define EIDBG(msg, ARG...) DBG("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
 
+#define DMERR(msg, ARG...) ERR("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
+#define DMWRN(msg, ARG...) WRN("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
+#define DMINF(msg, ARG...) INF("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
+#define DMDBG(msg, ARG...) DBG("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
+
 #endif
index 0c48339..5bd2797 100644 (file)
@@ -1,4 +1,5 @@
 #include "e_devicemgr_intern.h"
+#include "e_server_intern.h"
 
 #include <tizen-extension-server-protocol.h>
 
@@ -133,9 +134,6 @@ e_devicemgr_init(void)
 
    g_rec_mutex_init(&e_devicemgr->device_list_mutex);
 
-   res = e_devicemgr_wl_init();
-   EINA_SAFETY_ON_FALSE_GOTO(res, wl_failed);
-
    res = e_devicemgr_input_init();
    EINA_SAFETY_ON_FALSE_GOTO(res, input_failed);
 
@@ -144,9 +142,6 @@ e_devicemgr_init(void)
 input_failed:
    e_devicemgr_input_shutdown();
 
-wl_failed:
-   e_devicemgr_wl_shutdown();
-
 failed:
    if (e_devicemgr)
      {
index cbd9fe2..198fbe7 100644 (file)
@@ -1,6 +1,8 @@
 
 #include "e_devicemgr_intern.h"
 #include "e_input_device_intern.h"
+#include "e_devicemgr_wl_intern.h"
+#include "e_input_log.h"
 
 #include <tizen-extension-server-protocol.h>
 
index 64c94e3..0741d46 100644 (file)
@@ -7,6 +7,8 @@
 #include "e_comp_wl_input_intern.h"
 #include "e_utils_intern.h"
 #include "e_comp_input_intern.h"
+#include "e_devicemgr_wl_intern.h"
+#include "e_input_log.h"
 
 #include <tizen-extension-server-protocol.h>
 
index 2339e86..a91e1a9 100644 (file)
@@ -4,6 +4,8 @@
 #include "e_comp_wl_input_intern.h"
 #include "e_utils_intern.h"
 #include "e_comp_input_intern.h"
+#include "e_devicemgr_wl_intern.h"
+#include "e_input_log.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
index 5393c78..be32fad 100644 (file)
@@ -9,13 +9,6 @@
 #include <ttrace.h>
 #endif
 
-#ifdef HAVE_CYNARA
-#include <cynara-session.h>
-#include <cynara-client.h>
-#include <cynara-creds-socket.h>
-#include <sys/smack.h>
-#endif
-
 #include <linux/uinput.h>
 
 #ifdef ENABLE_TTRACE
 #define TRACE_INPUT_DEVICE_END()
 #endif
 
-#define DMERR(msg, ARG...) ERR("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
-#define DMWRN(msg, ARG...) WRN("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
-#define DMINF(msg, ARG...) INF("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
-#define DMDBG(msg, ARG...) DBG("[%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
-
 #define INPUT_GENERATOR_DEVICE "Input Generator"
 #define DETENT_DEVICE_NAME "tizen_detent"
 #define INPUTGEN_MAX_BTN 16
 
-typedef struct _E_Devicemgr_Input_Device_Mgr_Data E_Devicemgr_Input_Device_Mgr_Data;
-typedef struct _E_Devicemgr_Input_Device_User_Data E_Devicemgr_Input_Device_User_Data;
 typedef struct _E_Devicemgr_Coords E_Devicemgr_Coords;
 typedef struct _E_Devicemgr_Inputgen_Touch_Axis E_Devicemgr_Inputgen_Touch_Axis;
 typedef struct _E_Devicemgr_Inputgen_Client_Data E_Devicemgr_Inputgen_Client_Data;
@@ -44,22 +30,6 @@ typedef struct _E_Devicemgr_Inputgen_Client_Global_Data E_Devicemgr_Inputgen_Cli
 typedef struct _E_Devicemgr_Inputgen_Device_Data E_Devicemgr_Inputgen_Device_Data;
 typedef struct _E_Devicemgr_Inputgen_Resource_Data E_Devicemgr_Inputgen_Resource_Data;
 
-struct _E_Devicemgr_Input_Device_Mgr_Data
-{
-    struct wl_resource *resource;
-    Eina_Bool is_first_resource : 1;
-    Eina_List *user_data_list;
-};
-
-struct _E_Devicemgr_Input_Device_User_Data
-{
-   E_Devicemgr_Input_Device *dev;
-   struct wl_resource *dev_res;
-   struct wl_resource *dev_mgr_res;
-   struct wl_resource *seat_res;
-   E_Devicemgr_Input_Device_Mgr_Data *mgr_data;
-};
-
 struct _E_Devicemgr_Coords
 {
    int x, y;
@@ -136,17 +106,6 @@ struct _E_Devicemgr_Config_Data
    E_Devicemgr_Conf_Edd *conf;
 };
 
-struct _E_Devicemgr_Wl_Data
-{
-   struct wl_global *global;
-   Eina_List *mgr_data_list;
-
-#ifdef HAVE_CYNARA
-   cynara *p_cynara;
-   Eina_Bool cynara_initialized;
-#endif
-};
-
 typedef Eina_Bool (*E_Devicemgr_Intercept_Hook_Cb) (void *data, int point, void *event);
 typedef struct _E_Devicemgr_Intercept_Hook E_Devicemgr_Intercept_Hook;
 
@@ -187,18 +146,6 @@ EINTERN int       e_devicemgr_keyboard_grab(struct wl_client *client, struct wl_
 EINTERN void e_devicemgr_conf_init(E_Devicemgr_Config_Data *dconfig);
 EINTERN void e_devicemgr_conf_fini(E_Devicemgr_Config_Data *dconfig);
 
-EINTERN Eina_Bool e_devicemgr_wl_init(void);
-EINTERN void      e_devicemgr_wl_shutdown(void);
-
-EINTERN void e_devicemgr_wl_device_add(E_Devicemgr_Input_Device *dev);
-EINTERN void e_devicemgr_wl_device_del(E_Devicemgr_Input_Device *dev);
-EINTERN void e_devicemgr_wl_device_update(E_Devicemgr_Input_Device *dev);
-
-EINTERN void e_devicemgr_wl_block_send_expired(struct wl_resource *resource);
-EINTERN void e_devicemgr_wl_detent_send_event(int detent);
-EINTERN void e_devicemgr_wl_touch_max_count_send(int slot, struct wl_resource *res, struct wl_resource *seat_res);
-EINTERN void e_devicemgr_wl_generator_with_sync_send_event(struct wl_resource *resource, int error);
-
 EINTERN int e_devicemgr_block_add(struct wl_client *client, struct wl_resource *resource, uint32_t clas, uint32_t duration);
 EINTERN int e_devicemgr_block_remove(struct wl_client *client);
 
index f854b44..e73f5d1 100644 (file)
@@ -1,6 +1,7 @@
 #include "e_devicemgr_intern.h"
 #include "e_input_intern.h"
 #include "e_comp_wl_intern.h"
+#include "e_input_log.h"
 
 #include <tizen-extension-server-protocol.h>
 
index 66d4777..a6924f2 100644 (file)
@@ -1,10 +1,18 @@
+#include "e_devicemgr_wl_intern.h"
 #include "e_devicemgr_intern.h"
 #include "e_input_intern.h"
 #include "e_comp_wl_intern.h"
 #include "e_privilege_intern.h"
 #include "e_security.h"
+#include "e_input_log.h"
 
 #include <tizen-extension-server-protocol.h>
+#ifdef HAVE_CYNARA
+#include <cynara-session.h>
+#include <cynara-client.h>
+#include <cynara-creds-socket.h>
+#include <sys/smack.h>
+#endif
 
 #ifdef HAVE_CYNARA
 #define E_DEVMGR_CYNARA_ERROR_CHECK_GOTO(func_name, ret, label) \
           } \
     } \
   while (0)
+#endif
+
+typedef struct _E_Tizen_Devicemgr_Mgr_Data E_Tizen_Devicemgr_Mgr_Data;
+typedef struct _E_Tizen_Devicemgr_User_Data E_Tizen_Devicemgr_User_Data;
+
+struct _E_Tizen_Devicemgr
+{
+   struct wl_global *global;
+   Eina_List *mgr_data_list;
+
+#ifdef HAVE_CYNARA
+   cynara *p_cynara;
+   Eina_Bool cynara_initialized;
+#endif
+};
+
+struct _E_Tizen_Devicemgr_Mgr_Data
+{
+    struct wl_resource *resource;
+    Eina_Bool is_first_resource : 1;
+    Eina_List *user_data_list;
+};
+
+struct _E_Tizen_Devicemgr_User_Data
+{
+   E_Devicemgr_Input_Device *dev;
+   struct wl_resource *dev_res;
+   struct wl_resource *dev_mgr_res;
+   struct wl_resource *seat_res;
+   E_Tizen_Devicemgr_Mgr_Data *mgr_data;
+};
 
+static E_Tizen_Devicemgr *g_tizen_devicemgr = NULL;
+
+#ifdef HAVE_CYNARA
 static void
 _e_devicemgr_util_cynara_log(const char *func_name, int err)
 {
@@ -42,7 +84,7 @@ _e_devicemgr_util_do_privilege_check(struct wl_client *client, int socket_fd, co
    Eina_Bool res = EINA_FALSE;
 
    /* If initialization of cynara has been failed, let's not to do further permission checks. */
-   if (e_devicemgr->wl_data->p_cynara == NULL && e_devicemgr->wl_data->cynara_initialized) return EINA_TRUE;
+   if (g_tizen_devicemgr->p_cynara == NULL && g_tizen_devicemgr->cynara_initialized) return EINA_TRUE;
    if (socket_fd < 0) return EINA_FALSE;
 
    ret = cynara_creds_socket_get_user(socket_fd, USER_METHOD_UID, &uid);
@@ -79,7 +121,7 @@ static const struct tizen_input_device_interface _e_devicemgr_wl_device_interfac
 };
 
 static void
-_e_devicemgr_wl_device_data_destroy(E_Devicemgr_Input_Device_User_Data *device_user_data)
+_e_devicemgr_wl_device_data_destroy(E_Tizen_Devicemgr_User_Data *device_user_data)
 {
    if (!device_user_data) return;
 
@@ -100,7 +142,7 @@ _e_devicemgr_wl_device_data_destroy(E_Devicemgr_Input_Device_User_Data *device_u
 static void
 _e_devicemgr_wl_device_cb_unbind(struct wl_resource *resource)
 {
-   E_Devicemgr_Input_Device_User_Data *device_user_data;
+   E_Tizen_Devicemgr_User_Data *device_user_data;
 
    DMDBG("Unbind tizen_input_device: %u (client: %p)", wl_resource_get_id(resource), wl_resource_get_client(resource));
    if (!(device_user_data = wl_resource_get_user_data(resource))) return;
@@ -130,9 +172,9 @@ e_devicemgr_wl_device_add(E_Devicemgr_Input_Device *dev)
    Eina_List *l, *ll;
    uint32_t serial;
    struct wl_client *wc;
-   E_Devicemgr_Input_Device_User_Data *device_user_data;
+   E_Tizen_Devicemgr_User_Data *device_user_data;
    struct wl_array axes;
-   E_Devicemgr_Input_Device_Mgr_Data *mgr_data;
+   E_Tizen_Devicemgr_Mgr_Data *mgr_data;
    E_Comp_Wl_Seat *seat_data;
 
    /* TODO: find the seat corresponding to event */
@@ -152,7 +194,7 @@ e_devicemgr_wl_device_add(E_Devicemgr_Input_Device *dev)
 
         wc = wl_resource_get_client(seat_res);
 
-        EINA_LIST_FOREACH(e_devicemgr->wl_data->mgr_data_list, ll, mgr_data)
+        EINA_LIST_FOREACH(g_tizen_devicemgr->mgr_data_list, ll, mgr_data)
           {
              dev_mgr_res = mgr_data->resource;
              if (wl_resource_get_client(dev_mgr_res) != wc) continue;
@@ -170,7 +212,7 @@ e_devicemgr_wl_device_add(E_Devicemgr_Input_Device *dev)
                   break;
                }
 
-             device_user_data = E_NEW(E_Devicemgr_Input_Device_User_Data, 1);
+             device_user_data = E_NEW(E_Tizen_Devicemgr_User_Data, 1);
              if (!device_user_data)
                {
                   DMERR("Failed to allocate memory for input device user data\n");
@@ -200,7 +242,7 @@ e_devicemgr_wl_device_del(E_Devicemgr_Input_Device *dev)
 {
    struct wl_resource *res;
    uint32_t serial;
-   E_Devicemgr_Input_Device_User_Data *device_user_data;
+   E_Tizen_Devicemgr_User_Data *device_user_data;
 
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
@@ -279,7 +321,7 @@ e_devicemgr_wl_touch_max_count_send(int slot, struct wl_resource *res, struct wl
    Eina_List *l, *ll;
    uint32_t serial;
    struct wl_client *wc;
-   E_Devicemgr_Input_Device_Mgr_Data *mgr_data;
+   E_Tizen_Devicemgr_Mgr_Data *mgr_data;
 
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
@@ -294,7 +336,7 @@ e_devicemgr_wl_touch_max_count_send(int slot, struct wl_resource *res, struct wl
           {
              wc = wl_resource_get_client(seat_resource);
 
-             EINA_LIST_FOREACH(e_devicemgr->wl_data->mgr_data_list, ll, mgr_data)
+             EINA_LIST_FOREACH(g_tizen_devicemgr->mgr_data_list, ll, mgr_data)
                {
                   dev_mgr_resource = mgr_data->resource;
                   if (wl_resource_get_client(dev_mgr_resource) != wc) continue;
@@ -611,8 +653,8 @@ static const struct tizen_input_device_manager_interface _e_devicemgr_wl_impleme
 static void
 _e_devicemgr_wl_cb_unbind(struct wl_resource *resource)
 {
-   E_Devicemgr_Input_Device_Mgr_Data *mgr_data;
-   E_Devicemgr_Input_Device_User_Data *device_user_data;
+   E_Tizen_Devicemgr_Mgr_Data *mgr_data;
+   E_Tizen_Devicemgr_User_Data *device_user_data;
 
    if(!e_comp_wl) return;
 
@@ -626,7 +668,7 @@ _e_devicemgr_wl_cb_unbind(struct wl_resource *resource)
         device_user_data->mgr_data = NULL;
         _e_devicemgr_wl_device_data_destroy(device_user_data);
      }
-   e_devicemgr->wl_data->mgr_data_list = eina_list_remove(e_devicemgr->wl_data->mgr_data_list, mgr_data);
+   g_tizen_devicemgr->mgr_data_list = eina_list_remove(g_tizen_devicemgr->mgr_data_list, mgr_data);
 
    E_FREE(mgr_data);
 }
@@ -639,10 +681,10 @@ _e_devicemgr_wl_cb_bind(struct wl_client *client, void *data, uint32_t version,
    uint32_t serial;
    E_Devicemgr_Input_Device *dev;
    struct wl_array axes;
-   E_Devicemgr_Input_Device_User_Data *device_user_data;
-   E_Devicemgr_Input_Device_Mgr_Data *mgr_data, *tmp_data;
+   E_Tizen_Devicemgr_User_Data *device_user_data;
+   E_Tizen_Devicemgr_Mgr_Data *mgr_data, *tmp_data;
 
-   mgr_data = E_NEW(E_Devicemgr_Input_Device_Mgr_Data, 1);
+   mgr_data = E_NEW(E_Tizen_Devicemgr_Mgr_Data, 1);
    if (!mgr_data)
      {
         DMERR("Failed to allocate memory for input device mgr data\n");
@@ -651,7 +693,7 @@ _e_devicemgr_wl_cb_bind(struct wl_client *client, void *data, uint32_t version,
      }
    mgr_data->is_first_resource = 1;
 
-   EINA_LIST_FOREACH(e_devicemgr->wl_data->mgr_data_list, l, tmp_data)
+   EINA_LIST_FOREACH(g_tizen_devicemgr->mgr_data_list, l, tmp_data)
      {
         if (wl_resource_get_client(tmp_data->resource) != client) continue;
         DMDBG("tizen_input_device_manager (res: %d) is already bound to client (%p)",
@@ -672,7 +714,7 @@ _e_devicemgr_wl_cb_bind(struct wl_client *client, void *data, uint32_t version,
 
    mgr_data->resource = res;
    mgr_data->user_data_list = NULL;
-   e_devicemgr->wl_data->mgr_data_list = eina_list_append(e_devicemgr->wl_data->mgr_data_list, mgr_data);
+   g_tizen_devicemgr->mgr_data_list = eina_list_append(g_tizen_devicemgr->mgr_data_list, mgr_data);
 
    wl_resource_set_implementation(res, &_e_devicemgr_wl_implementation, mgr_data,
                                   _e_devicemgr_wl_cb_unbind);
@@ -707,7 +749,7 @@ _e_devicemgr_wl_cb_bind(struct wl_client *client, void *data, uint32_t version,
                   g_rec_mutex_unlock(&e_devicemgr->device_list_mutex);
                   return;
                }
-             device_user_data = E_NEW(E_Devicemgr_Input_Device_User_Data, 1);
+             device_user_data = E_NEW(E_Tizen_Devicemgr_User_Data, 1);
              if (!device_user_data)
                {
                   DMERR("Failed to allocate memory for input device user data\n");
@@ -735,60 +777,59 @@ _e_devicemgr_wl_cb_bind(struct wl_client *client, void *data, uint32_t version,
      }
 }
 
-Eina_Bool
-e_devicemgr_wl_init(void)
+E_Tizen_Devicemgr *
+e_devicemgr_wl_init(struct wl_display *display)
 {
-   if (!e_comp_wl) return EINA_FALSE;
-   if (!e_comp_wl->wl.disp) return EINA_FALSE;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
 
-   if (e_devicemgr->wl_data) return EINA_TRUE;
+   if (g_tizen_devicemgr) return g_tizen_devicemgr;
 
-   e_devicemgr->wl_data = E_NEW(E_Devicemgr_Wl_Data, 1);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e_devicemgr->wl_data, EINA_FALSE);
+   g_tizen_devicemgr = E_NEW(E_Tizen_Devicemgr, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(g_tizen_devicemgr, NULL);
 
    /* try to add tizen_input_device_manager to wayland globals */
-   e_devicemgr->wl_data->global = wl_global_create(e_comp_wl->wl.disp,
-                                                   &tizen_input_device_manager_interface, 6,
-                                                   NULL, _e_devicemgr_wl_cb_bind);
-   if (!e_devicemgr->wl_data->global)
+   g_tizen_devicemgr->global = wl_global_create(display,
+                                           &tizen_input_device_manager_interface, 6,
+                                           NULL, _e_devicemgr_wl_cb_bind);
+   if (!g_tizen_devicemgr->global)
      {
         DMERR("Could not add tizen_input_device_manager to wayland globals");
-        return EINA_FALSE;
+        return NULL;
      }
-   e_devicemgr->wl_data->mgr_data_list = NULL;
+   g_tizen_devicemgr->mgr_data_list = NULL;
 
    /* initialization of cynara for checking privilege */
 #ifdef HAVE_CYNARA
    int ret;
 
-   ret = cynara_initialize(&e_devicemgr->wl_data->p_cynara, NULL);
+   ret = cynara_initialize(&g_tizen_devicemgr->p_cynara, NULL);
    if (EINA_UNLIKELY(CYNARA_API_SUCCESS != ret))
      {
         _e_devicemgr_util_cynara_log("cynara_initialize", ret);
-        e_devicemgr->wl_data->p_cynara = NULL;
+        g_tizen_devicemgr->p_cynara = NULL;
      }
-   e_devicemgr->wl_data->cynara_initialized = EINA_TRUE;
+   g_tizen_devicemgr->cynara_initialized = EINA_TRUE;
 #endif
 
-   return EINA_TRUE;
+   return g_tizen_devicemgr;
 }
 
 void
 e_devicemgr_wl_shutdown(void)
 {
-   if (!e_devicemgr->wl_data) return;
-   /* destroy the global seat resource */
-   if (e_devicemgr->wl_data->global)
-     wl_global_destroy(e_devicemgr->wl_data->global);
-   e_devicemgr->wl_data->global = NULL;
-   eina_list_free(e_devicemgr->wl_data->mgr_data_list);
+   if (!g_tizen_devicemgr) return;
 
    /* deinitialization of cynara if it has been initialized */
 #ifdef HAVE_CYNARA
-   if (e_devicemgr->wl_data->p_cynara) cynara_finish(e_devicemgr->wl_data->p_cynara);
-   e_devicemgr->wl_data->cynara_initialized = EINA_FALSE;
+   if (g_tizen_devicemgr->p_cynara)
+     cynara_finish(g_tizen_devicemgr->p_cynara);
 #endif
 
-   E_FREE(e_devicemgr->wl_data);
+   eina_list_free(g_tizen_devicemgr->mgr_data_list);
+
+   /* destroy the global seat resource */
+   wl_global_destroy(g_tizen_devicemgr->global);
+
+   E_FREE(g_tizen_devicemgr);
 }
 
diff --git a/src/bin/server/e_devicemgr_wl_intern.h b/src/bin/server/e_devicemgr_wl_intern.h
new file mode 100644 (file)
index 0000000..aefc628
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef E_DEVICEMGR_WL_INTERN_H
+#define E_DEVICEMGR_WL_INTERN_H
+
+#include "e_intern.h"
+
+#include <wayland-server.h>
+
+typedef struct _E_Tizen_Devicemgr E_Tizen_Devicemgr;
+
+EINTERN E_Tizen_Devicemgr *e_devicemgr_wl_init(struct wl_display *display);
+EINTERN void                 e_devicemgr_wl_shutdown(void);
+
+EINTERN void e_devicemgr_wl_device_add(E_Devicemgr_Input_Device *dev);
+EINTERN void e_devicemgr_wl_device_del(E_Devicemgr_Input_Device *dev);
+EINTERN void e_devicemgr_wl_device_update(E_Devicemgr_Input_Device *dev);
+
+EINTERN void e_devicemgr_wl_block_send_expired(struct wl_resource *resource);
+EINTERN void e_devicemgr_wl_detent_send_event(int detent);
+EINTERN void e_devicemgr_wl_touch_max_count_send(int slot, struct wl_resource *res, struct wl_resource *seat_res);
+EINTERN void e_devicemgr_wl_generator_with_sync_send_event(struct wl_resource *resource, int error);
+
+#endif
index f21fff1..601e97f 100644 (file)
@@ -22,6 +22,7 @@
 #include "e_screen_rotation_intern.h"
 #include "e_comp_wl_tizen_hwc_intern.h"
 #include "e_tizen_surface_shm_intern.h"
+#include "e_devicemgr_wl_intern.h"
 
 typedef struct _E_Server E_Server;
 
@@ -56,6 +57,7 @@ struct _E_Server
         Dummy_Handle *tizen_screen_rotation_handle;
         Dummy_Handle *tizen_hwc_handle;
         E_Tizen_Surface_Shm *tizen_surface_shm;
+        E_Tizen_Devicemgr *tizen_devicemgr_handle;
     } handles; // feature handles
 };
 
@@ -122,6 +124,7 @@ e_server_init(void)
      e_server_feature_register(E_SERVER_FEATURE_TIZEN_HWC, &dummy_handle);
 
    e_server_feature_register(E_SERVER_FEATURE_TIZEN_SURFACE_SHM, e_tizen_surface_shm_init(e_comp_wl->wl.disp));
+   e_server_feature_register(E_SERVER_FEATURE_TIZEN_DEVICEMGR, e_devicemgr_wl_init(e_comp_wl->wl.disp));
 
    return EINA_TRUE;
 }
@@ -130,6 +133,7 @@ EINTERN void
 e_server_shutdown(void)
 {
    e_tizen_surface_shm_shutdown();
+   e_devicemgr_wl_shutdown();
    e_comp_wl_tizen_hwc_shutdown();
    e_screen_rotation_shutdown();
    e_linux_dmabuf_shutdown();
@@ -233,9 +237,12 @@ e_server_feature_register(E_SERVER_FEATURE feature, void *handle)
        case E_SERVER_FEATURE_TIZEN_HWC:
          g_server->handles.tizen_hwc_handle = handle;
          break;
-      case E_SERVER_FEATURE_TIZEN_SURFACE_SHM:
+       case E_SERVER_FEATURE_TIZEN_SURFACE_SHM:
          g_server->handles.tizen_surface_shm =(E_Tizen_Surface_Shm *)handle;
          break;
+       case E_SERVER_FEATURE_TIZEN_DEVICEMGR:
+         g_server->handles.tizen_devicemgr_handle = handle;
+         break;
        default:
          ERR("Unknown feature(%d) and handle(%p)", feature, handle);
          break;
@@ -320,6 +327,9 @@ e_server_feature_handle_get(E_SERVER_FEATURE feature)
        case E_SERVER_FEATURE_TIZEN_SURFACE_SHM:
          handle = g_server->handles.tizen_surface_shm;
          break;
+       case E_SERVER_FEATURE_TIZEN_DEVICEMGR:
+         handle = g_server->handles.tizen_devicemgr_handle;
+         break;
        default:
          ERR("Unknown feature(%d)", feature);
          break;
index f8b7ba1..11af82e 100644 (file)
@@ -27,6 +27,7 @@ typedef enum _E_SERVER_FEATURE {
     E_SERVER_FEATURE_TIZEN_SCREEN_ROTATION,
     E_SERVER_FEATURE_TIZEN_HWC,
     E_SERVER_FEATURE_TIZEN_SURFACE_SHM,
+    E_SERVER_FEATURE_TIZEN_DEVICEMGR,
     E_SERVER_FEATURE_MAX
 } E_SERVER_FEATURE;
 
index 31f4713..dc96064 100644 (file)
@@ -6,7 +6,6 @@
 #include <glib.h>
 
 typedef struct _E_Devicemgr             E_Devicemgr;
-typedef struct _E_Devicemgr_Wl_Data     E_Devicemgr_Wl_Data;
 typedef struct _E_Devicemgr_Conf_Edd    E_Devicemgr_Conf_Edd;
 typedef struct _E_Devicemgr_Config_Data E_Devicemgr_Config_Data;
 
@@ -34,7 +33,6 @@ typedef void (*E_Devicemgr_Block_Expire_Cb) (void *data);
 struct _E_Devicemgr
 {
    E_Devicemgr_Config_Data *dconfig;
-   E_Devicemgr_Wl_Data *wl_data;
 
    Eina_List *handlers;