e_comp: add E_Launch_Screen 64/59364/4
authorJu Yeon Lee <juyeonne.lee@samsung.com>
Mon, 15 Feb 2016 05:45:02 +0000 (14:45 +0900)
committerJu Yeon Lee <juyeonne.lee@samsung.com>
Tue, 16 Feb 2016 10:54:58 +0000 (19:54 +0900)
Change-Id: I4170fa7a90c94a00a923dfea3580b11f32adb85e

src/bin/e_comp.c
src/bin/e_comp.h
src/bin/e_comp_cfdata.c
src/bin/e_comp_cfdata.h

index 0c76f2de3c44ab23b2fbc553514d87de019d36dd..82bb8b9f065794beaa0d4d7a8bc63ba2cc264717 100644 (file)
@@ -34,6 +34,8 @@ static E_Config_DD *conf_match_edd = NULL;
 static Ecore_Timer *action_timeout = NULL;
 static Eina_Bool gl_avail = EINA_FALSE;
 
+E_Launch_Screen *launch_scrn = NULL;
+
 static double ecore_frametime = 0;
 
 static int _e_comp_log_dom = -1;
@@ -1030,6 +1032,43 @@ _e_comp_act_redirect_toggle_go(E_Object * obj EINA_UNUSED, const char *params EI
    e_comp_client_redirect_toggle(e_client_focused_get());
 }
 
+static void
+_e_launchscreen_free(E_Launch_Screen *plscrn)
+{
+   if(plscrn->shobj) evas_object_del(plscrn->shobj);
+   E_FREE(plscrn);
+}
+
+E_Launch_Screen *
+_e_launchscreen_new(Ecore_Evas *ee)
+{
+   E_Launch_Screen *plscrn = NULL;
+
+   EINA_SAFETY_ON_NULL_GOTO(ee, error);
+
+   if ((conf) && (conf->launch_file))
+     {
+        if(!edje_file_group_exists(conf->launch_file, "e/comp/effects/launch"))
+           goto error;
+   }
+
+   plscrn = E_NEW(E_Launch_Screen, 1);
+   EINA_SAFETY_ON_NULL_GOTO(plscrn, error);
+
+   plscrn->shobj = edje_object_add(e_comp->evas);
+   evas_object_name_set(plscrn->shobj, "launch_screen");
+
+   evas_object_move(plscrn->shobj, 0, 0);
+   evas_object_resize(plscrn->shobj, e_comp->w, e_comp->h);
+   evas_object_layer_set(plscrn->shobj, E_LAYER_CLIENT_TOP);
+   edje_object_file_set(plscrn->shobj, conf->launch_file, "e/comp/effects/launch");
+   return plscrn;
+
+error:
+   ERR("Could not initialize launchscreen");
+   return NULL;
+}
+
 //////////////////////////////////////////////////////////////////////////
 
 EINTERN Eina_Bool
@@ -1413,6 +1452,11 @@ e_comp_shutdown(void)
         e_object_del(E_OBJECT(ec));
      }
 
+   if (e_comp->launchscrn)
+     {
+        _e_launchscreen_free(e_comp->launchscrn);
+     }
+
 #ifdef HAVE_WAYLAND
    e_comp_wl_shutdown();
 #endif
@@ -1455,6 +1499,12 @@ e_comp_deferred_job(void)
         e_pointer_hide(e_comp->pointer);
      }
 
+   /* launchscreen setting */
+   if (!e_comp->launchscrn)
+     {
+        e_comp->launchscrn = _e_launchscreen_new(e_comp->ee);
+     }
+
 #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
    e_comp_wl_deferred_job();
 #endif
index 5dcbbd2bc99b6c593f4863aebec5b05ed0659df1..0d25aae8bae4fb07fb3df312c0b8bef02dd2c8b8 100644 (file)
@@ -80,6 +80,12 @@ typedef struct E_Comp_Screen_Iface
    void (*dpms)(int);
 } E_Comp_Screen_Iface;
 
+typedef struct _E_Launch_Screen
+{
+   Evas_Object *shobj;
+   Ecore_Timer    *timeout;
+} E_Launch_Screen;
+
 struct _E_Comp
 {
    E_Object e_obj_inherit;
@@ -125,6 +131,8 @@ struct _E_Comp
 
    E_Comp_Screen_Iface *screen;
 
+   E_Launch_Screen   *launchscrn;
+
    Eina_List *debug_rects;
    Eina_List *ignore_wins;
 
index bd72b6a39f875fd2cd8673588b3b628e23dc8203..b4db424304f88a65cd25965defb3cabea9f148fe 100644 (file)
@@ -58,6 +58,7 @@ e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd)
    E_CONFIG_VAL(D, T, skip_first_damage, UCHAR);
    E_CONFIG_VAL(D, T, disable_screen_effects, UCHAR);
    E_CONFIG_VAL(D, T, enable_advanced_features, UCHAR);
+   E_CONFIG_VAL(D, T, launch_file, STR);
    E_CONFIG_VAL(D, T, fast_popups, UCHAR);
    E_CONFIG_VAL(D, T, fast_borders, UCHAR);
    E_CONFIG_VAL(D, T, fast_menus, UCHAR);
@@ -110,6 +111,7 @@ e_comp_cfdata_config_new(void)
    cfg->smooth_windows = 0; // 1 if gl, 0 if not
    cfg->first_draw_delay = 0.15;
    cfg->skip_first_damage = 1;
+   cfg->launch_file = NULL;
 
    cfg->match.popups = NULL;
 
@@ -222,6 +224,7 @@ e_comp_cfdata_config_free(E_Comp_Config *cfg)
    eina_stringshare_del(cfg->effect_style);
    eina_stringshare_del(cfg->effect_file);
    eina_stringshare_del(cfg->shadow_style);
+   eina_stringshare_del(cfg->launch_file);
 
    E_FREE_LIST(cfg->match.popups, e_comp_cfdata_match_free);
    E_FREE_LIST(cfg->match.borders, e_comp_cfdata_match_free);
index d7a454204236eb95e51ccc37476067a96aa09b95..789a51f0ac3338ac91c881aedf272d16a1c8f4fa 100644 (file)
@@ -35,6 +35,7 @@ struct _E_Comp_Config
    Eina_Bool skip_first_damage;
    Eina_Bool disable_screen_effects;
    Eina_Bool enable_advanced_features;
+   const char   *launch_file;
    // the following options add the "/fast" suffix to the normal groups
    Eina_Bool fast_popups;
    Eina_Bool fast_borders;