EINTERN E_Appinfo *
e_appinfo_new(void)
{
- E_Appinfo *epai = NULL;
+ E_Appinfo *eai = NULL;
- epai = E_NEW(E_Appinfo, 1);
- EINA_SAFETY_ON_NULL_RETURN_VAL(epai, NULL);
+ eai = E_NEW(E_Appinfo, 1);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eai, NULL);
- epai->pid = -1;
- epai->appid = NULL;
+ eai->pid = -1;
+ eai->appid = NULL;
- appinfo_list = eina_list_append(appinfo_list, epai);
+ appinfo_list = eina_list_append(appinfo_list, eai);
- ELOGF("POL_APPINFO", "appinfo(%p) create", NULL, epai);
+ ELOGF("POL_APPINFO", "appinfo(%p) create", NULL, eai);
- return epai;
+ return eai;
}
EINTERN void
-e_appinfo_del(E_Appinfo *epai)
+e_appinfo_del(E_Appinfo *eai)
{
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- ELOGF("POL_APPINFO", "appinfo(%p) delete", NULL, epai);
+ ELOGF("POL_APPINFO", "appinfo(%p) delete", NULL, eai);
- if (epai->appid)
- eina_stringshare_del(epai->appid);
+ if (eai->appid)
+ eina_stringshare_del(eai->appid);
- appinfo_list = eina_list_remove(appinfo_list, epai);
+ appinfo_list = eina_list_remove(appinfo_list, eai);
- E_FREE(epai);
+ E_FREE(eai);
}
EINTERN Eina_Bool
-e_appinfo_pid_set(E_Appinfo *epai, pid_t pid)
+e_appinfo_pid_set(E_Appinfo *eai, pid_t pid)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eai, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(pid <= 0, EINA_FALSE);
- epai->pid = pid;
+ eai->pid = pid;
- ELOGF("POL_APPINFO", "appinfo(%p) set pid(%u)", NULL, epai, pid);
+ ELOGF("POL_APPINFO", "appinfo(%p) set pid(%u)", NULL, eai, pid);
- _e_appinfo_hook_call(E_APPINFO_HOOK_PID_SET, epai->appid, pid);
+ _e_appinfo_hook_call(E_APPINFO_HOOK_PID_SET, eai->appid, pid);
return EINA_TRUE;
}
EINTERN Eina_Bool
-e_appinfo_appid_set(E_Appinfo *epai, const char *appid)
+e_appinfo_appid_set(E_Appinfo *eai, const char *appid)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eai, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(appid, EINA_FALSE);
- if (epai->appid)
- eina_stringshare_del(epai->appid);
+ if (eai->appid)
+ eina_stringshare_del(eai->appid);
- epai->appid = eina_stringshare_add(appid);
+ eai->appid = eina_stringshare_add(appid);
- ELOGF("POL_APPINFO", "appinfo(%p) set appid(%s)", NULL, epai, appid);
+ ELOGF("POL_APPINFO", "appinfo(%p) set appid(%s)", NULL, eai, appid);
- _e_appinfo_hook_call(E_APPINFO_HOOK_PID_SET, epai->appid, epai->pid);
+ _e_appinfo_hook_call(E_APPINFO_HOOK_PID_SET, eai->appid, eai->pid);
return EINA_TRUE;
}
EINTERN void
-e_appinfo_ready_metadata(E_Appinfo *epai, pid_t pid)
+e_appinfo_ready_metadata(E_Appinfo *eai, pid_t pid)
{
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
EINA_SAFETY_ON_TRUE_RETURN(pid < 0);
- if (epai->pid != pid)
- e_appinfo_pid_set(epai, pid);
+ if (eai->pid != pid)
+ e_appinfo_pid_set(eai, pid);
- _e_appinfo_hook_call(E_APPINFO_HOOK_METADATA_READY, epai->appid, epai->pid);
+ _e_appinfo_hook_call(E_APPINFO_HOOK_METADATA_READY, eai->appid, eai->pid);
}
EINTERN Eina_Bool
-e_appinfo_base_output_resolution_get(E_Appinfo *epai, int *width, int *height)
+e_appinfo_base_output_resolution_get(E_Appinfo *eai, int *width, int *height)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eai, 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)
+ if (!eai->base_output_available)
{
*width = 0;
*height = 0;
return EINA_FALSE;
}
- *width = epai->base_output_width;
- *height = epai->base_output_height;
+ *width = eai->base_output_width;
+ *height = eai->base_output_height;
return EINA_TRUE;
}
E_API E_Appinfo *
e_appinfo_find_with_pid(pid_t pid)
{
- E_Appinfo *epai = NULL;
+ E_Appinfo *eai = NULL;
Eina_List *l = NULL;
EINA_SAFETY_ON_TRUE_RETURN_VAL(pid <= 0, NULL);
- EINA_LIST_FOREACH(appinfo_list, l, epai)
+ EINA_LIST_FOREACH(appinfo_list, l, eai)
{
- if (epai->pid == pid)
- return epai;
+ if (eai->pid == pid)
+ return eai;
}
return NULL;
E_API E_Appinfo *
e_appinfo_find_with_appid(const char *appid)
{
- E_Appinfo *epai = NULL;
+ E_Appinfo *eai = NULL;
Eina_List *l = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(appid, NULL);
- EINA_LIST_FOREACH(appinfo_list, l, epai)
+ EINA_LIST_FOREACH(appinfo_list, l, eai)
{
- if (!e_util_strcmp(epai->appid, appid))
- return epai;
+ if (!e_util_strcmp(eai->appid, appid))
+ return eai;
}
return NULL;
}
E_API Eina_Bool
-e_appinfo_base_output_resolution_set(E_Appinfo *epai, int width, int height)
+e_appinfo_base_output_resolution_set(E_Appinfo *eai, int width, int height)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(epai, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eai, 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;
+ eai->base_output_width = width;
+ eai->base_output_height = height;
+ eai->base_output_available = EINA_TRUE;
- ELOGF("POL_APPINFO", "appinfo(%p) set base_output_resolution(%d, %d):(pid,%u)", NULL, epai, width, height, epai->pid);
+ ELOGF("POL_APPINFO", "appinfo(%p) set base_output_resolution(%d, %d):(pid,%u)", NULL, eai, width, height, eai->pid);
return EINA_TRUE;
}
};
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);
+EINTERN void e_appinfo_del(E_Appinfo *eai);
+EINTERN Eina_Bool e_appinfo_pid_set(E_Appinfo *eai, pid_t pid);
+EINTERN Eina_Bool e_appinfo_appid_set(E_Appinfo *eai, const char *appid);
+EINTERN void e_appinfo_ready_metadata(E_Appinfo *eai, pid_t pid);
+EINTERN Eina_Bool e_appinfo_base_output_resolution_get(E_Appinfo *eai, 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 Eina_Bool e_appinfo_base_output_resolution_set(E_Appinfo *eai, 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);
E_API Eina_Bool
e_client_base_output_resolution_update(E_Client *ec)
{
- E_Appinfo *epai = NULL;
+ E_Appinfo *eai = NULL;
int configured_width, configured_height;
int width, height;
goto use_configured;
}
- epai = e_appinfo_find_with_pid(ec->netwm.pid);
- if (!epai)
+ eai = e_appinfo_find_with_pid(ec->netwm.pid);
+ if (!eai)
{
ELOGF("POL_APPINFO", "NO APPINFO... USE configured_output_resolution(%d,%d) pid:%d", ec,
configured_width, configured_height, ec->netwm.pid);
goto use_configured;
}
- if (!e_appinfo_base_output_resolution_get(epai, &width, &height))
+ if (!e_appinfo_base_output_resolution_get(eai, &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);
{
E_Comp_Wl_Output *output;
struct wl_resource *resource;
- E_Appinfo *epai = NULL;
+ E_Appinfo *eai = NULL;
pid_t pid = 0;
int res_w, res_h;
goto send_info;
}
- epai = e_appinfo_find_with_pid(pid);
- if (!epai)
+ eai = e_appinfo_find_with_pid(pid);
+ if (!eai)
{
res_w = e_config->configured_output_resolution.w;
res_h = e_config->configured_output_resolution.h;
goto send_info;
}
- if (!e_appinfo_base_output_resolution_get(epai, &res_w, &res_h))
+ if (!e_appinfo_base_output_resolution_get(eai, &res_w, &res_h))
{
res_w = e_config->configured_output_resolution.w;
res_h = e_config->configured_output_resolution.h;
_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_Appinfo *appinfo;
+ E_Appinfo *eai;
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_appinfo_find_with_appid(appid)))
+ if (!(eai = e_appinfo_find_with_appid(appid)))
{
- appinfo = e_appinfo_new();
- e_appinfo_appid_set(appinfo, appid);
+ eai = e_appinfo_new();
+ e_appinfo_appid_set(eai, appid);
}
- EINA_SAFETY_ON_NULL_RETURN(appinfo);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- e_appinfo_pid_set(appinfo, pid);
+ e_appinfo_pid_set(eai, pid);
}
// --------------------------------------------------------
_tzlaunch_appinfo_iface_cb_register_pid(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
uint32_t pid)
{
- E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
- E_Appinfo *epai = NULL;
+ E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
+ E_Appinfo *eai = NULL;
- appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
- if (!appinfo)
+ tzlaunch_appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
+ if (!tzlaunch_appinfo)
{
wl_resource_post_error(res_tzlaunch_appinfo,
WL_DISPLAY_ERROR_INVALID_OBJECT,
return;
}
- epai = e_appinfo_new();
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ eai = e_appinfo_new();
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- if (!e_appinfo_pid_set(epai, pid))
+ if (!e_appinfo_pid_set(eai, pid))
{
ELOGF("TZ_APPINFO", "failed to set pid is invalid. pid:%u", NULL, pid);
- e_appinfo_del(epai);
+ e_appinfo_del(eai);
return;
}
}
_tzlaunch_appinfo_iface_cb_deregister_pid(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
uint32_t pid)
{
- E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
- E_Appinfo *epai = NULL;
+ E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
+ E_Appinfo *eai = NULL;
- appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
- if (!appinfo)
+ tzlaunch_appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
+ if (!tzlaunch_appinfo)
{
wl_resource_post_error(res_tzlaunch_appinfo,
WL_DISPLAY_ERROR_INVALID_OBJECT,
return;
}
- epai = e_appinfo_find_with_pid(pid);
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ eai = e_appinfo_find_with_pid(pid);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- e_appinfo_del(epai);
+ e_appinfo_del(eai);
}
static void
uint32_t pid, const char *appid)
{
E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
- E_Appinfo *epai = NULL;
+ E_Appinfo *eai = NULL;
int width = 0;
int height = 0;
return;
}
- epai = e_appinfo_find_with_pid(pid);
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ eai = e_appinfo_find_with_pid(pid);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- if (!e_appinfo_appid_set(epai, appid))
+ if (!e_appinfo_appid_set(eai, appid))
{
ELOGF("TZ_APPINFO", "failed to set appid, appid:%s", NULL, appid);
return;
// 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_appinfo_base_output_resolution_get(epai, &width, &height))
+ if (!e_appinfo_base_output_resolution_get(eai, &width, &height))
{
ELOGF("TZ_APPINFO", "failed to set base_output_resolution in module, pid:%u, appid:%s", NULL, pid, appid);
return;
_tzlaunch_appinfo_iface_cb_get_base_output_resolution(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
uint32_t pid)
{
- E_Appinfo *epai = NULL;
+ E_Appinfo *eai = NULL;
int width = 0, height = 0;
if (pid <= 0)
goto err;
}
- epai = e_appinfo_find_with_pid(pid);
- if (!epai)
+ eai = e_appinfo_find_with_pid(pid);
+ if (!eai)
{
ELOGF("TZ_APPINFO", "cannot find pid. pid:%u", NULL, pid);
goto err;
}
- if (!e_appinfo_base_output_resolution_get(epai, &width, &height))
+ if (!e_appinfo_base_output_resolution_get(eai, &width, &height))
{
ELOGF("TZ_APPINFO", "cannot read size. pid:%u", NULL, pid);
goto err;
_tzlaunch_appinfo_iface_cb_register_appid(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
const char *appid)
{
- E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
- E_Appinfo *epai = NULL;
+ E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
+ E_Appinfo *eai = NULL;
- appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
- if (!appinfo)
+ tzlaunch_appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
+ if (!tzlaunch_appinfo)
{
wl_resource_post_error(res_tzlaunch_appinfo,
WL_DISPLAY_ERROR_INVALID_OBJECT,
return;
}
- if ((epai = e_appinfo_find_with_appid(appid)))
+ if ((eai = e_appinfo_find_with_appid(appid)))
{
ELOGF("TZ_APPINFO", "appid:%s is already registered!", NULL, appid);
return;
}
- epai = e_appinfo_new();
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ eai = e_appinfo_new();
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- if (!e_appinfo_appid_set(epai, appid))
+ if (!e_appinfo_appid_set(eai, appid))
{
ELOGF("TZ_APPINFO", "Failed to register appid:%s", NULL, appid);
- e_appinfo_del(epai);
+ e_appinfo_del(eai);
return;
}
}
_tzlaunch_appinfo_iface_cb_deregister_appid(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
const char *appid)
{
- E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
- E_Appinfo *epai = NULL;
+ E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
+ E_Appinfo *eai = NULL;
- appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
- if (!appinfo)
+ tzlaunch_appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
+ if (!tzlaunch_appinfo)
{
wl_resource_post_error(res_tzlaunch_appinfo,
WL_DISPLAY_ERROR_INVALID_OBJECT,
return;
}
- epai = e_appinfo_find_with_appid(appid);
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ eai = e_appinfo_find_with_appid(appid);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- e_appinfo_del(epai);
+ e_appinfo_del(eai);
}
static void
_tzlaunch_appinfo_iface_cb_set_pid(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
const char *appid, uint32_t pid)
{
- E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
- E_Appinfo *epai = NULL;
+ E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
+ E_Appinfo *eai = NULL;
- appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
- if (!appinfo)
+ tzlaunch_appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
+ if (!tzlaunch_appinfo)
{
wl_resource_post_error(res_tzlaunch_appinfo,
WL_DISPLAY_ERROR_INVALID_OBJECT,
return;
}
- epai = e_appinfo_find_with_appid(appid);
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ eai = e_appinfo_find_with_appid(appid);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- if (!e_appinfo_pid_set(epai, pid))
+ if (!e_appinfo_pid_set(eai, pid))
{
ELOGF("TZ_APPINFO", "Failed to set pid:%u for appid:%s", NULL, pid, appid);
return;
_tzlaunch_appinfo_iface_cb_ready_metadata(struct wl_client *client, struct wl_resource *res_tzlaunch_appinfo,
const char *appid, uint32_t pid)
{
- E_Policy_Wl_Tzlaunch_Appinfo *appinfo = NULL;
- E_Appinfo *epai = NULL;
+ E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
+ E_Appinfo *eai = NULL;
int width = 0, height = 0;
- appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
- if (!appinfo)
+ tzlaunch_appinfo = wl_resource_get_user_data(res_tzlaunch_appinfo);
+ if (!tzlaunch_appinfo)
{
wl_resource_post_error(res_tzlaunch_appinfo,
WL_DISPLAY_ERROR_INVALID_OBJECT,
return;
}
- epai = e_appinfo_find_with_appid(appid);
- EINA_SAFETY_ON_NULL_RETURN(epai);
+ eai = e_appinfo_find_with_appid(appid);
+ EINA_SAFETY_ON_NULL_RETURN(eai);
- e_appinfo_ready_metadata(epai, pid);
+ e_appinfo_ready_metadata(eai, pid);
/* about base output resolution */
if (e_config->configured_output_resolution.use)
// 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_appinfo_base_output_resolution_get(epai, &width, &height))
+ if (!e_appinfo_base_output_resolution_get(eai, &width, &height))
{
ELOGF("TZ_APPINFO", "failed to set base_output_resolution in module, pid:%u, appid:%s", NULL, pid, appid);
return;
static void
_tzlaunch_appinfo_cb_unbind(struct wl_resource *res_tzlaunch_appinfo)
{
- E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo= NULL;
+ E_Policy_Wl_Tzlaunch_Appinfo *tzlaunch_appinfo = NULL;
Eina_List *l, *ll;
EINA_LIST_FOREACH_SAFE(polwl->tzlaunch_appinfo, l, ll, tzlaunch_appinfo)