#include "e_policy_stack_intern.h"
#include "e_compositor_intern.h"
#include "e_canvas_intern.h"
+#include "e_tizen_launch_effect_intern.h"
+#include "e_server_intern.h"
#include <device/display.h>
#include <wayland-server.h>
TZSH_TYPE_CLIENT
} Tzsh_Type;
-typedef enum _Tzlaunch_Effect_Type
-{
- TZLAUNCH_EFFECT_TYPE_LAUNCH = 0,
- TZLAUNCH_EFFECT_TYPE_DEPTH_IN
-} Tzlaunch_Effect_Type;
-
typedef struct _E_Policy_Wl_Tzpol
{
struct wl_resource *res_tzpol; /* tizen_policy_interface */
int32_t brightness;
} E_Policy_Wl_Dpy_Surface;
-typedef struct _E_Policy_Wl_Tzlaunch_Effect
-{
- struct wl_resource *res_tzlaunch_effect; /* tizen_launch_effect */
- Eina_List *splash_list; /* list of E_Policy_Wl_Tzlaunch_Splash */
-} E_Policy_Wl_Tzlaunch_Effect;
-
-typedef struct _E_Policy_Wl_Tzlaunch_Splash
-{
- struct wl_resource *res_tzlaunch_splash; /* tizen_launch_image */
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect; /* launcher */
-
- const char *path; /* image resource path */
- uint32_t type; /* 0: image, 1: edc */
- uint32_t indicator; /* 0: off, 1: on */
- uint32_t angle; /* 0, 90, 180, 270 : rotation angle */
- uint32_t pid;
-
- Evas_Object *obj; /* launch screen image */
- E_Pixmap *ep; /* pixmap for launch screen client */
- E_Client *ec; /* client for launch screen image */
- Ecore_Timer *timeout; /* launch screen image hide timer */
- Evas_Object *indicator_obj; /* plug object of indicator */
-
- Eina_Bool valid; /* validation check */
- Eina_Bool replaced;
- E_Comp_Object_Content_Type content_type; /* type of content */
-
- Eina_Bool custom_effect_callee; /* custom effect enabled */
- const char *appid;
-} E_Policy_Wl_Tzlaunch_Splash;
-
-typedef struct _E_Policy_Wl_Tzlaunch_Effect_Info
-{
- uint32_t pid; /* pid */
- int effect_type; /* effect_type */
-} E_Policy_Wl_Tzlaunch_Effect_Info;
-
typedef struct _E_Policy_Wl_Tzlaunch_Appinfo
{
struct wl_resource *res_tzlaunch_appinfo; /* tizen_launch_appinfo */
} E_Policy_Wl_Tzlaunch_Appinfo;
-typedef enum _Launch_Img_File_type
-{
- LAUNCH_IMG_FILE_TYPE_ERROR = -1,
- LAUNCH_IMG_FILE_TYPE_IMAGE = 0,
- LAUNCH_IMG_FILE_TYPE_EDJ
-} Launch_Img_File_type;
-
typedef struct _E_Policy_Wl_Tz_Indicator
{
struct wl_resource *res_tz_indicator;
Eina_List *tz_indicators;
Eina_List *tz_clipboards; /* list of E_Policy_Wl_Tz_Clipboard */
- /* tizen_launch_effect_interface */
- Eina_List *tzlaunch_effect; /* list of E_Policy_Wl_Tzlaunch_Effect */
- Eina_List *tzlaunch_effect_info; /* list of E_Policy_Wl_Tzlaunch_Effect_Info */
/* tizen_launch_appinfo_interface */
Eina_List *tzlaunch_appinfo; /* list of E_Policy_Wl_Tzlaunch_Appinfo */
/* tizen_ws_shell_interface ver_2 */
static void _e_policy_wl_tzsh_client_del(E_Policy_Wl_Tzsh_Client *tzsh_client);
static void _e_policy_wl_background_state_set(E_Policy_Wl_Surface *psurf, Eina_Bool state);
-static void _e_policy_wl_tzlaunch_effect_type_sync(E_Client *ec);
-static int _e_policy_wl_tzlaunch_effect_type_get(const char* effect_type);
-static void _e_policy_wl_tzlaunch_effect_type_unset(uint32_t pid);
-
-static void _launch_effect_hide(uint32_t pid);
-static void _launch_effect_client_del(E_Client *ec);
-static void _launch_splash_off(E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash);
-
// --------------------------------------------------------
// E_Policy_Wl_Hook
// --------------------------------------------------------
cdata = e_client_cdata_get(ec);
if (cdata && cdata->mapped)
{
- _launch_effect_hide(ec->netwm.pid);
+ E_Tizen_Launch_Effect *tizen_launch_effect;
+
+ tizen_launch_effect = (E_Tizen_Launch_Effect *)e_server_feature_handle_get(E_SERVER_FEATURE_TIZEN_LAUNCH_EFFECT);
+ if (tizen_launch_effect)
+ e_tizen_launch_effect_hide(tizen_launch_effect, ec->netwm.pid);
}
ELOGF("POL_VIS",
}
}
-static void
-_e_policy_wl_tzlaunch_effect_type_sync(E_Client *ec)
-{
- Eina_List *l;
- E_Policy_Wl_Tzlaunch_Effect_Info *effect_info;
-
- EINA_SAFETY_ON_NULL_RETURN(ec);
-
- EINA_LIST_FOREACH(polwl->tzlaunch_effect_info, l, effect_info)
- {
- if (effect_info->pid == ec->netwm.pid)
- {
- ELOGF("TZPOL",
- "Launchscreen effect type sync | pid (%d) effect_type (%d)",
- ec, ec->netwm.pid, effect_info->effect_type);
- ec->effect_type = effect_info->effect_type;
- _e_policy_wl_tzlaunch_effect_type_unset(ec->netwm.pid);
- break;
- }
- }
-}
-
-static int
-_e_policy_wl_tzlaunch_effect_type_get(const char * effect_type)
-{
- Tzlaunch_Effect_Type type = TZLAUNCH_EFFECT_TYPE_LAUNCH;
-
- if (!e_util_strcmp(effect_type, "launch" )) type = TZLAUNCH_EFFECT_TYPE_LAUNCH;
- else if (!e_util_strcmp(effect_type, "depth-in" )) type = TZLAUNCH_EFFECT_TYPE_DEPTH_IN;
-
- return type;
-}
-
-static void
-_e_policy_wl_tzlaunch_effect_type_unset(uint32_t pid)
-{
- Eina_List *l;
- E_Policy_Wl_Tzlaunch_Effect_Info *effect_info;
-
- EINA_LIST_FOREACH(polwl->tzlaunch_effect_info, l, effect_info)
- {
- if (effect_info->pid == pid)
- {
- ELOGF("TZPOL",
- "Launchscreen effect type unset | pid (%d)",
- NULL, pid);
- polwl->tzlaunch_effect_info = eina_list_remove(polwl->tzlaunch_effect_info, effect_info);
- memset(effect_info, 0x0, sizeof(E_Policy_Wl_Tzlaunch_Effect_Info));
- E_FREE(effect_info);
- break;
- }
- }
-}
-
static void
_e_policy_wl_tzpol_background_state_set(E_Policy_Wl_Tzpol *tzpol, Eina_Bool bg_state, pid_t pid)
{
wl_client_post_no_memory(client);
}
-// --------------------------------------------------------
-// tizen_launch_effect_interface
-// --------------------------------------------------------
-#define SPLASH_GROUP_NAME "effect"
-#define SPLASH_CONFIG_CUSTOM_EFFECT_CALLEE "_CUSTOM_EFFECT_CALLEE_"
-
-static void
-_launch_effect_hide(uint32_t pid)
-{
- Eina_List *l, *ll;
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect;
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
-
- if(pid <= 0) return;
-
- EINA_LIST_FOREACH(polwl->tzlaunch_effect, l, tzlaunch_effect)
- {
- EINA_LIST_FOREACH(tzlaunch_effect->splash_list, ll, tzlaunch_splash)
- if (tzlaunch_splash->pid == pid)
- {
- _launch_splash_off(tzlaunch_splash);
- }
- }
-}
-
-static void
-_launch_effect_client_del(E_Client *ec)
-{
- Eina_List *l, *ll;
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect;
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
-
- EINA_LIST_FOREACH(polwl->tzlaunch_effect, l, tzlaunch_effect)
- {
- EINA_LIST_FOREACH(tzlaunch_effect->splash_list, ll, tzlaunch_splash)
- if (tzlaunch_splash->ec == ec)
- {
- _launch_splash_off(tzlaunch_splash);
- }
- }
-}
-
-static void
-_launchscreen_splash_cb_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash = data;
-
- if ((tzlaunch_splash) && (tzlaunch_splash->obj == obj))
- tzlaunch_splash->obj = NULL;
-}
-
-static void
-_launchscreen_splash_cb_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash = data;
-
- if ((tzlaunch_splash) && (tzlaunch_splash->obj == obj))
- _launch_splash_off(tzlaunch_splash);
-}
-
-static void
-_launch_splash_off(E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash)
-{
- E_Client *ec = NULL;
- Evas_Object *obj = NULL;
-
- if (!tzlaunch_splash->valid) return;
- if (!tzlaunch_splash->ec) return;
-
- ec = tzlaunch_splash->ec;
- obj = tzlaunch_splash->obj;
-
- tzlaunch_splash->obj = NULL;
- tzlaunch_splash->ec = NULL;
- tzlaunch_splash->valid = EINA_FALSE;
- if (tzlaunch_splash->timeout) ecore_timer_del(tzlaunch_splash->timeout);
- tzlaunch_splash->timeout = NULL;
-
- eina_stringshare_del(tzlaunch_splash->appid);
- tzlaunch_splash->appid = NULL;
- eina_stringshare_del(tzlaunch_splash->path);
- tzlaunch_splash->path = NULL;
-
-
- ELOGF("TZPOL",
- "Launchscreen hide | pid %d, replaced:%d, tzlaunch_pixmap:%p, ec_pixmap:%p",
- ec, tzlaunch_splash->pid, tzlaunch_splash->replaced, tzlaunch_splash->ep, ec->pixmap);
-
- if (tzlaunch_splash->indicator_obj)
- {
- e_comp_object_indicator_unswallow(ec->frame, tzlaunch_splash->indicator_obj);
- evas_object_del(tzlaunch_splash->indicator_obj);
- evas_object_unref(tzlaunch_splash->indicator_obj);
- tzlaunch_splash->indicator_obj = NULL;
- }
-
- if ((ec->pixmap) &&
- (ec->pixmap == tzlaunch_splash->ep))
- {
- /* case 1: Surface for this pid is not created until timeout or
- * launchscreen resource is destroied.
- */
- if (ec->visible)
- {
- ec->visible = EINA_FALSE;
- e_view_client_hide(e_client_view_get(ec));
- ec->ignored = EINA_TRUE;
- }
-
- e_comp_launchscrn_ec_remove(ec);
-
- e_pixmap_win_id_del(tzlaunch_splash->ep);
- e_object_del(E_OBJECT(ec));
- ec = NULL;
- }
-
- if (ec)
- {
- if (!e_util_strcmp("wl_pointer-cursor", ec->icccm.window_role))
- {
- // if Launchscreen is replaced to cursor, than hide
- e_comp_object_content_unset(ec->frame);
- ec->visible = EINA_FALSE;
- e_view_client_hide(e_client_view_get(ec));
- ec->ignored = EINA_TRUE;
- }
- else if (!tzlaunch_splash->replaced)
- {
- if (ec->focused)
- e_comp_wl_feed_focus_in(ec);
-
- /* to send launch,done event to launchscreen client */
- if (!e_object_is_del(E_OBJECT(ec)))
- {
- if (ec->first_mapped)
- {
- ELOGF("LAUNCH", "SHOW real win by replaced splash ec", ec);
- e_view_client_signal_emit(e_client_view_get(ec), "e,action,launch_real,done", "e");
- }
- e_view_client_signal_emit(e_client_view_get(ec), "e,action,launch,done", "e");
- }
- }
-
- e_comp_launchscrn_ec_remove(ec);
- }
-
- if (obj)
- evas_object_unref(obj);
-
- tzlaunch_splash->ep = NULL;
- tzlaunch_splash->replaced = EINA_FALSE;
-}
-
-static Eina_Bool
-_launchscreen_splash_timeout(void *data)
-{
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
- tzlaunch_splash = (E_Policy_Wl_Tzlaunch_Splash *)data;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(tzlaunch_splash, 0);
-
- _launch_splash_off(tzlaunch_splash);
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-static Eina_Bool
-_launchscreen_splash_setup(E_Policy_Wl_Tzlaunch_Splash *splash,
- const char *pfname, uint32_t ftype,
- uint32_t depth, uint32_t angle,
- uint32_t indicator, const char *effect_type,
- const char *theme_type, struct wl_array *options,
- struct wl_array *extra_config)
-{
- E_Client *ec = NULL;
- E_Comp_Object_Content_Type content_type = 0;
- Eina_Bool intercepted = EINA_FALSE;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(splash->ec, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(e_client_view_get(splash->ec), EINA_FALSE);
-
- ec = splash->ec;
- ec->effect_type = _e_policy_wl_tzlaunch_effect_type_get(effect_type);
-
- ELOGF("TZPOL",
- "Launchscreen setup START| path %s(%d), indicator(%d), angle(%d), effect_type(%s), theme_type(%s)",
- ec, pfname, ftype, indicator, angle, effect_type, theme_type);
- ELOGF("TZPOL",
- "Launchscreen setup | options %p extra_config:%p",
- ec, options, extra_config);
-
- splash->path = eina_stringshare_add(pfname);
- splash->type = ftype;
- splash->indicator = indicator;
- splash->indicator_obj = NULL;
- splash->angle = angle;
-
- if (indicator)
- ELOGF("TZPOL", "Launchscreen setup | INDICATOR of the splash screen has benn deprecated. please check!", NULL);
-
- intercepted = e_policy_interceptor_call(E_POLICY_INTERCEPT_LAUNCHSCREEN_OBJECT_SETUP,
- ec,
- pfname, ftype, depth,
- angle, indicator, options);
- if (intercepted)
- {
- splash->obj = e_comp_object_content_get(ec->frame);
-
- ELOGF("TZPOL",
- "Launchscreen setup | was INTERCEPTED : content(%p)",
- ec, splash->obj);
- }
- else //Do original setup process
- {
- int comp_w = 0, comp_h = 0;
- if (splash->type == LAUNCH_IMG_FILE_TYPE_IMAGE)
- {
- Evas_Load_Error err;
-
- content_type = E_COMP_OBJECT_CONTENT_TYPE_EXT_IMAGE;
- splash->obj = evas_object_image_add(e_comp_evas_get());
- EINA_SAFETY_ON_NULL_RETURN_VAL(splash->obj, EINA_FALSE);
-
- evas_object_image_file_set(splash->obj, splash->path, NULL);
-
- err = evas_object_image_load_error_get(splash->obj);
- if (err != EVAS_LOAD_ERROR_NONE)
- {
- ELOGF("TZPOL",
- "Launchscreen setup | fail to load image %s : %s",
- ec, splash->path, evas_load_error_str(err));
- evas_object_del(splash->obj);
- splash->obj = NULL;
- return EINA_FALSE;
- }
-
- e_comp_size_get(&comp_w, &comp_h);
- evas_object_image_fill_set(splash->obj, 0, 0, comp_w, comp_h);
- evas_object_image_filled_set(splash->obj, EINA_TRUE);
- }
- else
- {
- content_type = E_COMP_OBJECT_CONTENT_TYPE_EXT_EDJE;
- splash->obj = edje_object_add(e_comp_evas_get());
- EINA_SAFETY_ON_NULL_RETURN_VAL(splash->obj, EINA_FALSE);
-
- if (!edje_object_file_set(splash->obj, splash->path, SPLASH_GROUP_NAME))
- {
- Edje_Load_Error err;
-
- err = edje_object_load_error_get(splash->obj);
- ELOGF("TZPOL",
- "Launchscreen setup | fail to load edje %s : %s",
- ec, splash->path, edje_load_error_str(err));
- evas_object_del(splash->obj);
- splash->obj = NULL;
- return EINA_FALSE;
-
- }
-
- evas_object_move(splash->obj, 0, 0);
- e_comp_size_get(&comp_w, &comp_h);
- evas_object_resize(splash->obj, comp_w, comp_h);
- }
-
- if (depth == 32) ec->argb = EINA_TRUE;
- else ec->argb = EINA_FALSE;
- ELOGF("COMP", "Set argb:%d", ec, ec->argb);
-
- //set splash->obj to a content of ec->frame
- if (!e_comp_object_content_set(ec->frame, splash->obj, content_type))
- {
- ERR("Launchscreen setup | setting comp object content failed ec(%p) obj(%p)",
- ec, splash->obj);
- return EINA_FALSE;
- }
- }
-
-
- /* Post job of setup content_type */
-
- //Parse extra config
- if ((extra_config) && (extra_config->size))
- {
- char *p_char;
- int len = 0;
- int size = extra_config->size;
-
- while (size > 0)
- {
- p_char = extra_config->data + len;
- len = strlen(p_char) + 1;
- size -= len;
-
- if (!e_util_strcmp(p_char, SPLASH_CONFIG_CUSTOM_EFFECT_CALLEE))
- {
- //parse next data(appid) from array
- if (size > 0)
- {
- p_char = p_char + len;
- len = strlen(p_char) + 1;
- size -= len;
-
- splash->appid = eina_stringshare_add(p_char);
- splash->custom_effect_callee = EINA_TRUE;
-
- ELOGF("TZPOL",
- "Launchscreen setup | custom effect callee set appid(%s)",
- ec, splash->appid);
- }
- else break;
- }
- }
- }
-
- //ref splash object
- if (splash->obj)
- {
- evas_object_ref(splash->obj);
-
- evas_object_event_callback_add(splash->obj,
- EVAS_CALLBACK_DEL,
- _launchscreen_splash_cb_del, splash);
- evas_object_event_callback_add(splash->obj,
- EVAS_CALLBACK_HIDE,
- _launchscreen_splash_cb_hide, splash);
- }
-
- splash->valid = EINA_TRUE;
- splash->content_type = e_comp_object_content_type_get(ec->frame);
-
- return EINA_TRUE;
-}
-
-static void
-_tzlaunch_splash_iface_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzlaunch_splash)
-{
- wl_resource_destroy(res_tzlaunch_splash);
-}
-
-static void
-_tzlaunch_splash_iface_cb_launch(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzlaunch_splash,
- const char *pfname, uint32_t ftype,
- uint32_t depth, uint32_t angle,
- uint32_t indicator, const char *effect_type,
- const char *theme_type, struct wl_array *options)
-{
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
- Eina_Bool res = EINA_FALSE;
-
- tzlaunch_splash = wl_resource_get_user_data(res_tzlaunch_splash);
- EINA_SAFETY_ON_NULL_RETURN(tzlaunch_splash);
-
- ELOGF("TZPOL","Launchscreen launch | START", NULL);
-
-
- res = _launchscreen_splash_setup(tzlaunch_splash,
- pfname, ftype,
- depth, angle,
- indicator, effect_type,
- theme_type, options, NULL);
-
- ELOGF("TZPOL","Launchscreen launch | END res:%d ", NULL, res);
-
- if (!res)
- {
- ERR("Launchscreen launch | Could not complete %s", __FUNCTION__);
- if (tzlaunch_splash->obj)
- {
- evas_object_del(tzlaunch_splash->obj);
- tzlaunch_splash->obj = NULL;
- }
- }
-}
-
-static void
-_tzlaunch_splash_iface_cb_owner(struct wl_client *client EINA_UNUSED, struct wl_resource *res_tzlaunch_splash, uint32_t pid)
-{
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
- E_Client *pre_ec = NULL, *new_ec = NULL, *old_ec;
- Eina_List *clients, *l;
- int tw, th;
- int comp_w = 0, comp_h = 0;
- E_Comp *comp = e_comp_get();
-
- tzlaunch_splash = wl_resource_get_user_data(res_tzlaunch_splash);
- EINA_SAFETY_ON_NULL_RETURN(tzlaunch_splash);
- EINA_SAFETY_ON_FALSE_RETURN(tzlaunch_splash->valid);
-
- /* use ec was already created */
- e_comp_size_get(&comp_w, &comp_h);
- clients = _e_policy_wl_e_clients_find_by_pid(pid);
- EINA_LIST_FOREACH(clients, l, pre_ec)
- {
- if (pre_ec == tzlaunch_splash->ec) continue;
- if (!pre_ec->ignored) continue;
- if (pre_ec->is_cursor) continue;
- new_ec = pre_ec;
- e_client_geometry_get(new_ec, NULL, NULL, &tw, &th);
- if (tw <= 1 || th <= 1)
- e_view_client_size_set(e_client_view_get(new_ec), comp_w, comp_h);
- break;
- }
- eina_list_free(clients);
-
- old_ec = tzlaunch_splash->ec;
- if (new_ec)
- {
- if (e_comp_object_content_set(new_ec->frame,
- tzlaunch_splash->obj,
- tzlaunch_splash->content_type))
- {
- e_client_unignore(new_ec);
- new_ec->visible = EINA_TRUE;
- if (new_ec->new_client)
- comp->new_clients--;
- new_ec->new_client = EINA_FALSE;
- new_ec->argb = old_ec->argb;
- ELOGF("COMP", "Set argb:%d", new_ec, new_ec->argb);
- new_ec->effect_type = old_ec->effect_type;
- new_ec->use_splash = EINA_TRUE;
- e_client_icccm_title_set(new_ec, "launchscreen");
-
- e_comp_launchscrn_ec_add(new_ec);
-
- if (tzlaunch_splash->custom_effect_callee)
- {
- e_service_launcher_callee_register(new_ec, tzlaunch_splash->appid, tzlaunch_splash->path, SPLASH_GROUP_NAME);
- }
-
- e_view_client_show(e_client_view_get(new_ec));
- e_client_raise(new_ec);
-
- tzlaunch_splash->ec = new_ec;
- tzlaunch_splash->replaced = EINA_TRUE;
-
- ELOGF("TZPOL",
- "Launchscreen client changed | old(%p) new(%p) using obj(%p)",
- new_ec,
- old_ec, new_ec, tzlaunch_splash->obj);
-
- if (tzlaunch_splash->indicator_obj)
- {
- e_mod_indicator_owner_set(new_ec);
- e_tzsh_indicator_srv_property_update(new_ec);
- e_comp_object_indicator_unswallow(old_ec->frame, tzlaunch_splash->indicator_obj);
- e_comp_object_indicator_swallow(new_ec->frame, tzlaunch_splash->indicator_obj);
- }
-
- /* delete ec was created for launchscreen */
- e_comp_launchscrn_ec_remove(old_ec);
-
- e_pixmap_win_id_del(tzlaunch_splash->ep);
- e_object_del(E_OBJECT(old_ec));
- tzlaunch_splash->ep = NULL;
- }
- else
- ERR("Can't set external content for new_ec(%p)", new_ec);
- }
- else
- {
- old_ec->ignored = EINA_FALSE;
- old_ec->visible = EINA_TRUE;
- if (old_ec->new_client)
- comp->new_clients--;
- old_ec->new_client = EINA_FALSE;
- old_ec->icccm.accepts_focus = EINA_TRUE;
-
- if (tzlaunch_splash->custom_effect_callee)
- {
- e_service_launcher_callee_register(old_ec, tzlaunch_splash->appid, tzlaunch_splash->path, SPLASH_GROUP_NAME);
- }
-
- e_view_client_show(e_client_view_get(old_ec));
- e_client_raise(old_ec);
- }
-
- EC_CHANGED(tzlaunch_splash->ec);
- e_comp_visibility_calculation_set(EINA_TRUE);
-
- if (tzlaunch_splash->timeout)
- {
- ecore_timer_del(tzlaunch_splash->timeout);
- tzlaunch_splash->timeout = NULL;
- }
- if (!e_config->launchscreen_without_timer)
- tzlaunch_splash->timeout = ecore_timer_add(e_config->launchscreen_timeout, _launchscreen_splash_timeout, tzlaunch_splash);
-
- ELOGF("TZPOL", "Launchscreen img(%d) set owner pid: %d",
- tzlaunch_splash->ec,
- wl_resource_get_id(res_tzlaunch_splash), pid);
-
- tzlaunch_splash->pid = pid;
- tzlaunch_splash->ec->netwm.pid = pid;
- tzlaunch_splash->ec->use_splash = EINA_TRUE;
-}
-
-static void
-_tzlaunch_splash_iface_cb_launch_v2(struct wl_client *client EINA_UNUSED,
- struct wl_resource *res_tzlaunch_splash,
- const char *pfname, uint32_t ftype,
- uint32_t depth, uint32_t angle,
- uint32_t indicator, const char *effect_type,
- const char *theme_type, struct wl_array *options,
- struct wl_array *extra_config)
-{
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
- Eina_Bool res = EINA_FALSE;
-
- tzlaunch_splash = wl_resource_get_user_data(res_tzlaunch_splash);
- EINA_SAFETY_ON_NULL_RETURN(tzlaunch_splash);
-
- ELOGF("TZPOL","Launchscreen launch_v2 | START", NULL);
-
- res = _launchscreen_splash_setup(tzlaunch_splash,
- pfname, ftype,
- depth, angle,
- indicator, effect_type,
- theme_type, options, extra_config);
-
- ELOGF("TZPOL","Launchscreen launch_v2 | END res:%d ", NULL, res);
-
- if (!res)
- {
- ERR("Launchscreen launch_v2 | Could not complete %s", __FUNCTION__);
- if (tzlaunch_splash->obj)
- {
- evas_object_del(tzlaunch_splash->obj);
- tzlaunch_splash->obj = NULL;
- }
- }
-
-}
-
-static const struct tizen_launch_splash_interface _tzlaunch_splash_iface =
-{
- _tzlaunch_splash_iface_cb_destroy,
- _tzlaunch_splash_iface_cb_launch,
- _tzlaunch_splash_iface_cb_owner,
- _tzlaunch_splash_iface_cb_launch_v2,
-};
-
-static E_Policy_Wl_Tzlaunch_Splash *
-_tzlaunch_splash_add(struct wl_resource *res_tzlaunch_effect, struct wl_resource *res_tzlaunch_splash)
-{
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect;
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
-
- tzlaunch_splash = E_NEW(E_Policy_Wl_Tzlaunch_Splash, 1);
- EINA_SAFETY_ON_NULL_GOTO(tzlaunch_splash, error);
-
- tzlaunch_effect = wl_resource_get_user_data(res_tzlaunch_effect);
- EINA_SAFETY_ON_NULL_GOTO(tzlaunch_effect, error);
-
- tzlaunch_effect->splash_list = eina_list_append(tzlaunch_effect->splash_list, tzlaunch_splash);
-
- tzlaunch_splash->tzlaunch_effect = tzlaunch_effect;
- tzlaunch_splash->res_tzlaunch_splash = res_tzlaunch_splash;
-
- tzlaunch_splash->replaced = EINA_FALSE;
- tzlaunch_splash->ep = e_pixmap_new(E_PIXMAP_TYPE_EXT_OBJECT, 0);
- EINA_SAFETY_ON_NULL_GOTO(tzlaunch_splash->ep, error);
- tzlaunch_splash->ec = e_client_new(tzlaunch_splash->ep, 0, 1);
- EINA_SAFETY_ON_NULL_GOTO(tzlaunch_splash->ec, error);
-
- e_client_icccm_title_set(tzlaunch_splash->ec, "Launchscreen");
- e_client_icccm_name_set(tzlaunch_splash->ec, "Launchscreen");
- tzlaunch_splash->ec->ignored = EINA_TRUE;
-
- e_comp_launchscrn_ec_add(tzlaunch_splash->ec);
-
- return tzlaunch_splash;
-error:
- if (tzlaunch_splash)
- {
- ERR("Could not initialize launchscreen client");
- if (tzlaunch_splash->ep)
- e_pixmap_win_id_del(tzlaunch_splash->ep);
- if (tzlaunch_splash->ec)
- e_object_del(E_OBJECT(tzlaunch_splash->ec));
- E_FREE(tzlaunch_splash);
- }
- return NULL;
-}
-
-
-static void
-_tzlaunch_splash_destroy(struct wl_resource *res_tzlaunch_splash)
-{
- E_Policy_Wl_Tzlaunch_Splash *tzlaunch_splash;
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect;
-
- EINA_SAFETY_ON_NULL_RETURN(res_tzlaunch_splash);
-
- tzlaunch_splash = wl_resource_get_user_data(res_tzlaunch_splash);
- EINA_SAFETY_ON_NULL_RETURN(tzlaunch_splash);
-
- if (tzlaunch_splash->obj)
- {
- evas_object_event_callback_del_full(tzlaunch_splash->obj, EVAS_CALLBACK_DEL, _launchscreen_splash_cb_del, tzlaunch_splash);
- evas_object_event_callback_del_full(tzlaunch_splash->obj, EVAS_CALLBACK_HIDE, _launchscreen_splash_cb_hide, tzlaunch_splash);
- }
-
- _launch_splash_off(tzlaunch_splash);
-
- tzlaunch_effect = tzlaunch_splash->tzlaunch_effect;
- tzlaunch_effect->splash_list = eina_list_remove(tzlaunch_effect->splash_list, tzlaunch_splash);
-
- eina_stringshare_del(tzlaunch_splash->appid);
- eina_stringshare_del(tzlaunch_splash->path);
- memset(tzlaunch_splash, 0x0, sizeof(E_Policy_Wl_Tzlaunch_Splash));
- E_FREE(tzlaunch_splash);
-}
-
-static void
-_tzlaunch_effect_iface_cb_create_splash_img(struct wl_client *client, struct wl_resource *res_tzlaunch_effect, uint32_t id)
-{
-
- E_Policy_Wl_Tzlaunch_Splash *plaunch_splash;
- struct wl_resource *res_tzlaunch_splash;
-
- res_tzlaunch_splash = wl_resource_create(client,
- &tizen_launch_splash_interface,
- wl_resource_get_version(res_tzlaunch_effect),
- id);
- if (!res_tzlaunch_splash)
- {
- wl_resource_post_error
- (res_tzlaunch_effect,
- WL_DISPLAY_ERROR_INVALID_OBJECT,
- "Invalid res_tzlaunch effect's user data");
- return;
- }
-
- plaunch_splash = _tzlaunch_splash_add(res_tzlaunch_effect, res_tzlaunch_splash);
- EINA_SAFETY_ON_NULL_GOTO(plaunch_splash, err);
-
- ELOGF("TZPOL", "Launchscreen effect create splash img. res_tzlaunch_effect:%p, res_tzlaunch_splash:%p", plaunch_splash->ec, res_tzlaunch_effect, res_tzlaunch_splash);
-
- wl_resource_set_implementation(res_tzlaunch_splash,
- &_tzlaunch_splash_iface,
- plaunch_splash,
- _tzlaunch_splash_destroy);
-
- return;
-
-err:
- ERR("Could not create tizen_launch_splash_interface res: %m");
- wl_client_post_no_memory(client);
-}
-
-static void
-_tzlaunch_effect_iface_cb_type_set(struct wl_client *client, struct wl_resource *res_tzlaunch_effect,
- const char *effect_type, uint32_t pid, struct wl_array *options)
-{
- Eina_List *clients, *l;
- E_Client *_ec = NULL;
- int effect_set = 0;
- int tzlaunch_effect_type = _e_policy_wl_tzlaunch_effect_type_get(effect_type);
-
- clients = _e_policy_wl_e_clients_find_by_pid(pid);
- EINA_LIST_FOREACH(clients, l, _ec)
- {
- if (_ec)
- {
- _ec->effect_type = tzlaunch_effect_type;
- effect_set = 1;
- ELOGF("TZPOL",
- "Launchscreen effect type set | exist ec | effect (%d) pid (%d)",
- _ec, tzlaunch_effect_type, pid);
- }
- }
- eina_list_free(clients);
-
- if (effect_set)
- _e_policy_wl_tzlaunch_effect_type_unset(pid);
- else
- {
- E_Policy_Wl_Tzlaunch_Effect_Info *tzlaunch_effect_info;
-
- tzlaunch_effect_info = E_NEW(E_Policy_Wl_Tzlaunch_Effect_Info, 1);
- EINA_SAFETY_ON_NULL_RETURN(tzlaunch_effect_info);
- tzlaunch_effect_info->pid = pid;
- tzlaunch_effect_info->effect_type = tzlaunch_effect_type;
- polwl->tzlaunch_effect_info = eina_list_append(polwl->tzlaunch_effect_info, tzlaunch_effect_info);
-
- ELOGF("TZPOL",
- "Launchscreen effect type set | no match ec | effect (%d) pid (%d)",
- NULL, tzlaunch_effect_type, pid);
- }
-}
-
-static void
-_tzlaunch_effect_iface_cb_type_unset(struct wl_client *client, struct wl_resource *res_tzlaunch_effect,
- uint32_t pid)
-{
- _e_policy_wl_tzlaunch_effect_type_unset(pid);
-}
-
-static void
-_tzlaunch_effect_iface_cb_destroy(struct wl_client *client, struct wl_resource *resource)
-{
- wl_resource_destroy(resource);
-}
-
-static const struct tizen_launch_effect_interface _tzlaunch_effect_iface =
-{
- _tzlaunch_effect_iface_cb_create_splash_img,
- _tzlaunch_effect_iface_cb_type_set,
- _tzlaunch_effect_iface_cb_type_unset,
- _tzlaunch_effect_iface_cb_destroy,
-};
-
-static void
-_tzlaunch_effect_del(E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect)
-{
- E_Policy_Wl_Tzlaunch_Splash *plaunch_splash;
- Eina_List *l, *ll;
-
- EINA_SAFETY_ON_NULL_RETURN(tzlaunch_effect);
-
- // remove tzlaunch created splash list
- EINA_LIST_FOREACH_SAFE(tzlaunch_effect->splash_list, l, ll, plaunch_splash)
- {
- if (plaunch_splash->tzlaunch_effect != tzlaunch_effect) continue;
- wl_resource_destroy(plaunch_splash->res_tzlaunch_splash);
- break;
- }
-
- polwl->tzlaunch_effect = eina_list_remove(polwl->tzlaunch_effect, tzlaunch_effect);
-
- memset(tzlaunch_effect, 0x0, sizeof(E_Policy_Wl_Tzlaunch_Effect));
- E_FREE(tzlaunch_effect);
-}
-
-static E_Policy_Wl_Tzlaunch_Effect *
-_tzlaunch_effect_add(struct wl_resource *res_tzlaunch_effect)
-{
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect;
-
- tzlaunch_effect = E_NEW(E_Policy_Wl_Tzlaunch_Effect, 1);
- EINA_SAFETY_ON_NULL_RETURN_VAL(tzlaunch_effect, NULL);
-
- tzlaunch_effect->res_tzlaunch_effect = res_tzlaunch_effect;
-
- polwl->tzlaunch_effect = eina_list_append(polwl->tzlaunch_effect, tzlaunch_effect);
-
- return tzlaunch_effect;
-}
-
-static void
-_tzlaunch_effect_cb_unbind(struct wl_resource *res_tzlaunch_effect)
-{
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect = NULL;
- Eina_List *l, *ll;
-
- EINA_LIST_FOREACH_SAFE(polwl->tzlaunch_effect, l, ll, tzlaunch_effect)
- {
- if (tzlaunch_effect->res_tzlaunch_effect != res_tzlaunch_effect) continue;
- _tzlaunch_effect_del(tzlaunch_effect);
- break;
- }
-}
-
-static void
-_tzlaunch_effect_cb_bind(struct wl_client *client, void *data EINA_UNUSED, uint32_t ver, uint32_t id)
-{
- E_Policy_Wl_Tzlaunch_Effect *tzlaunch_effect = NULL;
- struct wl_resource *res_tzlaunch_effect;
-
- EINA_SAFETY_ON_NULL_GOTO(polwl, err);
-
- res_tzlaunch_effect = wl_resource_create(client,
- &tizen_launch_effect_interface,
- ver,
- id);
- EINA_SAFETY_ON_NULL_GOTO(res_tzlaunch_effect, err);
-
- tzlaunch_effect = _tzlaunch_effect_add(res_tzlaunch_effect);
- EINA_SAFETY_ON_NULL_GOTO(tzlaunch_effect, err);
-
- wl_resource_set_implementation(res_tzlaunch_effect,
- &_tzlaunch_effect_iface,
- tzlaunch_effect,
- _tzlaunch_effect_cb_unbind);
-
- return;
-
-err:
- ERR("Could not create tizen_launch_effect_interface res: %m");
- wl_client_post_no_memory(client);
-}
-
// --------------------------------------------------------
// tizen_launch_appinfo_interface
// --------------------------------------------------------
if (!ec->pixmap) return;
_e_policy_wl_surf_client_set(ec);
- _e_policy_wl_tzlaunch_effect_type_sync(ec);
}
EINTERN void
_e_policy_wl_dpy_surf_del(ec);
_e_policy_wl_tz_indicator_unset_client(ec);
_e_policy_wl_tz_clipboard_unset_client(ec);
- _launch_effect_client_del(ec);
polwl->pending_vis = eina_list_remove(polwl->pending_vis, ec);
}
EINA_SAFETY_ON_NULL_GOTO(polwl, err);
comp_wl = e_comp_wl_get();
- if (!e_config->global_object_not_provide.launch_effect)
- {
- global = wl_global_create(comp_wl->wl.disp,
- &tizen_launch_effect_interface,
- 1,
- NULL,
- _tzlaunch_effect_cb_bind);
- EINA_SAFETY_ON_NULL_GOTO(global, err);
-
- polwl->globals = eina_list_append(polwl->globals, global);
- }
global = wl_global_create(comp_wl->wl.disp,
&tizen_launch_appinfo_interface,
E_Policy_Wl_Tzsh *tzsh;
E_Policy_Wl_Tzsh_Srv *tzsh_srv;
E_Policy_Wl_Tzsh_Extension *tzsh_extension;
- E_Policy_Wl_Tzlaunch_Effect_Info *effect_info;
E_Policy_Wl_Tz_Dpy_Pol *tz_dpy_pol;
E_Policy_Wl_Tz_Indicator *tz_indicator;
struct wl_global *global;
wl_resource_destroy(tz_dpy_pol->res_tz_dpy_pol);
}
- EINA_LIST_FREE(polwl->tzlaunch_effect_info, effect_info)
- {
- E_FREE(effect_info);
- }
-
EINA_LIST_FREE(polwl->tz_indicators, tz_indicator)
{
eina_list_free(tz_indicator->ec_list);