static int _evry_selector_subjects_get(const char *plugin_name);
static int _evry_selector_actions_get(Evry_Item *it);
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 void _evry_browse_back(Evry_Selector *sel);
e_popup_layer_set(win->popup, 255);
e_popup_show(win->popup);
e_popup_show(list->popup);
-
+
return 1;
error:
/* printf("%d, %d\t free: %s\n",
* it->ref, item_cnt - 1,
- * it->label); */
- /* item_cnt--; */
+ * it->label);
+ * item_cnt--; */
if (it->label) eina_stringshare_del(it->label);
if (it->o_bg) evas_object_del(it->o_bg);
static void
_evry_selector_free(Evry_Selector *sel)
{
- if (sel->do_thumb)
- e_thumb_icon_end(sel->o_thumb);
- if (sel->o_thumb)
- evas_object_del(sel->o_thumb);
+ /* if (sel->do_thumb)
+ * e_thumb_icon_end(sel->o_thumb);
+ * if (sel->o_thumb)
+ * evas_object_del(sel->o_thumb); */
if (sel->o_icon)
evas_object_del(sel->o_icon);
if (sel->o_main)
}
}
-static void
-_evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
-{
- Evas_Coord w, h;
- Evry_Selector *sel = data;
-
- if (sel->o_icon)
- evas_object_del(sel->o_icon);
- sel->o_icon = NULL;
-
- e_icon_size_get(sel->o_thumb, &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);
- evas_object_show(sel->o_thumb);
- edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e");
- sel->do_thumb = EINA_FALSE;
-}
-
-static int
-_evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
-{
- Evas_Coord w, h;
-
- if (sel->do_thumb)
- e_thumb_icon_end(sel->o_thumb);
-
- if (sel->o_thumb)
- evas_object_del(sel->o_thumb);
-
- if (it->plugin->type_out != thumb_types) return 0;
-
- ITEM_FILE(file, it);
-
- if (!file->uri || !file->mime) return 0;
-
- if (!strncmp(file->mime, "image/", 6))
- {
- 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);
- 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_size_set(sel->o_thumb, w, h);
- e_thumb_icon_begin(sel->o_thumb);
- sel->do_thumb = EINA_TRUE;
- return 1;
- }
-
- return 0;
-}
+/* static void
+ * _evry_selector_thumb_gen(void *data, Evas_Object *obj, void *event_info)
+ * {
+ * Evas_Coord w, h;
+ * Evry_Selector *sel = data;
+ *
+ * if (sel->o_icon)
+ * evas_object_del(sel->o_icon);
+ * sel->o_icon = NULL;
+ *
+ * e_icon_size_get(sel->o_thumb, &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);
+ * evas_object_show(sel->o_thumb);
+ * edje_object_signal_emit(sel->o_main, "e,action,thumb,show", "e");
+ * sel->do_thumb = EINA_FALSE;
+ * }
+ *
+ * static int
+ * _evry_selector_thumb(Evry_Selector *sel, const Evry_Item *it)
+ * {
+ * Evas_Coord w, h;
+ *
+ * if (sel->do_thumb)
+ * e_thumb_icon_end(sel->o_thumb);
+ *
+ * if (sel->o_thumb)
+ * evas_object_del(sel->o_thumb);
+ *
+ * if (it->plugin->type_out != thumb_types) return 0;
+ *
+ * ITEM_FILE(file, it);
+ *
+ * if (!file->uri || !file->mime) return 0;
+ *
+ * if (!strncmp(file->mime, "image/", 6))
+ * {
+ * 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);
+ * 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_size_set(sel->o_thumb, w, h);
+ * e_thumb_icon_begin(sel->o_thumb);
+ * sel->do_thumb = EINA_TRUE;
+ * return 1;
+ * }
+ *
+ * return 0;
+ * } */
static void
_evry_selector_icon_set(Evry_Selector *sel)
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);
if (o)
}
}
}
- else if (it)
- {
- _evry_selector_thumb(sel, it);
- }
+ /* else if (it)
+ * {
+ * _evry_selector_thumb(sel, it);
+ * } */
if (!sel->o_icon && s->plugin && s->plugin->icon)
{
Evry_Plugin *p, *plugin;
Evry_Selector *sel = selectors[1];
const char *type_out;
-
+
while (sel->state)
_evry_state_pop(sel);
{
EINA_LIST_FOREACH(sel->plugins, l, plugin)
{
- /* if (eina_list_data_find_list(plugins, plugin))
- * continue; */
-
if ((!plugin->begin || !plugin->type_in) ||
(plugin->type_in != type_out))
continue;
Evas *evas;
const Evry_State *state;
Tab_View *tabs;
-
+
Evas_Object *bg, *sframe, *span;
int iw, ih;
};
_thumb_gen(void *data, Evas_Object *obj, void *event_info)
{
Evas_Coord w, h;
- Item *it = data;
+ Item *it = data;
if (!it->frame) return;
-
+
e_icon_size_get(it->thumb, &w, &h);
- edje_extern_object_aspect_set(it->thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
+ edje_extern_object_aspect_set(it->thumb, EDJE_ASPECT_CONTROL_BOTH, w, h);
edje_object_part_swallow(it->frame, "e.swallow.thumb", it->thumb);
evas_object_show(it->thumb);
it->have_thumb = EINA_TRUE;
Eina_List *l;
Item *it;
int cnt = 0;
-
+
EINA_LIST_FOREACH(sd->items, l, it)
{
if (it->thumb && !(it->have_thumb || it->do_thumb))
{
ITEM_FILE(file, it->item);
-
+
evas_object_smart_callback_add(it->thumb, "e_thumb_gen", _thumb_gen, it);
e_thumb_icon_file_set(it->thumb, file->uri, NULL);
}
sd->thumb_idler = NULL;
-
+
return 0;
}
-
static int
_e_smart_reconfigure_do(void *data)
{
int iw, redo = 0, changed = 0;
static int recursion = 0;
Evas_Coord x, y, xx, yy, ww, hh, mw, mh, ox, oy, dd;
-
+
if (!sd) return 0;
if (sd->cx > (sd->cw - sd->w)) sd->cx = sd->cw - sd->w;
if (sd->cy > (sd->ch - sd->h)) sd->cy = sd->ch - sd->h;
if (sd->zoom == 0)
{
int cnt = eina_list_count(sd->items);
-
+
sd->view->iw *= 3;
sd->view->iw /= 4;
-
+
if (cnt < 3)
iw = (double)sd->w / 2.5;
else if (cnt < 7)
if (sd->view->iw <= 0) sd->view->iw = 1;
if (sd->view->ih <= 0) sd->view->ih = 1;
-
+
x = 0;
y = 0;
ww = iw;
hh = (sd->view->ih * iw) / (sd->view->iw);
-
+
mw = mh = 0;
EINA_LIST_FOREACH(sd->items, l, it)
{
}
changed = 1;
}
-
+
ox = 0;
if (sd->w > sd->cw) ox = (sd->w - sd->cw) / 2;
oy = 0;
if (sd->sel_item && !sd->update)
{
- int y, h;
+ int y, h;
it = sd->sel_item;
-
+
e_scrollframe_child_pos_get(sd->view->sframe, NULL, &y);
e_scrollframe_child_viewport_size_get(sd->view->sframe, NULL, &h);
-
+
if ((it->y + it->h) - y > h)
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y - (2 - sd->zoom) * it->h);
else if (it->y < y)
e_scrollframe_child_pos_set(sd->view->sframe, 0, it->y);
}
-
+
EINA_LIST_FOREACH(sd->items, l, it)
- {
+ {
Evas_Coord dx, dy, vw, vh;
-
+
dx = dy = 0;
- if ((sd->sx >= 0) &&
+ if ((sd->sx >= 0) &&
(sd->selmove > 0.0))
{
double a, d;
dy = sd->h - yy;
else
dy = yy;
-
+
dd = dx - d;
if (dy > dx) dd = dy - d;
if (dd < 0) dd = 0;
xx = sd->x - sd->cx + it->x + ox;
yy = sd->y - sd->cy + it->y + oy;
- evas_object_geometry_get(sd->view->span, NULL, NULL, &vw, &vh);
-
- if (E_INTERSECTS(xx, yy, it->w, it->h, 0, - it->h*2, vw, vh + it->h*4))
+ 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 (!it->frame)
+ if (!it->visible)
{
it->frame = edje_object_add(sd->view->evas);
evas_object_smart_member_add(it->frame, 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);
-
+
if (!it->image && !it->have_thumb &&
it->item->plugin && it->item->plugin->icon_get)
- {
+ {
it->image = it->item->plugin->icon_get
(it->item->plugin, it->item, sd->view->evas);
edje_object_part_swallow(it->frame, "e.swallow.icon", it->image);
evas_object_show(it->image);
}
- }
-
- if (it->get_thumb && !it->have_thumb && !it->thumb)
- {
- it->thumb = e_thumb_icon_add(sd->view->evas);
- if (!sd->thumb_idler)
- sd->thumb_idler = ecore_idle_enterer_before_add(_thumb_idler, sd);
- }
+ evas_object_show(it->frame);
- if (it->selected && sd->zoom < 2)
- edje_object_signal_emit(it->frame, "e,state,selected", "e");
-
- if (sd->update && !it->visible)
- edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e");
- else if (!it->visible)
- edje_object_signal_emit(it->frame, "e,action,thumb,show", "e");
-
- evas_object_move(it->frame,
- xx + dx,
- yy + dy);
-
- evas_object_resize(it->frame, it->w, it->h);
- evas_object_show(it->frame);
- it->visible = EINA_TRUE;
- }
- else
- {
- if (it->frame)
- {
- if (it->do_thumb) e_thumb_icon_end(it->thumb);
- if (it->thumb) evas_object_del(it->thumb);
- if (it->image) evas_object_del(it->image);
+ if (it->selected && sd->zoom < 2)
+ edje_object_signal_emit(it->frame, "e,state,selected", "e");
+
+ if (sd->update && !it->visible)
+ edje_object_signal_emit(it->frame, "e,action,thumb,show_delayed", "e");
+ else if (!it->visible)
+ edje_object_signal_emit(it->frame, "e,action,thumb,show", "e");
+
+ if (it->get_thumb)
+ {
+ it->thumb = e_thumb_icon_add(sd->view->evas);
- evas_object_del(it->frame);
+ if (!sd->thumb_idler)
+ sd->thumb_idler = ecore_idle_enterer_before_add(_thumb_idler, sd);
+ }
+ it->visible = EINA_TRUE;
+ }
- it->thumb = NULL;
- it->image = NULL;
- it->frame = NULL;
+ if (it->visible)
+ {
+ evas_object_move(it->frame, xx + dx, yy + dy);
+ evas_object_resize(it->frame, it->w, it->h);
- it->have_thumb = EINA_FALSE;
- it->do_thumb = EINA_FALSE;
- it->visible = EINA_FALSE;
- it->changed = TRUE;
}
}
+ else if (it->visible)
+ {
+ if (it->do_thumb) e_thumb_icon_end(it->thumb);
+ if (it->thumb) evas_object_del(it->thumb);
+ if (it->image) evas_object_del(it->image);
+ if (it->frame) evas_object_del(it->frame);
+
+ it->thumb = NULL;
+ it->image = NULL;
+ it->frame = NULL;
+
+ it->have_thumb = EINA_FALSE;
+ it->do_thumb = EINA_FALSE;
+ it->visible = EINA_FALSE;
+ it->changed = TRUE;
+ }
}
-
+
if (changed)
evas_object_smart_callback_call(obj, "changed", NULL);
sd->update = EINA_FALSE;
-
+
if (recursion == 0)
sd->idle_enter = NULL;
return 0;
if (!strncmp(file->mime, "image/", 6))
return 1;
-
+
return 0;
}
{
Smart_Data *sd = evas_object_smart_data_get(obj);
Item *it;
-
+
it = E_NEW(Item, 1);
if (!it) return NULL;
-
+
sd->items = eina_list_append(sd->items, it);
it->obj = obj;
it->item = item;
if (_check_item(item))
it->get_thumb = EINA_TRUE;
-
- evry_item_ref(item);
+
+ evry_item_ref(item);
_e_smart_reconfigure(obj);
if (it->image) evas_object_del(it->image);
evry_item_free(it->item);
-
E_FREE(it);
_e_smart_reconfigure(obj);
if (sd->zoom < 2)
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);
}
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->frame) evas_object_del(it->frame);
if (it->image) evas_object_del(it->image);
E_FREE(it);
}
- if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
- sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
+ if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
+ sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
v->tabs->clear(v->tabs);
}
{
const Item *it1 = data1;
const Item *it2 = data2;
-
+
return it1->pos - it2->pos;
}
Evry_Item *p_it;
Eina_List *l, *ll, *p_items, *v_remove = NULL, *v_items = NULL;
int pos, last_pos;
-
+
if (!v->state->plugin)
{
_view_clear(view);
return 1;
}
-
+
p_items = v->state->plugin->items;
EINA_LIST_FOREACH(sd->items, l, v_it)
{
last_pos = v_it->pos;
- v_it->pos = 0;
+ v_it->pos = 0;
pos = 1;
+
EINA_LIST_FOREACH(p_items, ll, p_it)
{
if (v_it->item == p_it)
{
if (pos != last_pos)
v_it->changed = EINA_TRUE;
-
+
v_it->pos = pos;
-
+
if (p_it == v->state->sel_item)
{
sd->sel_item = v_it;
}
else
v_it->selected = EINA_FALSE;
-
+
break;
}
pos++;
}
-
+
if(v_it->pos)
{
v_items = eina_list_append(v_items, v_it->item);
if (_check_item(v_it->item))
v_it->get_thumb = EINA_TRUE;
}
-
+
else
v_remove = eina_list_append(v_remove, v_it);
}
pos = 1;
int added = 0;
-
+
EINA_LIST_FOREACH(p_items, l, p_it)
{
if (!eina_list_data_find_list(v_items, p_it))
}
pos++;
}
-
- sd->items = eina_list_sort(sd->items, pos - 1, _sort_cb);
- if (added)
- sd->update = EINA_TRUE;
+ sd->items = eina_list_sort(sd->items, eina_list_count(sd->items), _sort_cb);
- if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
- sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
+ if (added) sd->update = EINA_TRUE;
+
+ if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter);
+ sd->idle_enter = ecore_idle_enterer_add(_e_smart_reconfigure_do, v->span);
if (v_items) eina_list_free(v_items);
-
+
v->tabs->update(v->tabs);
-
+
return 1;
}
}
}
}
-
-
- 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);
goto end;
}
-
+
if (v->tabs->key_down(v->tabs, ev))
{
_view_update(view);
if (!it && l && l->next)
it = l->next->data;
-
+
if (it)
{
_pan_item_select(v->span, it);
}
goto end;
}
-
+
return 0;
end:
// scrolled thumbs
v->span = _pan_add(v->evas);
_pan_view_set(v->span, v);
-
+
// the scrollframe holding the scrolled thumbs
v->sframe = e_scrollframe_add(v->evas);
e_scrollframe_custom_theme_set(v->sframe, "base/theme/widgets",
"e/modules/everything/thumbview/main/scrollframe");
e_scrollframe_extern_pan_set(v->sframe, v->span,
- _pan_set, _pan_get, _pan_max_get,
+ _pan_set, _pan_get, _pan_max_get,
_pan_child_size_get);
edje_object_part_swallow(v->bg, "e.swallow.list", v->sframe);
evas_object_show(v->sframe);
evas_object_show(v->span);
-
+
EVRY_VIEW(v)->o_list = v->bg;
v->tabs = evry_tab_view_new(s, v->evas);
v->view.o_bar = v->tabs->o_tabs;
-
+
return EVRY_VIEW(v);
}
_view_destroy(Evry_View *view)
{
VIEW(v, view);
-
+
evas_object_del(v->bg);
evas_object_del(v->sframe);
evas_object_del(v->span);
-
+
evry_tab_view_free(v->tabs);
-
+
E_FREE(v);
}