e_appinfo : renamed e_policy_appinfo 79/217079/3 submit/tizen/20191107.035437
authorMinJeong Kim <minjjj.kim@samsung.com>
Wed, 30 Oct 2019 06:49:51 +0000 (15:49 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Thu, 7 Nov 2019 05:03:53 +0000 (05:03 +0000)
e_policy_appinfo is renamed as e_appinfo.

And we added USE_E_APPINFO macro for supporting outdated API of e_policy_appinfo
to prevent build break.

Change-Id: I9dff93b78e6186b2812ee6b11ef90846437f00d8
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
12 files changed:
packaging/enlightenment.spec
src/bin/Makefile.mk
src/bin/e.h
src/bin/e_appinfo.c [new file with mode: 0644]
src/bin/e_appinfo.h [new file with mode: 0644]
src/bin/e_client.c
src/bin/e_comp_wl.c
src/bin/e_includes.h
src/bin/e_policy_appinfo.c [deleted file]
src/bin/e_policy_appinfo.h
src/bin/e_policy_wl.c
src/bin/services/e_service_launcher.c

index c5c1728d397e6a249b9aecc8c91e477208d33b3c..160fdb5a0a9c65973471d4673fc2d787353638bc 100644 (file)
@@ -76,7 +76,7 @@ cp %{SOURCE1001} .
 
 %build
 %if "%{tizen_profile_name}" != "tv"
-export CFLAGS+=" -fPIE "
+export CFLAGS+=" -fPIE -DUSE_E_APPINFO"
 export LDFLAGS+=" -pie "
 %endif
 %autogen \
index 34976747450730b0125cf4fef63957803035cc9b..cff8d696075945a57522635368d4589e59ae1a4d 100644 (file)
@@ -130,6 +130,7 @@ src/bin/e_policy_private_data.h \
 src/bin/e_policy_wl.h \
 src/bin/e_policy_wl_display.h \
 src/bin/e_policy_appinfo.h \
+src/bin/e_appinfo.h \
 src/bin/e_magnifier.h \
 src/bin/e_process.h \
 src/bin/e_privilege.h \
@@ -253,7 +254,7 @@ src/bin/e_policy_stack.c  \
 src/bin/e_policy_visibility.c \
 src/bin/e_policy_wl.c \
 src/bin/e_policy_wl_display.c \
-src/bin/e_policy_appinfo.c \
+src/bin/e_appinfo.c \
 src/bin/e_magnifier.c \
 src/bin/e_process.c \
 src/bin/e_privilege.c \
index e5a032a8ec245fa5e5926f1bac239be698f87f6d..8b012b4c56d3a96fc572997b25a62a014eece937 100644 (file)
@@ -403,4 +403,10 @@ extern E_API Eina_Bool stopping;
 # define DELD(obj, num)
 #endif
 
+#ifndef USE_E_APPINFO
+ #define e_policy_appinfo_find_with_pid e_appinfo_find_with_pid
+ #define e_policy_appinfo_base_output_resolution_set e_appinfo_base_output_resolution_set
+ #define E_Policy_Appinfo E_Appinfo
+#endif
+
 #endif
diff --git a/src/bin/e_appinfo.c b/src/bin/e_appinfo.c
new file mode 100644 (file)
index 0000000..e400a44
--- /dev/null
@@ -0,0 +1,239 @@
+#include "e.h"
+#include "e_appinfo.h"
+
+static Eina_List *appinfo_list;
+
+static int _appinfo_hooks_walking = 0;
+static int _appinfo_hooks_delete = 0;
+
+static Eina_Inlist *_appinfo_hooks[] =
+{
+   [E_APPINFO_HOOK_APPID_SET] = NULL,
+   [E_APPINFO_HOOK_PID_SET] = NULL,
+   [E_APPINFO_HOOK_METADATA_READY] = NULL,
+};
+
+struct _E_Appinfo
+{
+   pid_t               pid;
+   Eina_Stringshare   *appid;
+   Eina_Bool base_output_available;
+   int base_output_width;
+   int base_output_height;
+};
+
+static void
+_e_appinfo_hooks_clean(void)
+{
+   Eina_Inlist *l;
+   E_Appinfo_Hook *hook;
+   unsigned int x;
+
+   for (x = 0; x < E_APPINFO_HOOK_LAST; x++)
+     EINA_INLIST_FOREACH_SAFE(_appinfo_hooks[x], l, hook)
+       {
+          if (!hook->delete_me) continue;
+          _appinfo_hooks[x] = eina_inlist_remove(_appinfo_hooks[x], EINA_INLIST_GET(hook));
+          free(hook);
+       }
+}
+
+static void
+_e_appinfo_hook_call(E_Appinfo_Hook_Point hookpoint, const char* appid, pid_t pid)
+{
+   E_Appinfo_Hook *hook;
+
+   _appinfo_hooks_walking++;
+   EINA_INLIST_FOREACH(_appinfo_hooks[hookpoint], hook)
+     {
+        if (hook->delete_me) continue;
+        hook->func(appid, pid, hook->data);
+     }
+   _appinfo_hooks_walking--;
+   if ((_appinfo_hooks_walking == 0) && (_appinfo_hooks_delete) > 0)
+     _e_appinfo_hooks_clean();
+}
+
+
+EINTERN E_Appinfo *
+e_appinfo_new(void)
+{
+   E_Appinfo *epai = NULL;
+
+   epai = E_NEW(E_Appinfo, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, NULL);
+
+   epai->pid = -1;
+   epai->appid = NULL;
+
+   appinfo_list = eina_list_append(appinfo_list, epai);
+
+   ELOGF("POL_APPINFO", "appinfo(%p) create", NULL, epai);
+
+   return epai;
+}
+
+EINTERN void
+e_appinfo_del(E_Appinfo *epai)
+{
+   EINA_SAFETY_ON_NULL_RETURN(epai);
+
+   ELOGF("POL_APPINFO", "appinfo(%p) delete", NULL, epai);
+
+   if (epai->appid)
+     eina_stringshare_del(epai->appid);
+
+   appinfo_list = eina_list_remove(appinfo_list, epai);
+
+   E_FREE(epai);
+}
+
+EINTERN Eina_Bool
+e_appinfo_pid_set(E_Appinfo *epai, pid_t pid)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(pid <= 0, EINA_FALSE);
+
+   epai->pid = pid;
+
+   ELOGF("POL_APPINFO", "appinfo(%p) set pid(%u)", NULL, epai, pid);
+
+   _e_appinfo_hook_call(E_APPINFO_HOOK_PID_SET, epai->appid, pid);
+
+   return EINA_TRUE;
+}
+
+EINTERN Eina_Bool
+e_appinfo_appid_set(E_Appinfo *epai, const char *appid)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(appid, EINA_FALSE);
+
+   if (epai->appid)
+     eina_stringshare_del(epai->appid);
+
+   epai->appid = eina_stringshare_add(appid);
+
+   ELOGF("POL_APPINFO", "appinfo(%p) set appid(%s)", NULL, epai, appid);
+
+   _e_appinfo_hook_call(E_APPINFO_HOOK_PID_SET, epai->appid, epai->pid);
+
+   return EINA_TRUE;
+}
+
+EINTERN void
+e_appinfo_ready_metadata(E_Appinfo *epai, pid_t pid)
+{
+   EINA_SAFETY_ON_NULL_RETURN(epai);
+   EINA_SAFETY_ON_TRUE_RETURN(pid < 0);
+
+   if (epai->pid != pid)
+     e_appinfo_pid_set(epai, pid);
+
+   _e_appinfo_hook_call(E_APPINFO_HOOK_METADATA_READY, epai->appid, epai->pid);
+}
+
+EINTERN Eina_Bool
+e_appinfo_base_output_resolution_get(E_Appinfo *epai, int *width, int *height)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(width, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(height, EINA_FALSE);
+
+   if (!epai->base_output_available)
+     {
+        *width = 0;
+        *height = 0;
+        return EINA_FALSE;
+     }
+
+   *width = epai->base_output_width;
+   *height = epai->base_output_height;
+
+   return EINA_TRUE;
+}
+
+E_API E_Appinfo *
+e_appinfo_find_with_pid(pid_t pid)
+{
+   E_Appinfo *epai = NULL;
+   Eina_List *l = NULL;
+
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(pid <= 0, NULL);
+
+   EINA_LIST_FOREACH(appinfo_list, l, epai)
+     {
+        if (epai->pid == pid)
+          return epai;
+     }
+
+   return NULL;
+}
+
+E_API E_Appinfo *
+e_appinfo_find_with_appid(const char *appid)
+{
+   E_Appinfo *epai = NULL;
+   Eina_List *l = NULL;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(appid, NULL);
+
+   EINA_LIST_FOREACH(appinfo_list, l, epai)
+     {
+        if (!e_util_strcmp(epai->appid, appid))
+          return epai;
+     }
+
+   return NULL;
+}
+
+E_API Eina_Bool
+e_appinfo_base_output_resolution_set(E_Appinfo *epai, int width, int height)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(width < 0, EINA_FALSE);
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(height < 0, EINA_FALSE);
+
+   epai->base_output_width = width;
+   epai->base_output_height = height;
+   epai->base_output_available = EINA_TRUE;
+
+   ELOGF("POL_APPINFO", "appinfo(%p) set base_output_resolution(%d, %d):(pid,%u)", NULL, epai, width, height, epai->pid);
+
+   return EINA_TRUE;
+}
+
+E_API E_Appinfo_Hook *
+e_appinfo_hook_add(E_Appinfo_Hook_Point hookpoint, E_Appinfo_Hook_Cb cb, const void *data)
+{
+   E_Appinfo_Hook *hook;
+
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(hookpoint < 0, NULL);
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(hookpoint >= E_APPINFO_HOOK_LAST, NULL);
+
+   hook = E_NEW(E_Appinfo_Hook, 1);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(hook, NULL);
+
+   hook->hookpoint = hookpoint;
+   hook->func = cb;
+   hook->data = (void*)data;
+
+   _appinfo_hooks[hookpoint] = eina_inlist_append(_appinfo_hooks[hookpoint], EINA_INLIST_GET(hook));
+
+   return hook;
+}
+
+E_API void
+e_appinfo_hook_del(E_Appinfo_Hook *hook)
+{
+   EINA_SAFETY_ON_NULL_RETURN(hook);
+
+   hook->delete_me = 1;
+   if (_appinfo_hooks_walking == 0)
+     {
+        _appinfo_hooks[hook->hookpoint] = eina_inlist_remove(_appinfo_hooks[hook->hookpoint], EINA_INLIST_GET(hook));
+        free(hook);
+     }
+   else
+     _appinfo_hooks_delete++;
+}
diff --git a/src/bin/e_appinfo.h b/src/bin/e_appinfo.h
new file mode 100644 (file)
index 0000000..efe7429
--- /dev/null
@@ -0,0 +1,41 @@
+#ifdef E_TYPEDEFS
+typedef struct _E_Appinfo E_Appinfo;
+#else
+# ifndef E_APPINFO_H
+# define E_APPINFO_H
+typedef struct _E_Appinfo_Hook E_Appinfo_Hook;
+
+typedef enum _E_Appinfo_Hook_Point
+{
+   E_APPINFO_HOOK_APPID_SET,
+   E_APPINFO_HOOK_PID_SET,
+   E_APPINFO_HOOK_METADATA_READY,
+   E_APPINFO_HOOK_LAST,
+} E_Appinfo_Hook_Point;
+
+typedef void (*E_Appinfo_Hook_Cb)(const char *appid, pid_t pid, void *data);
+
+struct _E_Appinfo_Hook
+{
+   EINA_INLIST;
+   E_Appinfo_Hook_Point hookpoint;
+   E_Appinfo_Hook_Cb func;
+   void *data;
+   unsigned char delete_me : 1;
+};
+
+EINTERN E_Appinfo           *e_appinfo_new(void);
+EINTERN void                 e_appinfo_del(E_Appinfo *epai);
+EINTERN Eina_Bool            e_appinfo_pid_set(E_Appinfo *epai, pid_t pid);
+EINTERN Eina_Bool            e_appinfo_appid_set(E_Appinfo *epai, const char *appid);
+EINTERN void                 e_appinfo_ready_metadata(E_Appinfo *epai, pid_t pid);
+EINTERN Eina_Bool            e_appinfo_base_output_resolution_get(E_Appinfo *epai, int *width, int *height);
+
+E_API E_Appinfo             *e_appinfo_find_with_pid(pid_t pid);
+E_API E_Appinfo             *e_appinfo_find_with_appid(const char *appid);
+E_API Eina_Bool              e_appinfo_base_output_resolution_set(E_Appinfo *epai, int width, int height);
+
+E_API E_Appinfo_Hook        *e_appinfo_hook_add(E_Appinfo_Hook_Point point, E_Appinfo_Hook_Cb cb, const void *data);
+E_API void                   e_appinfo_hook_del(E_Appinfo_Hook *hook);
+# endif
+#endif
index 5f92aa53606bd29801c4c4083607aae60cff696d..d05b6852775652647ad97ff890e792a8a5d62d78 100644 (file)
@@ -7467,7 +7467,7 @@ e_client_base_output_resolution_transform_adjust(E_Client *ec)
 E_API Eina_Bool
 e_client_base_output_resolution_update(E_Client *ec)
 {
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
    int configured_width, configured_height;
    int width, height;
 
@@ -7493,7 +7493,7 @@ e_client_base_output_resolution_update(E_Client *ec)
        goto use_configured;
     }
 
