'everything' module: disable thumb nails for selector

- there is a bug somewhere.. i guess it's e_thumb not liking to have the same file twice to thumbnail
- cleanups for thumb view


SVN revision: 42003
This commit is contained in:
Hannes Janetzek 2009-08-26 03:12:00 +00:00
parent 3bda6d6735
commit 82745eb2a6
5 changed files with 176 additions and 180 deletions

View File

@ -9,7 +9,7 @@
#include "e_mod_main.h" #include "e_mod_main.h"
#define CONFIG_VERSION 2 #define CONFIG_VERSION 3
/* actual module specifics */ /* actual module specifics */
static void _e_mod_action_exebuf_cb(E_Object *obj, const char *params); static void _e_mod_action_exebuf_cb(E_Object *obj, const char *params);
@ -83,6 +83,7 @@ e_modapi_init(E_Module *m)
E_CONFIG_LIST(D, T, conf_subjects, conf_item_edd); E_CONFIG_LIST(D, T, conf_subjects, conf_item_edd);
E_CONFIG_LIST(D, T, conf_actions, conf_item_edd); E_CONFIG_LIST(D, T, conf_actions, conf_item_edd);
E_CONFIG_LIST(D, T, conf_objects, conf_item_edd); E_CONFIG_LIST(D, T, conf_objects, conf_item_edd);
E_CONFIG_LIST(D, T, conf_views, conf_item_edd);
#undef T #undef T
#undef D #undef D
evry_conf = e_config_domain_load("module.everything", conf_edd); evry_conf = e_config_domain_load("module.everything", conf_edd);
@ -103,6 +104,7 @@ e_modapi_init(E_Module *m)
evry_conf->conf_subjects = NULL; evry_conf->conf_subjects = NULL;
evry_conf->conf_actions = NULL; evry_conf->conf_actions = NULL;
evry_conf->conf_objects = NULL; evry_conf->conf_objects = NULL;
evry_conf->conf_views = NULL;
} }
/* search for plugins */ /* search for plugins */

View File

@ -20,6 +20,7 @@ struct _Config
Eina_List *conf_subjects; Eina_List *conf_subjects;
Eina_List *conf_actions; Eina_List *conf_actions;
Eina_List *conf_objects; Eina_List *conf_objects;
Eina_List *conf_views;
int scroll_animate; int scroll_animate;
double scroll_speed; double scroll_speed;

View File

