e: let's make all preview asynchronous with edje.

SVN revision: 83815
devs/asdfuser/comp-sounds
Cedric BAIL 10 years ago
parent 28a8ecf101
commit 08dbfd4c7f
  1. 20
      src/bin/e_livethumb.c
  2. 13
      src/bin/e_widget_preview.c

@ -67,6 +67,14 @@ e_livethumb_vsize_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
if (h) *h = sd->vh;
}
static void
_e_livethumb_edje_preloaded(void *data EINA_UNUSED, Evas_Object *obj,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
evas_object_show(obj);
}
EAPI void
e_livethumb_thumb_set(Evas_Object *obj, Evas_Object *thumb)
{
@ -77,7 +85,17 @@ e_livethumb_thumb_set(Evas_Object *obj, Evas_Object *thumb)
return;
}
sd->thumb_obj = thumb;
evas_object_show(sd->thumb_obj);
if (!strcmp(evas_object_type_get(thumb), "edje"))
{
edje_object_signal_callback_add(thumb,
"preload,done", "",
_e_livethumb_edje_preloaded, NULL);
edje_object_preload(thumb, EINA_FALSE);
}
else
{
evas_object_show(sd->thumb_obj);
}
evas_object_move(sd->thumb_obj, 0, 0);
evas_object_resize(sd->thumb_obj, sd->vw, sd->vh);
}

@ -167,16 +167,6 @@ e_widget_preview_file_get(Evas_Object *obj, const char **file, const char **grou
edje_object_file_get(wd->o_thumb, file, group);
}
static void
_e_widget_preview_edje_preloaded(void *data, Evas_Object *obj EINA_UNUSED,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
E_Widget_Data *wd = data;
evas_object_show(wd->o_thumb);
}
EAPI int
e_widget_preview_edje_set(Evas_Object *obj, const char *file, const char *group)
{
@ -187,9 +177,6 @@ e_widget_preview_edje_set(Evas_Object *obj, const char *file, const char *group)
if (wd->o_thumb) evas_object_del(wd->o_thumb);
wd->o_thumb = edje_object_add(e_livethumb_evas_get(wd->img));
ret = edje_object_file_set(wd->o_thumb, file, group);
edje_object_signal_callback_add(wd->o_thumb,
"preload,done", "",
_e_widget_preview_edje_preloaded, wd);
e_livethumb_thumb_set(wd->img, wd->o_thumb);
e_widget_change(obj);

Loading…
Cancel
Save