-   epai = e_policy_appinfo_find_with_pid(ec->netwm.pid);
+   epai = e_appinfo_find_with_pid(ec->netwm.pid);
    if (!epai)
      {
         ELOGF("POL_APPINFO", "NO APPINFO... USE configured_output_resolution(%d,%d) pid:%d", ec,
@@ -7501,7 +7501,7 @@ e_client_base_output_resolution_update(E_Client *ec)
         goto use_configured;
      }
 
-   if (!e_policy_appinfo_base_output_resolution_get(epai, &width, &height))
+   if (!e_appinfo_base_output_resolution_get(epai, &width, &height))
      {
         ELOGF("POL_APPINFO", "NO BASE SCREEN RESOLUTION... USE configured_output_resolution(%d,%d) pid:%d", ec,
               configured_width, configured_height, ec->netwm.pid);
index 4e508cac359a097cb30b1ebca343270feca1c236..a3c739d7a6be6b690249cb58a8a8cae32137e2fd 100644 (file)
@@ -3618,7 +3618,7 @@ _e_comp_wl_cb_output_bind(struct wl_client *client, void *data, uint32_t version
 {
    E_Comp_Wl_Output *output;
    struct wl_resource *resource;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
    pid_t pid = 0;
    int res_w, res_h;
 
@@ -3652,7 +3652,7 @@ _e_comp_wl_cb_output_bind(struct wl_client *client, void *data, uint32_t version
              goto send_info;
           }
 
-        epai = e_policy_appinfo_find_with_pid(pid);
+        epai = e_appinfo_find_with_pid(pid);
         if (!epai)
           {
              res_w = e_config->configured_output_resolution.w;
@@ -3660,7 +3660,7 @@ _e_comp_wl_cb_output_bind(struct wl_client *client, void *data, uint32_t version
              goto send_info;
           }
 
-        if (!e_policy_appinfo_base_output_resolution_get(epai, &res_w, &res_h))
+        if (!e_appinfo_base_output_resolution_get(epai, &res_w, &res_h))
           {
              res_w = e_config->configured_output_resolution.w;
              res_h = e_config->configured_output_resolution.h;
index b36ee1f36d8387d628c74777184b22006ef19c7c..1e5d3e70be7e0622fad956b2647dae40a6ecc5e0 100644 (file)
@@ -71,7 +71,7 @@
 #include "e_policy.h"
 #include "e_policy_conformant.h"
 #include "e_policy_visibility.h"
-#include "e_policy_appinfo.h"
+#include "e_appinfo.h"
 #include "e_magnifier.h"
 #include "e_process.h"
 #include "e_splitlayout.h"
diff --git a/src/bin/e_policy_appinfo.c b/src/bin/e_policy_appinfo.c
deleted file mode 100644 (file)
index 0c18bcf..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-#include "e.h"
-#include "e_policy_appinfo.h"
-
-static Eina_List *appinfo_list;
-
-static int _appinfo_hooks_walking = 0;
-static int _appinfo_hooks_delete = 0;
-
-static Eina_Inlist *_appinfo_hooks[] =
-{
-   [E_POLICY_APPINFO_HOOK_APPID_SET] = NULL,
-   [E_POLICY_APPINFO_HOOK_PID_SET] = NULL,
-   [E_POLICY_APPINFO_HOOK_METADATA_READY] = NULL,
-};
-
-struct _E_Policy_Appinfo
-{
-   pid_t               pid;
-   Eina_Stringshare   *appid;
-   Eina_Bool base_output_available;
-   int base_output_width;
-   int base_output_height;
-};
-
-static void
-_e_policy_appinfo_hooks_clean(void)
-{
-   Eina_Inlist *l;
-   E_Policy_Appinfo_Hook *hook;
-   unsigned int x;
-
-   for (x = 0; x < E_POLICY_APPINFO_HOOK_LAST; x++)
-     EINA_INLIST_FOREACH_SAFE(_appinfo_hooks[x], l, hook)
-       {
-          if (!hook->delete_me) continue;
-          _appinfo_hooks[x] = eina_inlist_remove(_appinfo_hooks[x], EINA_INLIST_GET(hook));
-          free(hook);
-       }
-}
-
-static void
-_e_policy_appinfo_hook_call(E_Policy_Appinfo_Hook_Point hookpoint, const char* appid, pid_t pid)
-{
-   E_Policy_Appinfo_Hook *hook;
-
-   _appinfo_hooks_walking++;
-   EINA_INLIST_FOREACH(_appinfo_hooks[hookpoint], hook)
-     {
-        if (hook->delete_me) continue;
-        hook->func(appid, pid, hook->data);
-     }
-   _appinfo_hooks_walking--;
-   if ((_appinfo_hooks_walking == 0) && (_appinfo_hooks_delete) > 0)
-     _e_policy_appinfo_hooks_clean();
-}
-
-
-EINTERN E_Policy_Appinfo *
-e_policy_appinfo_new(void)
-{
-   E_Policy_Appinfo *epai = NULL;
-
-   epai = E_NEW(E_Policy_Appinfo, 1);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, NULL);
-
-   epai->pid = -1;
-   epai->appid = NULL;
-
-   appinfo_list = eina_list_append(appinfo_list, epai);
-
-   ELOGF("POL_APPINFO", "appinfo(%p) create", NULL, epai);
-
-   return epai;
-}
-
-EINTERN void
-e_policy_appinfo_del(E_Policy_Appinfo *epai)
-{
-   EINA_SAFETY_ON_NULL_RETURN(epai);
-
-   ELOGF("POL_APPINFO", "appinfo(%p) delete", NULL, epai);
-
-   if (epai->appid)
-     eina_stringshare_del(epai->appid);
-
-   appinfo_list = eina_list_remove(appinfo_list, epai);
-
-   E_FREE(epai);
-}
-
-EINTERN Eina_Bool
-e_policy_appinfo_pid_set(E_Policy_Appinfo *epai, pid_t pid)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(pid <= 0, EINA_FALSE);
-
-   epai->pid = pid;
-
-   ELOGF("POL_APPINFO", "appinfo(%p) set pid(%u)", NULL, epai, pid);
-
-   _e_policy_appinfo_hook_call(E_POLICY_APPINFO_HOOK_PID_SET, epai->appid, pid);
-
-   return EINA_TRUE;
-}
-
-EINTERN Eina_Bool
-e_policy_appinfo_appid_set(E_Policy_Appinfo *epai, const char *appid)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(appid, EINA_FALSE);
-
-   if (epai->appid)
-     eina_stringshare_del(epai->appid);
-
-   epai->appid = eina_stringshare_add(appid);
-
-   ELOGF("POL_APPINFO", "appinfo(%p) set appid(%s)", NULL, epai, appid);
-
-   _e_policy_appinfo_hook_call(E_POLICY_APPINFO_HOOK_PID_SET, epai->appid, epai->pid);
-
-   return EINA_TRUE;
-}
-
-EINTERN void
-e_policy_appinfo_ready_metadata(E_Policy_Appinfo *epai, pid_t pid)
-{
-   EINA_SAFETY_ON_NULL_RETURN(epai);
-   EINA_SAFETY_ON_TRUE_RETURN(pid < 0);
-
-   if (epai->pid != pid)
-     e_policy_appinfo_pid_set(epai, pid);
-
-   _e_policy_appinfo_hook_call(E_POLICY_APPINFO_HOOK_METADATA_READY, epai->appid, epai->pid);
-}
-
-EINTERN Eina_Bool
-e_policy_appinfo_base_output_resolution_get(E_Policy_Appinfo *epai, int *width, int *height)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(width, EINA_FALSE);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(height, EINA_FALSE);
-
-   if (!epai->base_output_available)
-     {
-        *width = 0;
-        *height = 0;
-        return EINA_FALSE;
-     }
-
-   *width = epai->base_output_width;
-   *height = epai->base_output_height;
-
-   return EINA_TRUE;
-}
-
-E_API E_Policy_Appinfo *
-e_policy_appinfo_find_with_pid(pid_t pid)
-{
-   E_Policy_Appinfo *epai = NULL;
-   Eina_List *l = NULL;
-
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(pid <= 0, NULL);
-
-   EINA_LIST_FOREACH(appinfo_list, l, epai)
-     {
-        if (epai->pid == pid)
-          return epai;
-     }
-
-   return NULL;
-}
-
-E_API E_Policy_Appinfo *
-e_policy_appinfo_find_with_appid(const char *appid)
-{
-   E_Policy_Appinfo *epai = NULL;
-   Eina_List *l = NULL;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(appid, NULL);
-
-   EINA_LIST_FOREACH(appinfo_list, l, epai)
-     {
-        if (!e_util_strcmp(epai->appid, appid))
-          return epai;
-     }
-
-   return NULL;
-}
-
-E_API Eina_Bool
-e_policy_appinfo_base_output_resolution_set(E_Policy_Appinfo *epai, int width, int height)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(width < 0, EINA_FALSE);
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(height < 0, EINA_FALSE);
-
-   epai->base_output_width = width;
-   epai->base_output_height = height;
-   epai->base_output_available = EINA_TRUE;
-
-   ELOGF("POL_APPINFO", "appinfo(%p) set base_output_resolution(%d, %d):(pid,%u)", NULL, epai, width, height, epai->pid);
-
-   return EINA_TRUE;
-}
-
-E_API E_Policy_Appinfo_Hook *
-e_policy_appinfo_hook_add(E_Policy_Appinfo_Hook_Point hookpoint, E_Policy_Appinfo_Hook_Cb cb, const void *data)
-{
-   E_Policy_Appinfo_Hook *hook;
-
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(hookpoint < 0, NULL);
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(hookpoint >= E_POLICY_APPINFO_HOOK_LAST, NULL);
-
-   hook = E_NEW(E_Policy_Appinfo_Hook, 1);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(hook, NULL);
-
-   hook->hookpoint = hookpoint;
-   hook->func = cb;
-   hook->data = (void*)data;
-
-   _appinfo_hooks[hookpoint] = eina_inlist_append(_appinfo_hooks[hookpoint], EINA_INLIST_GET(hook));
-
-   return hook;
-}
-
-E_API void
-e_policy_appinfo_hook_del(E_Policy_Appinfo_Hook *hook)
-{
-   EINA_SAFETY_ON_NULL_RETURN(hook);
-
-   hook->delete_me = 1;
-   if (_appinfo_hooks_walking == 0)
-     {
-        _appinfo_hooks[hook->hookpoint] = eina_inlist_remove(_appinfo_hooks[hook->hookpoint], EINA_INLIST_GET(hook));
-        free(hook);
-     }
-   else
-     _appinfo_hooks_delete++;
-}
index 1cc41e1443be2d149ea1ad39c2b846de997c2492..a6ded0019bc576b7d80cb8b4b01a419b50a2d2f4 100644 (file)
@@ -1,41 +1,4 @@
-#ifdef E_TYPEDEFS
-typedef struct _E_Policy_Appinfo E_Policy_Appinfo;
-#else
-# ifndef E_POLICY_APPINFO_H
-# define E_POLICY_APPINFO_H
-typedef struct _E_Policy_Appinfo_Hook E_Policy_Appinfo_Hook;
-
-typedef enum _E_Policy_Appinfo_Hook_Point
-{
-   E_POLICY_APPINFO_HOOK_APPID_SET,
-   E_POLICY_APPINFO_HOOK_PID_SET,
-   E_POLICY_APPINFO_HOOK_METADATA_READY,
-   E_POLICY_APPINFO_HOOK_LAST,
-} E_Policy_Appinfo_Hook_Point;
-
-typedef void (*E_Policy_Appinfo_Hook_Cb)(const char *appid, pid_t pid, void *data);
-
-struct _E_Policy_Appinfo_Hook
-{
-   EINA_INLIST;
-   E_Policy_Appinfo_Hook_Point hookpoint;
-   E_Policy_Appinfo_Hook_Cb func;
-   void *data;
-   unsigned char delete_me : 1;
-};
-
-EINTERN E_Policy_Appinfo    *e_policy_appinfo_new(void);
-EINTERN void                 e_policy_appinfo_del(E_Policy_Appinfo *epai);
-EINTERN Eina_Bool            e_policy_appinfo_pid_set(E_Policy_Appinfo *epai, pid_t pid);
-EINTERN Eina_Bool            e_policy_appinfo_appid_set(E_Policy_Appinfo *epai, const char *appid);
-EINTERN void                 e_policy_appinfo_ready_metadata(E_Policy_Appinfo *epai, pid_t pid);
-EINTERN Eina_Bool            e_policy_appinfo_base_output_resolution_get(E_Policy_Appinfo *epai, int *width, int *height);
-
-E_API E_Policy_Appinfo      *e_policy_appinfo_find_with_pid(pid_t pid);
-E_API E_Policy_Appinfo      *e_policy_appinfo_find_with_appid(const char *appid);
-E_API Eina_Bool              e_policy_appinfo_base_output_resolution_set(E_Policy_Appinfo *epai, int width, int height);
-
-E_API E_Policy_Appinfo_Hook *e_policy_appinfo_hook_add(E_Policy_Appinfo_Hook_Point point, E_Policy_Appinfo_Hook_Cb cb, const void *data);
-E_API void                   e_policy_appinfo_hook_del(E_Policy_Appinfo_Hook *hook);
-# endif
+#ifndef _E_POLICY_APPINFO_H
+# define _E_POLICY_APPINFO_H
+# include "e_appinfo.h"
 #endif
index 7de1af135c337719ff3f26627f93ab05602f3cba..8318e99262bd0247ceefb02938a232e88e45e93c 100644 (file)
@@ -11,7 +11,7 @@
 #include "e_policy_wl_display.h"
 #include "e_policy_conformant_internal.h"
 #include "e_policy_visibility.h"
-#include "e_policy_appinfo.h"
+#include "e_appinfo.h"
 
 #include <device/display.h>
 #include <wayland-server.h>
@@ -3318,21 +3318,21 @@ static void
 _tzpol_iface_cb_set_appid(struct wl_client *client, struct wl_resource *res_tzpol, int32_t pid, const char *appid)
 {
    E_Policy_Wl_Tzpol *tzpol;
-   E_Policy_Appinfo *appinfo;
+   E_Appinfo *appinfo;
 
    tzpol = _e_policy_wl_tzpol_get(res_tzpol);
    EINA_SAFETY_ON_NULL_RETURN(tzpol);
 
    ELOGF("TZPOL", "Set appid(%s) pid(%d)", NULL, appid, pid);
 
-   if (!(appinfo = e_policy_appinfo_find_with_appid(appid)))
+   if (!(appinfo = e_appinfo_find_with_appid(appid)))
      {
-        appinfo = e_policy_appinfo_new();
-        e_policy_appinfo_appid_set(appinfo, appid);
+        appinfo = e_appinfo_new();
+        e_appinfo_appid_set(appinfo, appid);
      }
    EINA_SAFETY_ON_NULL_RETURN(appinfo);
 
-   e_policy_appinfo_pid_set(appinfo, pid);
+   e_appinfo_pid_set(appinfo, pid);
 }
 
 // --------------------------------------------------------
@@ -6642,7 +6642,7 @@ _tzlaunch_appinfo_iface_cb_register_pid(struct wl_client *client, struct wl_reso
                                             uint32_t pid)
 {
    E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
 
    appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
    if (!appinfo)
@@ -6659,13 +6659,13 @@ _tzlaunch_appinfo_iface_cb_register_pid(struct wl_client *client, struct wl_reso
         return;
      }
 
-   epai = e_policy_appinfo_new();
+   epai = e_appinfo_new();
    EINA_SAFETY_ON_NULL_RETURN(epai);
 
-   if (!e_policy_appinfo_pid_set(epai, pid))
+   if (!e_appinfo_pid_set(epai, pid))
      {
         ELOGF("TZ_APPINFO", "failed to set pid is invalid. pid:%u", NULL, pid);
-        e_policy_appinfo_del(epai);
+        e_appinfo_del(epai);
         return;
      }
 }
@@ -6675,7 +6675,7 @@ _tzlaunch_appinfo_iface_cb_deregister_pid(struct wl_client *client, struct wl_re
                                             uint32_t pid)
 {
    E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
 
    appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
    if (!appinfo)
@@ -6686,10 +6686,10 @@ _tzlaunch_appinfo_iface_cb_deregister_pid(struct wl_client *client, struct wl_re
         return;
      }
 
-   epai = e_policy_appinfo_find_with_pid(pid);
+   epai = e_appinfo_find_with_pid(pid);
    EINA_SAFETY_ON_NULL_RETURN(epai);
 
-   e_policy_appinfo_del(epai);
+   e_appinfo_del(epai);
 }
 
 static void
@@ -6697,7 +6697,7 @@ _tzlaunch_appinfo_iface_cb_set_appid(struct wl_client *client, struct wl_resourc
                                       uint32_t pid, const char *appid)
 {
    E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
    int width = 0;
    int height = 0;
 
@@ -6716,10 +6716,10 @@ _tzlaunch_appinfo_iface_cb_set_appid(struct wl_client *client, struct wl_resourc
         return;
      }
 
-   epai = e_policy_appinfo_find_with_pid(pid);
+   epai = e_appinfo_find_with_pid(pid);
    EINA_SAFETY_ON_NULL_RETURN(epai);
 
-   if (!e_policy_appinfo_appid_set(epai, appid))
+   if (!e_appinfo_appid_set(epai, appid))
      {
         ELOGF("TZ_APPINFO", "failed to set appid, appid:%s", NULL, appid);
         return;
@@ -6728,12 +6728,12 @@ _tzlaunch_appinfo_iface_cb_set_appid(struct wl_client *client, struct wl_resourc
    // 1. send HOOK with pid
    _e_policy_wl_hook_call(E_POLICY_WL_HOOK_BASE_OUTPUT_RESOLUTION_GET, pid);
    // 2. module must set the base_output_resolution.
-   if (!e_policy_appinfo_base_output_resolution_get(epai, &width, &height))
+   if (!e_appinfo_base_output_resolution_get(epai, &width, &height))
      {
         ELOGF("TZ_APPINFO", "failed to set base_output_resolution in module, pid:%u, appid:%s", NULL, pid, appid);
         return;
      }
-   // 3. server has to get the base_screern_resolution via e_policy_appinfo_base_output_resolution_get.
+   // 3. server has to get the base_screern_resolution via e_appinfo_base_output_resolution_get.
    //    3-1. if success, use the base_rescreen_resolution
    //    3-2. if fail, get the base_output_resolution from the E_Comp_Wl_Output.
 
@@ -6757,7 +6757,7 @@ static void
 _tzlaunch_appinfo_iface_cb_get_base_output_resolution(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
                                     uint32_t pid)
 {
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
    int width = 0, height = 0;
 
    if (pid <= 0)
@@ -6766,14 +6766,14 @@ _tzlaunch_appinfo_iface_cb_get_base_output_resolution(struct wl_client *client,
         goto err;
      }
 
-   epai = e_policy_appinfo_find_with_pid(pid);
+   epai = e_appinfo_find_with_pid(pid);
    if (!epai)
      {
         ELOGF("TZ_APPINFO", "cannot find pid. pid:%u", NULL, pid);
         goto err;
      }
 
-   if (!e_policy_appinfo_base_output_resolution_get(epai, &width, &height))
+   if (!e_appinfo_base_output_resolution_get(epai, &width, &height))
      {
         ELOGF("TZ_APPINFO", "cannot read size. pid:%u", NULL, pid);
         goto err;
@@ -6799,7 +6799,7 @@ _tzlaunch_appinfo_iface_cb_register_appid(struct wl_client *client, struct wl_re
                                           const char *appid)
 {
    E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
 
    appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
    if (!appinfo)
@@ -6810,19 +6810,19 @@ _tzlaunch_appinfo_iface_cb_register_appid(struct wl_client *client, struct wl_re
         return;
      }
 
-   if ((epai = e_policy_appinfo_find_with_appid(appid)))
+   if ((epai = e_appinfo_find_with_appid(appid)))
      {
         ELOGF("TZ_APPINFO", "appid:%s is already registered!", NULL, appid);
         return;
      }
 
-   epai = e_policy_appinfo_new();
+   epai = e_appinfo_new();
    EINA_SAFETY_ON_NULL_RETURN(epai);
 
-   if (!e_policy_appinfo_appid_set(epai, appid))
+   if (!e_appinfo_appid_set(epai, appid))
      {
         ELOGF("TZ_APPINFO", "Failed to register appid:%s", NULL, appid);
-        e_policy_appinfo_del(epai);
+        e_appinfo_del(epai);
         return;
      }
 }
@@ -6832,7 +6832,7 @@ _tzlaunch_appinfo_iface_cb_deregister_appid(struct wl_client *client, struct wl_
                                             const char *appid)
 {
    E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
 
    appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
    if (!appinfo)
@@ -6843,10 +6843,10 @@ _tzlaunch_appinfo_iface_cb_deregister_appid(struct wl_client *client, struct wl_
         return;
      }
 
-   epai = e_policy_appinfo_find_with_appid(appid);
+   epai = e_appinfo_find_with_appid(appid);
    EINA_SAFETY_ON_NULL_RETURN(epai);
 
-   e_policy_appinfo_del(epai);
+   e_appinfo_del(epai);
 }
 
 static void
@@ -6854,7 +6854,7 @@ _tzlaunch_appinfo_iface_cb_set_pid(struct wl_client *client, struct wl_resource
                                    const char *appid, uint32_t pid)
 {
    E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
 
    appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
    if (!appinfo)
@@ -6865,10 +6865,10 @@ _tzlaunch_appinfo_iface_cb_set_pid(struct wl_client *client, struct wl_resource
         return;
      }
 
-   epai = e_policy_appinfo_find_with_appid(appid);
+   epai = e_appinfo_find_with_appid(appid);
    EINA_SAFETY_ON_NULL_RETURN(epai);
 
-   if (!e_policy_appinfo_pid_set(epai, pid))
+   if (!e_appinfo_pid_set(epai, pid))
      {
         ELOGF("TZ_APPINFO", "Failed to set pid:%u for appid:%s", NULL, pid, appid);
         return;
@@ -6880,7 +6880,7 @@ _tzlaunch_appinfo_iface_cb_ready_metadata(struct wl_client *client, struct wl_re
                                           const char *appid, uint32_t pid)
 {
    E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
-   E_Policy_Appinfo *epai = NULL;
+   E_Appinfo *epai = NULL;
    int width = 0, height = 0;
 
    appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
@@ -6892,22 +6892,22 @@ _tzlaunch_appinfo_iface_cb_ready_metadata(struct wl_client *client, struct wl_re
         return;
      }
 
-   epai = e_policy_appinfo_find_with_appid(appid);
+   epai = e_appinfo_find_with_appid(appid);
    EINA_SAFETY_ON_NULL_RETURN(epai);
 
-   e_policy_appinfo_ready_metadata(epai, pid);
+   e_appinfo_ready_metadata(epai, pid);
 
    /* about base  output resolution */
 
    // 1. send HOOK with pid
    _e_policy_wl_hook_call(E_POLICY_WL_HOOK_BASE_OUTPUT_RESOLUTION_GET, pid);
    // 2. module must set the base_output_resolution.
-   if (!e_policy_appinfo_base_output_resolution_get(epai, &width, &height))
+   if (!e_appinfo_base_output_resolution_get(epai, &width, &height))
      {
         ELOGF("TZ_APPINFO", "failed to set base_output_resolution in module, pid:%u, appid:%s", NULL, pid, appid);
         return;
      }
-   // 3. server has to get the base_screern_resolution via e_policy_appinfo_base_output_resolution_get.
+   // 3. server has to get the base_screern_resolution via e_appinfo_base_output_resolution_get.
    //    3-1. if success, use the base_rescreen_resolution
    //    3-2. if fail, get the base_output_resolution from the E_Comp_Wl_Output.
 
index 622b395127c75f88bcfcb3131b677280619ce786..91ee84db81125043c28ec4e2114c9e9a834872b8 100644 (file)
@@ -57,7 +57,7 @@ struct _E_Service_Launcher_Handler
    Eina_List           *hooks_ec;       //hook list for E_CLIENT_HOOK_*
    Eina_List           *hooks_vis;      //hook list for E_POL_VIS_HOOK_TYPE_*
    Eina_List           *hooks_co;       //hook list for E_COMP_OBJECT_INTERCEPT_HOOK_*
-   Eina_List           *hooks_appinfo;  //hook list for E_POLICY_APPINFO_HOOK_*
+   Eina_List           *hooks_appinfo;  //hook list for E_APPINFO_HOOK_*
    Eina_List           *hdlrs_ev;       //handler list for ecore event
 
    E_Service_Launcher  *runner;         //current runner(running launcher)
@@ -1721,8 +1721,8 @@ _launcher_handler_create(void)
                            _launcher_handler_cb_hook_intercept_show_helper, NULL);
 
    LAUNCHER_HANDLER_CB_ADD(laundler->hooks_appinfo,
-                           e_policy_appinfo_hook_add,
-                           E_POLICY_APPINFO_HOOK_PID_SET,
+                           e_appinfo_hook_add,
+                           E_APPINFO_HOOK_PID_SET,
                            _launcher_handler_cb_hook_appinfo_pid_set, NULL);
 
    LAUNCHER_HANDLER_CB_ADD(laundler->hdlrs_ev,
@@ -1741,7 +1741,7 @@ _launcher_handler_destroy(E_Service_Launcher_Handler *laundler)
    EINA_SAFETY_ON_NULL_RETURN(laundler);
 
    E_FREE_LIST(laundler->hdlrs_ev, ecore_event_handler_del);
-   E_FREE_LIST(laundler->hooks_appinfo, e_policy_appinfo_hook_del);
+   E_FREE_LIST(laundler->hooks_appinfo, e_appinfo_hook_del);
    E_FREE_LIST(laundler->hooks_co, e_comp_object_intercept_hook_del);
    E_FREE_LIST(laundler->hooks_ec, e_client_hook_del);
    E_FREE_LIST(laundler->hooks_vis, e_policy_visibility_hook_del);