@ -58,7 +58,7 @@ static void _evry_selector_icon_set(Evry_Selector *sel);
static int _evry_selector_subjects_get(const char *plugin_name); static int _evry_selector_subjects_get(const char *plugin_name);
static int _evry_selector_actions_get(Evry_Item *it); static int _evry_selector_actions_get(Evry_Item *it);
static int _evry_selector_objects_get(Evry_Action *act); static int _evry_selector_objects_get(Evry_Action *act);
static void _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info); /* static void _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info); */
static int _evry_browse_item(Evry_Selector *sel); static int _evry_browse_item(Evry_Selector *sel);
static void _evry_browse_back(Evry_Selector *sel); static void _evry_browse_back(Evry_Selector *sel);
@ -288,8 +288,8 @@ evry_item_free(Evry_Item *it)
/* printf("%d, %d\t free: %s\n", /* printf("%d, %d\t free: %s\n",
* it->ref, item_cnt - 1, * it->ref, item_cnt - 1,
* it->label); */ * it->label);
/* item_cnt--; */ * item_cnt--; */
if (it->label) eina_stringshare_del(it->label); if (it->label) eina_stringshare_del(it->label);
if (it->o_bg) evas_object_del(it->o_bg); if (it->o_bg) evas_object_del(it->o_bg);
@ -786,10 +786,10 @@ _evry_selector_new(int type)
static void static void
_evry_selector_free(Evry_Selector *sel) _evry_selector_free(Evry_Selector *sel)
{ {
if (sel->do_thumb) /* if (sel->do_thumb)
e_thumb_icon_end(sel->o_thumb); * e_thumb_icon_end(sel->o_thumb);
if (sel->o_thumb) * if (sel->o_thumb)
evas_object_del(sel->o_thumb); * evas_object_del(sel->o_thumb); */
if (sel->o_icon) if (sel->o_icon)
evas_object_del(sel->o_icon); evas_object_del(sel->o_icon);
if (sel->o_main) if (sel->o_main)
@ -847,55 +847,55 @@ _evry_selector_activate(Evry_Selector *sel)
} }
} }
static void /* static void
_evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info) * _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
{ * {
Evas_Coord w, h; * Evas_Coord w, h;
Evry_Selector *sel = data; * Evry_Selector *sel = data;
*
if (sel->o_icon) * if (sel->o_icon)
evas_object_del(sel->o_icon); * evas_object_del(sel->o_icon);
sel->o_icon = NULL; * sel->o_icon = NULL;
*
e_icon_size_get(sel->o_thumb, &w, &h); * e_icon_size_get(sel->o_thumb, &w, &h);
edje_extern_object_aspect_set(sel->o_thumb, EDJE_ASPECT_CONTROL_BOTH, w, h); * edje_extern_object_aspect_set(sel->o_thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
edje_object_part_swallow(sel->o_main, "e.swallow.thumb", sel->o_thumb); * edje_object_part_swallow(sel->o_main, "e.swallow.thumb", sel->o_thumb);
evas_object_show(sel->o_thumb); * evas_object_show(sel->o_thumb);
edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e"); * edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e");
sel->do_thumb = EINA_FALSE; * sel->do_thumb = EINA_FALSE;
} * }
*
static int * static int
_evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it) * _evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
{ * {
Evas_Coord w, h; * Evas_Coord w, h;
*
if (sel->do_thumb) * if (sel->do_thumb)
e_thumb_icon_end(sel->o_thumb); * e_thumb_icon_end(sel->o_thumb);
*
if (sel->o_thumb) * if (sel->o_thumb)
evas_object_del(sel->o_thumb); * evas_object_del(sel->o_thumb);
*
if (it->plugin->type_out != thumb_types) return 0; * if (it->plugin->type_out != thumb_types) return 0;
*
ITEM_FILE(file, it); * ITEM_FILE(file, it);
*
if (!file->uri || !file->mime) return 0; * if (!file->uri || !file->mime) return 0;
*
if (!strncmp(file->mime, "image/", 6)) * if (!strncmp(file->mime, "image/", 6))
{ * {
sel->o_thumb = e_thumb_icon_add(win->popup->evas); * sel->o_thumb = e_thumb_icon_add(win->popup->evas);
evas_object_smart_callback_add(sel->o_thumb, "e_thumb_gen", _evry_selector_thumb_gen, sel); * evas_object_smart_callback_add(sel->o_thumb, "e_thumb_gen", _evry_selector_thumb_gen, sel);
edje_object_part_geometry_get(sel->o_main, "e.swallow.thumb", NULL, NULL, &w, &h); * edje_object_part_geometry_get(sel->o_main, "e.swallow.thumb", NULL, NULL, &w, &h);
e_thumb_icon_file_set(sel->o_thumb, file->uri, NULL); * e_thumb_icon_file_set(sel->o_thumb, file->uri, NULL);
e_thumb_icon_size_set(sel->o_thumb, w, h); * e_thumb_icon_size_set(sel->o_thumb, w, h);
e_thumb_icon_begin(sel->o_thumb); * e_thumb_icon_begin(sel->o_thumb);
sel->do_thumb = EINA_TRUE; * sel->do_thumb = EINA_TRUE;
return 1; * return 1;
} * }
*
return 0; * return 0;
} * } */
static void static void
_evry_selector_icon_set(Evry_Selector *sel) _evry_selector_icon_set(Evry_Selector *sel)
@ -918,7 +918,7 @@ _evry_selector_icon_set(Evry_Selector *sel)
if (it && it->plugin && it->plugin->icon_get) if (it && it->plugin && it->plugin->icon_get)
{ {
if (!_evry_selector_thumb(sel, it)) if (1) //!_evry_selector_thumb(sel, it))
{ {
o = it->plugin->icon_get(it->plugin, it, win->popup->evas); o = it->plugin->icon_get(it->plugin, it, win->popup->evas);
if (o) if (o)
@ -929,10 +929,10 @@ _evry_selector_icon_set(Evry_Selector *sel)
} }
} }
} }
else if (it) /* else if (it)
{ * {
_evry_selector_thumb(sel, it); * _evry_selector_thumb(sel, it);
} * } */
if (!sel->o_icon && s->plugin && s->plugin->icon) if (!sel->o_icon && s->plugin && s->plugin->icon)
{ {
@ -1193,9 +1193,6 @@ _evry_browse_item(Evry_Selector *sel)
{ {
EINA_LIST_FOREACH(sel->plugins, l, plugin) EINA_LIST_FOREACH(sel->plugins, l, plugin)
{ {
/* if (eina_list_data_find_list(plugins, plugin))
* continue; */
if ((!plugin->begin || !plugin->type_in) || if ((!plugin->begin || !plugin->type_in) ||
(plugin->type_in != type_out)) (plugin->type_in != type_out))
continue; continue;

View File

@ -75,6 +75,7 @@ _cb_sort(const void *data1, const void *data2)
if (!it1->browseable && it2->browseable) if (!it1->browseable && it2->browseable)
return 1; return 1;
if (it1->fuzzy_match && it2->fuzzy_match)
if (it1->fuzzy_match - it2->fuzzy_match) if (it1->fuzzy_match - it2->fuzzy_match)
return (it1->fuzzy_match - it2->fuzzy_match); return (it1->fuzzy_match - it2->fuzzy_match);

View File

@ -108,7 +108,6 @@ _thumb_idler(void *data)
return 0; return 0;
} }
static int static int
_e_smart_reconfigure_do(void *data) _e_smart_reconfigure_do(void *data)
{ {
@ -307,11 +306,10 @@ _e_smart_reconfigure_do(void *data)
xx = sd->x - sd->cx + it->x + ox; xx = sd->x - sd->cx + it->x + ox;
yy = sd->y - sd->cy + it->y + oy; yy = sd->y - sd->cy + it->y + oy;
evas_object_geometry_get(sd->view->span, NULL, NULL, &vw, &vh); evas_output_viewport_get(evas_object_evas_get(obj), NULL, NULL, &vw, &vh);
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, 0, vw, vh))
if (E_INTERSECTS(xx, yy, it->w, it->h, 0, - it->h*2, vw, vh + it->h*4))
{ {
if (!it->frame) if (!it->visible)
{ {
it->frame = edje_object_add(sd->view->evas); it->frame = edje_object_add(sd->view->evas);
@ -320,6 +318,7 @@ _e_smart_reconfigure_do(void *data)
evas_object_smart_member_add(it->frame, obj); evas_object_smart_member_add(it->frame, obj);
evas_object_clip_set(it->frame, evas_object_clip_get(obj)); evas_object_clip_set(it->frame, evas_object_clip_get(obj));
edje_object_part_text_set(it->frame, "e.text.label", it->item->label); edje_object_part_text_set(it->frame, "e.text.label", it->item->label);
if (!it->image && !it->have_thumb && if (!it->image && !it->have_thumb &&
@ -331,15 +330,8 @@ _e_smart_reconfigure_do(void *data)
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image); edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
evas_object_show(it->image); evas_object_show(it->image);
} }
}
if (it->get_thumb && !it->have_thumb && !it->thumb) evas_object_show(it->frame);
{
it->thumb = e_thumb_icon_add(sd->view->evas);
if (!sd->thumb_idler)
sd->thumb_idler = ecore_idle_enterer_before_add(_thumb_idler, sd);
}
if (it->selected && sd->zoom < 2) if (it->selected && sd->zoom < 2)
edje_object_signal_emit(it->frame, "e,state,selected", "e"); edje_object_signal_emit(it->frame, "e,state,selected", "e");
@ -349,23 +341,29 @@ _e_smart_reconfigure_do(void *data)
else if (!it->visible) else if (!it->visible)
edje_object_signal_emit(it->frame, "e,action,thumb,show", "e"); edje_object_signal_emit(it->frame, "e,action,thumb,show", "e");
evas_object_move(it->frame, if (it->get_thumb)
xx + dx, {
yy + dy); it->thumb = e_thumb_icon_add(sd->view->evas);
evas_object_resize(it->frame, it->w, it->h); if (!sd->thumb_idler)
evas_object_show(it->frame); sd->thumb_idler = ecore_idle_enterer_before_add(_thumb_idler, sd);
}
it->visible = EINA_TRUE; it->visible = EINA_TRUE;
} }
else
if (it->visible)
{ {
if (it->frame) evas_object_move(it->frame, xx + dx, yy + dy);
evas_object_resize(it->frame, it->w, it->h);
}
}
else if (it->visible)
{ {
if (it->do_thumb) e_thumb_icon_end(it->thumb); if (it->do_thumb) e_thumb_icon_end(it->thumb);
if (it->thumb) evas_object_del(it->thumb); if (it->thumb) evas_object_del(it->thumb);
if (it->image) evas_object_del(it->image); if (it->image) evas_object_del(it->image);
if (it->frame) evas_object_del(it->frame);
evas_object_del(it->frame);
it->thumb = NULL; it->thumb = NULL;
it->image = NULL; it->image = NULL;
@ -377,7 +375,6 @@ _e_smart_reconfigure_do(void *data)
it->changed = TRUE; it->changed = TRUE;
} }
} }
}
if (changed) if (changed)
evas_object_smart_callback_call(obj, "changed", NULL); evas_object_smart_callback_call(obj, "changed", NULL);
@ -617,7 +614,6 @@ _pan_item_remove(Evas_Object *obj, Item *it)
if (it->image) evas_object_del(it->image); if (it->image) evas_object_del(it->image);
evry_item_free(it->item); evry_item_free(it->item);
E_FREE(it); E_FREE(it);
_e_smart_reconfigure(obj); _e_smart_reconfigure(obj);
@ -636,8 +632,6 @@ _pan_item_select(Evas_Object *obj, Item *it)
if (sd->zoom < 2) if (sd->zoom < 2)
edje_object_signal_emit(sd->sel_item->frame, "e,state,selected", "e"); edje_object_signal_emit(sd->sel_item->frame, "e,state,selected", "e");
/* sd->update = EINA_FALSE; */
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter); if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, obj); sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, obj);
} }
@ -651,6 +645,7 @@ _view_clear(Evry_View *view)
EINA_LIST_FREE(sd->items, it) EINA_LIST_FREE(sd->items, it)
{ {
if (it->do_thumb) e_thumb_icon_end(it->thumb);
if (it->thumb) evas_object_del(it->thumb); if (it->thumb) evas_object_del(it->thumb);
if (it->frame) evas_object_del(it->frame); if (it->frame) evas_object_del(it->frame);
if (it->image) evas_object_del(it->image); if (it->image) evas_object_del(it->image);
@ -696,6 +691,7 @@ _view_update(Evry_View *view)
last_pos = v_it->pos; last_pos = v_it->pos;
v_it->pos = 0; v_it->pos = 0;
pos = 1; pos = 1;
EINA_LIST_FOREACH(p_items, ll, p_it) EINA_LIST_FOREACH(p_items, ll, p_it)
{ {
if (v_it->item == p_it) if (v_it->item == p_it)
@ -759,10 +755,9 @@ _view_update(Evry_View *view)
pos++; pos++;
} }
sd->items = eina_list_sort(sd->items, pos - 1, _sort_cb); sd->items = eina_list_sort(sd->items, eina_list_count(sd->items), _sort_cb);
if (added) if (added) sd->update = EINA_TRUE;
sd->update = EINA_TRUE;
if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter); if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span); sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);