forked from enlightenment/enlightenment
some optimizations... and fixes :) thats all
SVN revision: 4381
This commit is contained in:
parent
d1077ae93e
commit
86e401ab9d
|
@ -10,7 +10,6 @@ static void e_idle(void *data);
|
||||||
static void
|
static void
|
||||||
e_idle(void *data)
|
e_idle(void *data)
|
||||||
{
|
{
|
||||||
printf("idle...\n");
|
|
||||||
e_db_flush();
|
e_db_flush();
|
||||||
return;
|
return;
|
||||||
UN(data);
|
UN(data);
|
||||||
|
|
6
src/e.h
6
src/e.h
|
@ -99,6 +99,11 @@ void (*e_obj_free) (void *e_obj);
|
||||||
_e_obj->references = 1; \
|
_e_obj->references = 1; \
|
||||||
_e_obj->e_obj_free = (void *) _e_obj_free_func; \
|
_e_obj->e_obj_free = (void *) _e_obj_free_func; \
|
||||||
}
|
}
|
||||||
|
#define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
|
||||||
|
((x < (xx + ww)) && \
|
||||||
|
(y < (yy + hh)) && \
|
||||||
|
((x + w) > xx) && \
|
||||||
|
((y + h) > yy))
|
||||||
|
|
||||||
#define SPANS_COMMON(x1, w1, x2, w2) \
|
#define SPANS_COMMON(x1, w1, x2, w2) \
|
||||||
(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
|
(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
|
||||||
|
@ -410,6 +415,7 @@ struct _E_Icon
|
||||||
} state;
|
} state;
|
||||||
char *icon;
|
char *icon;
|
||||||
int visible;
|
int visible;
|
||||||
|
int viewable;
|
||||||
} current, previous;
|
} current, previous;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
4
src/fs.c
4
src/fs.c
|
@ -11,7 +11,7 @@ _e_fs_fd_handle(int fd)
|
||||||
Evas_List events = NULL;
|
Evas_List events = NULL;
|
||||||
double start, current;
|
double start, current;
|
||||||
|
|
||||||
printf("############## fs event...\n");
|
/* printf("############## fs event...\n");*/
|
||||||
start = e_get_time();
|
start = e_get_time();
|
||||||
while ((ec) && efsd_events_pending(ec))
|
while ((ec) && efsd_events_pending(ec))
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@ _e_fs_fd_handle(int fd)
|
||||||
}
|
}
|
||||||
evas_list_free(events);
|
evas_list_free(events);
|
||||||
}
|
}
|
||||||
printf("############## fs done\n");
|
/* printf("############## fs done\n");*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
88
src/icons.c
88
src/icons.c
|
@ -63,6 +63,7 @@ e_icon_free(E_Icon *icon)
|
||||||
IF_FREE(icon->info.link);
|
IF_FREE(icon->info.link);
|
||||||
IF_FREE(icon->info.mime.base);
|
IF_FREE(icon->info.mime.base);
|
||||||
IF_FREE(icon->info.mime.type);
|
IF_FREE(icon->info.mime.type);
|
||||||
|
IF_FREE(icon->previous.icon);
|
||||||
FREE(icon);
|
FREE(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +96,8 @@ e_icon_place_grid(E_Icon *icon)
|
||||||
x = icon->view->options.arrange.grid.next_pos - (y * gw);
|
x = icon->view->options.arrange.grid.next_pos - (y * gw);
|
||||||
x *= icon->view->options.arrange.grid.w;
|
x *= icon->view->options.arrange.grid.w;
|
||||||
y *= icon->view->options.arrange.grid.h;
|
y *= icon->view->options.arrange.grid.h;
|
||||||
|
x += (icon->view->options.arrange.grid.w - icon->current.w) / 2;
|
||||||
|
y += (icon->view->options.arrange.grid.h - icon->current.h);
|
||||||
e_icon_set_xy(icon, x, y);
|
e_icon_set_xy(icon, x, y);
|
||||||
printf("GRID PLACE at %i %i\n", x, y);
|
printf("GRID PLACE at %i %i\n", x, y);
|
||||||
icon->view->options.arrange.grid.next_pos++;
|
icon->view->options.arrange.grid.next_pos++;
|
||||||
|
@ -186,6 +189,11 @@ e_icon_calulcate_geometry(E_Icon *icon)
|
||||||
icon->current.tw = tw;
|
icon->current.tw = tw;
|
||||||
icon->current.th = th;
|
icon->current.th = th;
|
||||||
}
|
}
|
||||||
|
if (INTERSECTS(0, 0, icon->view->size.w, icon->view->size.h,
|
||||||
|
icon->current.x, icon->current.y, icon->current.w, icon->current.h))
|
||||||
|
icon->current.viewable = 1;
|
||||||
|
else
|
||||||
|
icon->current.viewable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -310,21 +318,6 @@ e_icon_update(E_Icon *icon)
|
||||||
ebits_free(icon->obj.sel_icon);
|
ebits_free(icon->obj.sel_icon);
|
||||||
icon->obj.sel_icon = NULL;
|
icon->obj.sel_icon = NULL;
|
||||||
}
|
}
|
||||||
if ((icon->obj.icon) &&
|
|
||||||
(icon->current.icon) &&
|
|
||||||
((!icon->previous.icon) ||
|
|
||||||
((icon->previous.icon) &&
|
|
||||||
(!strcmp(icon->current.icon, icon->previous.icon)))))
|
|
||||||
{
|
|
||||||
int iw, ih;
|
|
||||||
|
|
||||||
printf("set file etc.\n");
|
|
||||||
evas_set_image_file(icon->view->evas, icon->obj.icon, icon->current.icon);
|
|
||||||
evas_get_image_size(icon->view->evas, icon->obj.icon, &iw, &ih);
|
|
||||||
evas_set_image_fill(icon->view->evas, icon->obj.icon, 0, 0, iw, ih);
|
|
||||||
evas_resize(icon->view->evas, icon->obj.icon, iw, ih);
|
|
||||||
icon->previous.x = icon->current.x - 1;
|
|
||||||
}
|
|
||||||
if (!icon->obj.filename)
|
if (!icon->obj.filename)
|
||||||
{
|
{
|
||||||
icon->obj.filename = evas_add_text(icon->view->evas, "borzoib", 8, icon->file);
|
icon->obj.filename = evas_add_text(icon->view->evas, "borzoib", 8, icon->file);
|
||||||
|
@ -333,13 +326,24 @@ e_icon_update(E_Icon *icon)
|
||||||
icon->previous.visible = icon->current.visible - 1;
|
icon->previous.visible = icon->current.visible - 1;
|
||||||
obj_new = 1;
|
obj_new = 1;
|
||||||
}
|
}
|
||||||
if (!icon->obj.icon)
|
if (((icon->previous.icon) && (icon->current.icon) &&
|
||||||
|
(strcmp(icon->current.icon, icon->previous.icon))) ||
|
||||||
|
((!icon->previous.icon) && (icon->current.icon)))
|
||||||
{
|
{
|
||||||
icon->obj.icon = evas_add_image_from_file(icon->view->evas, icon->current.icon);
|
int iw, ih;
|
||||||
evas_set_layer(icon->view->evas, icon->obj.icon, 10);
|
|
||||||
icon->previous.x = icon->current.x - 1;
|
if (!icon->obj.icon)
|
||||||
icon->previous.visible = icon->current.visible - 1;
|
{
|
||||||
obj_new = 1;
|
icon->obj.icon = evas_add_image_from_file(icon->view->evas, icon->current.icon);
|
||||||
|
evas_set_layer(icon->view->evas, icon->obj.icon, 10);
|
||||||
|
obj_new = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
evas_set_image_file(icon->view->evas, icon->obj.icon, icon->current.icon);
|
||||||
|
evas_get_image_size(icon->view->evas, icon->obj.icon, &iw, &ih);
|
||||||
|
evas_set_image_fill(icon->view->evas, icon->obj.icon, 0, 0, iw, ih);
|
||||||
|
evas_resize(icon->view->evas, icon->obj.icon, iw, ih);
|
||||||
|
icon->previous.x = icon->current.x - 1;
|
||||||
}
|
}
|
||||||
if ((!icon->obj.sel_icon) && (icon->current.state.selected))
|
if ((!icon->obj.sel_icon) && (icon->current.state.selected))
|
||||||
{
|
{
|
||||||
|
@ -369,28 +373,30 @@ e_icon_update(E_Icon *icon)
|
||||||
(obj_new))
|
(obj_new))
|
||||||
{
|
{
|
||||||
e_icon_calulcate_geometry(icon);
|
e_icon_calulcate_geometry(icon);
|
||||||
/* HRRRM - must optimize this*/
|
if (icon->current.viewable)
|
||||||
evas_move(icon->view->evas, icon->obj.icon, icon->current.ix, icon->current.iy);
|
|
||||||
evas_move(icon->view->evas, icon->obj.filename, icon->current.tx, icon->current.ty);
|
|
||||||
evas_move(icon->view->evas, icon->obj.sel1, icon->current.ix, icon->current.iy);
|
|
||||||
evas_resize(icon->view->evas, icon->obj.sel1, icon->current.iw, icon->current.ih);
|
|
||||||
evas_move(icon->view->evas, icon->obj.sel2, icon->current.tx, icon->current.ty);
|
|
||||||
evas_resize(icon->view->evas, icon->obj.sel2, icon->current.tw, icon->current.th);
|
|
||||||
evas_set_color(icon->view->evas, icon->obj.filename, 0, 0, 0, 255);
|
|
||||||
/**/ if (icon->obj.sel_icon)
|
|
||||||
{
|
{
|
||||||
int pl, pr, pt, pb;
|
evas_move(icon->view->evas, icon->obj.icon, icon->current.ix, icon->current.iy);
|
||||||
|
evas_move(icon->view->evas, icon->obj.filename, icon->current.tx, icon->current.ty);
|
||||||
pl = pr = pt = pb = 0;
|
evas_move(icon->view->evas, icon->obj.sel1, icon->current.ix, icon->current.iy);
|
||||||
ebits_get_insets(icon->obj.sel_icon, &pl, &pr, &pt, &pb);
|
evas_resize(icon->view->evas, icon->obj.sel1, icon->current.iw, icon->current.ih);
|
||||||
ebits_move(icon->obj.sel_icon, icon->current.ix - pl, icon->current.iy - pt);
|
evas_move(icon->view->evas, icon->obj.sel2, icon->current.tx, icon->current.ty);
|
||||||
ebits_resize(icon->obj.sel_icon, icon->current.iw + pl + pr, icon->current.ih + pt + pb);
|
evas_resize(icon->view->evas, icon->obj.sel2, icon->current.tw, icon->current.th);
|
||||||
}
|
evas_set_color(icon->view->evas, icon->obj.filename, 0, 0, 0, 255);
|
||||||
|
if (icon->obj.sel_icon)
|
||||||
|
{
|
||||||
|
int pl, pr, pt, pb;
|
||||||
|
|
||||||
|
pl = pr = pt = pb = 0;
|
||||||
|
ebits_get_insets(icon->obj.sel_icon, &pl, &pr, &pt, &pb);
|
||||||
|
ebits_move(icon->obj.sel_icon, icon->current.ix - pl, icon->current.iy - pt);
|
||||||
|
ebits_resize(icon->obj.sel_icon, icon->current.iw + pl + pr, icon->current.ih + pt + pb);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (icon->current.visible != icon->previous.visible)
|
if ((icon->current.visible != icon->previous.visible) || (obj_new) ||
|
||||||
|
(icon->current.viewable != icon->previous.viewable))
|
||||||
{
|
{
|
||||||
if (icon->current.visible)
|
if ((icon->current.visible) && (icon->current.viewable))
|
||||||
{
|
{
|
||||||
evas_show(icon->view->evas, icon->obj.icon);
|
evas_show(icon->view->evas, icon->obj.icon);
|
||||||
evas_show(icon->view->evas, icon->obj.filename);
|
evas_show(icon->view->evas, icon->obj.filename);
|
||||||
|
@ -407,7 +413,9 @@ e_icon_update(E_Icon *icon)
|
||||||
if (icon->obj.sel_icon) ebits_hide(icon->obj.sel_icon);
|
if (icon->obj.sel_icon) ebits_hide(icon->obj.sel_icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
IF_FREE(icon->previous.icon);
|
||||||
icon->previous = icon->current;
|
icon->previous = icon->current;
|
||||||
|
icon->previous.icon = strdup(icon->current.icon);
|
||||||
icon->changed = 0;
|
icon->changed = 0;
|
||||||
printf("... done\n");
|
printf("... done\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -907,7 +907,6 @@ e_view_update(E_View *v)
|
||||||
{
|
{
|
||||||
Evas_List l;
|
Evas_List l;
|
||||||
|
|
||||||
printf("view update\n");
|
|
||||||
if (v->changed)
|
if (v->changed)
|
||||||
{
|
{
|
||||||
for (l = v->icons; l; l = l->next)
|
for (l = v->icons; l; l = l->next)
|
||||||
|
@ -918,7 +917,6 @@ e_view_update(E_View *v)
|
||||||
e_icon_update(icon);
|
e_icon_update(icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("done\n");
|
|
||||||
if (v->options.back_pixmap)
|
if (v->options.back_pixmap)
|
||||||
{
|
{
|
||||||
Imlib_Updates up;
|
Imlib_Updates up;
|
||||||
|
|
Loading…
Reference in New Issue