2010-02-18 19:00:58 -08:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_busycover.h"
|
|
|
|
#include "e_mod_config.h"
|
|
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
static void _e_busycover_cb_free(E_Busycover *cover);
|
|
|
|
|
|
|
|
EAPI E_Busycover *
|
|
|
|
e_busycover_new(E_Win *win)
|
|
|
|
{
|
|
|
|
E_Busycover *cover;
|
|
|
|
char buff[PATH_MAX];
|
|
|
|
|
|
|
|
cover = E_OBJECT_ALLOC(E_Busycover, E_BUSYCOVER_TYPE, _e_busycover_cb_free);
|
|
|
|
if (!cover) return NULL;
|
|
|
|
snprintf(buff, sizeof(buff), "%s/e-module-illume-home.edj",
|
|
|
|
il_home_cfg->mod_dir);
|
|
|
|
|
|
|
|
cover->o_base = edje_object_add(e_win_evas_get(win));
|
|
|
|
if (!e_theme_edje_object_set(cover->o_base,
|
|
|
|
"base/theme/modules/illume-home",
|
|
|
|
"modules/illume-home/busycover"))
|
|
|
|
edje_object_file_set(cover->o_base, buff, "modules/illume-home/busycover");
|
|
|
|
edje_object_part_text_set(cover->o_base, "e.text.title", _("LOADING"));
|
|
|
|
evas_object_move(cover->o_base, win->x, win->y);
|
|
|
|
evas_object_resize(cover->o_base, win->w, win->h);
|
giant comp rejiggering commit #6:
* border->fx REMOVED, related border api REMOVED
* comp edc has new class of groups: e/comp/effects[/auto]
** these are effects which can be applied to any compositor object through the e_comp_win_effect* api and are written in embryo
*** two types - base and auto - base = manual, for use with animators; auto are "trigger and forget", for use as actual effects
* desk flip transition animations moved to comp effects and FIXED(ish)
* "zoom" effect renamed to "diagonal" for slightly less misleading name since it never did any zooming
* actual "zoom" effect added
* border hierarchy now as follows: cw->effect_obj swallows cw->shobj, cw->shobj swallows cw->bd->bg_object ?: cw->obj, if (cw->bd->bg_object) cw->bd->bg_object swallows cw->obj
** cw->effect_obj now used for all positioning and comp logic
** cw->effect_obj ONLY used for object transformation effects (moving, zooming, fading, etc)
** cw->shobj ONLY for comp visual/non-movement effects (focus effect, unfocus opacity, legacy shadows); this is a candidate for removal/rewrite in E19
* even more comp shape rewrites
* desk flip animation time now controlled by theme since edje doesn't support setting transition time in C; related config value removed
* desk flip transitions (in e_desk.c) rewritten
* various modules (evry/illume2) updated to use comp effects instead of fx offset
* desk flip configuration BROKEN(ish)
2013-02-28 07:20:32 -08:00
|
|
|
evas_object_layer_set(cover->o_base, 999);
|
2010-02-18 19:00:58 -08:00
|
|
|
return cover;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI E_Busycover_Handle *
|
|
|
|
e_busycover_push(E_Busycover *cover, const char *msg, const char *icon)
|
|
|
|
{
|
|
|
|
E_Busycover_Handle *handle;
|
|
|
|
|
|
|
|
E_OBJECT_CHECK(cover);
|
|
|
|
E_OBJECT_TYPE_CHECK_RETURN(cover, E_BUSYCOVER_TYPE, NULL);
|
|
|
|
|
|
|
|
handle = E_NEW(E_Busycover_Handle, 1);
|
|
|
|
handle->cover = cover;
|
|
|
|
if (msg) handle->msg = eina_stringshare_add(msg);
|
|
|
|
if (icon) handle->icon = eina_stringshare_add(icon);
|
|
|
|
cover->handles = eina_list_append(cover->handles, handle);
|
|
|
|
edje_object_part_text_set(cover->o_base, "e.text.title", msg);
|
|
|
|
evas_object_show(cover->o_base);
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
e_busycover_pop(E_Busycover *cover, E_Busycover_Handle *handle)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(cover);
|
|
|
|
E_OBJECT_TYPE_CHECK(cover, E_BUSYCOVER_TYPE);
|
|
|
|
if (!eina_list_data_find(cover->handles, handle)) return;
|
|
|
|
cover->handles = eina_list_remove(cover->handles, handle);
|
|
|
|
if (handle->msg) eina_stringshare_del(handle->msg);
|
|
|
|
if (handle->icon) eina_stringshare_del(handle->icon);
|
|
|
|
E_FREE(handle);
|
|
|
|
if (cover->handles)
|
|
|
|
{
|
|
|
|
handle = cover->handles->data;
|
|
|
|
edje_object_part_text_set(cover->o_base, "e.text.title", handle->msg);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
evas_object_hide(cover->o_base);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
e_busycover_resize(E_Busycover *cover, int w, int h)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(cover);
|
|
|
|
E_OBJECT_TYPE_CHECK(cover, E_BUSYCOVER_TYPE);
|
|
|
|
evas_object_resize(cover->o_base, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
static void
|
|
|
|
_e_busycover_cb_free(E_Busycover *cover)
|
|
|
|
{
|
|
|
|
E_Busycover_Handle *handle;
|
|
|
|
|
|
|
|
EINA_LIST_FREE(cover->handles, handle)
|
|
|
|
{
|
|
|
|
if (handle->msg) eina_stringshare_del(handle->msg);
|
|
|
|
if (handle->icon) eina_stringshare_del(handle->icon);
|
|
|
|
E_FREE(handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cover->o_base) evas_object_del(cover->o_base);
|
|
|
|
E_FREE(cover);
|
|
|
|
}
|