|
From: <enl...@li...> - 2002-03-25 07:49:49
|
Enlightenment CVS committal
Author : tillsan
Project : e17
Module : apps/entice
Dir : e17/apps/entice/src/bin
Modified Files:
Tag: SPLIT
event.c fade.c fade.h globals.h handler.c image.c image.h
list.c list.h main.c misc.c thumb.c
Log Message:
Propagate Nolan's patch to SPLIT
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/event.c,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -3 -r1.2 -r1.2.2.1
--- event.c 17 Feb 2002 03:26:42 -0000 1.2
+++ event.c 25 Mar 2002 07:49:48 -0000 1.2.2.1
@@ -31,16 +31,21 @@
if (e_file_is_dir(im->file))
im->o_thumb = evas_add_image_from_file(evas,
IM"directory.png");
- else
- im->o_thumb = evas_add_image_from_file(evas,
- im->thumb);
+ else
+ im->o_thumb = evas_add_image_from_file(evas, im->thumb);
+
+ evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_MOVE,
+ e_list_item_drag, l);
evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_DOWN,
- e_list_click, l);
+ e_list_item_click, l);
+ evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_UP,
+ e_list_item_select, l);
evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_IN,
e_list_item_in, l);
evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_OUT,
e_list_item_out, l);
evas_get_image_size(evas, im->o_thumb, &w, &h);
+
im->subst = 0;
evas_move(evas, im->o_thumb,
2 + ((48 - w) / 2) + icon_x,
@@ -289,7 +294,8 @@
first = 0;
}
im->o_thumb = evas_add_image_from_file(evas, IM"thumb.png");
- evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_DOWN, e_list_click, l);
+ evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_DOWN, e_list_item_click, l);
+ evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_UP, e_list_item_select, l);
evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_IN, e_list_item_in, l);
evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_OUT, e_list_item_out, l);
im->subst = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/fade.c,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -3 -r1.1 -r1.1.2.1
--- fade.c 26 Oct 2001 05:08:09 -0000 1.1
+++ fade.c 25 Mar 2002 07:49:48 -0000 1.1.2.1
@@ -100,7 +100,40 @@
if (val < 1.0)
ecore_add_event_timer("e_fade_logo_in()", 0.05, e_fade_scroller_in, v + 1, data);
if (data)
- e_fade_scroller_out(0, NULL);
+ e_fade_scroller_out(0, NULL);
+}
+
+void e_fade_trash_in(int v, void *data)
+{
+ static double start = 0.0;
+ double duration = 0.5;
+ double val;
+
+ if (v == 0) start = get_time();
+ val = (get_time() - start) / duration;
+ if (val > 1.0) val = 1.0;
+
+ evas_set_color(evas, o_trash, 255, 255, 255, (val * 175));
+
+ if (val < 1.0)
+ ecore_add_event_timer("e_fade_trash_in()", 0.02, e_fade_trash_in, v + 1, NULL);
+}
+
+void e_fade_trash_out(int v, void *data)
+{
+ static double start = 0.0;
+ double duration = 0.5;
+ double val;
+
+ if (v == 0) start = get_time();
+ val = (get_time() - start) / duration;
+ if (val > 1.0) val = 1.0;
+ val = 1.0 - val;
+
+ evas_set_color(evas, o_trash, 255, 255, 255, (val * 175));
+
+ if (val > 0.0)
+ ecore_add_event_timer("e_fade_trash_out()", 0.02, e_fade_trash_out, v + 1, NULL);
}
void e_fade_scroller_out(int v, void *data)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/fade.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -3 -r1.1 -r1.1.2.1
--- fade.h 26 Oct 2001 05:08:09 -0000 1.1
+++ fade.h 25 Mar 2002 07:49:48 -0000 1.1.2.1
@@ -7,6 +7,9 @@
void e_fade_scroller_in(int v, void *data);
void e_fade_scroller_out(int v, void *data);
+void e_fade_trash_in(int v, void *data);
+void e_fade_trash_out(int v, void *data);
+
void e_fade_logo_in(int v, void *data);
void e_fade_l_arrow_in(int v, void *data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/globals.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -3 -r1.2 -r1.2.2.1
--- globals.h 17 Feb 2002 21:34:31 -0000 1.2
+++ globals.h 25 Mar 2002 07:49:48 -0000 1.2.2.1
@@ -28,6 +28,8 @@
extern Evas_Object o_bt_zoom_out;
extern Evas_Object o_txt_info[10];
extern Evas_Object o_txt_tip[5];
+extern Evas_Object icon_drag;
+extern Evas_Object o_trash;
extern char txt_info[2][4096];
@@ -48,6 +50,7 @@
extern int icon_x;
extern int icon_y;
+extern int dragging;
extern int panel_active;
extern int buttons_active;
extern int scroll_x;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/handler.c,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -3 -r1.2 -r1.2.2.1
--- handler.c 17 Feb 2002 21:34:31 -0000 1.2
+++ handler.c 25 Mar 2002 07:49:48 -0000 1.2.2.1
@@ -107,6 +107,21 @@
if (sy < -((h - win_h + 1) / 2)) sy = -((h - win_h + 1) / 2);
}
else sy = 0;
+ if (o_trash)
+ {
+ int dw, dh, r;
+
+ dh = (win_h / 4);
+ dw = (win_w / 4);
+ r = (dh + dw) / 2;
+ evas_set_image_fill(evas, o_trash, 0, 0, r, r);
+ evas_move(evas, o_trash, win_w - r, win_h - r);
+ evas_set_image_border(evas, o_trash, 4, 4, 4, 4);
+ evas_resize(evas, o_trash, r, r);
+ evas_set_layer(evas, o_trash, 200);
+ evas_show(evas, o_trash);
+ }
+
if (o_mini_image)
{
int ww, hh, sw, sh;
@@ -176,6 +191,7 @@
evas_set_layer(evas, o_arrow_b, 230);
e_handle_arrows();
+ e_scroll_list(0, NULL);
}
void e_handle_dnd(void)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/image.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -3 -r1.3 -r1.3.2.1
--- image.c 17 Feb 2002 21:34:31 -0000 1.3
+++ image.c 25 Mar 2002 07:49:48 -0000 1.3.2.1
@@ -133,7 +133,9 @@
/* printf("%s\n",im->file); */
im->o_thumb = evas_add_image_from_file(evas, IM"thumb.png");
- evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_DOWN, e_list_click, l);
+ evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_MOVE, e_list_item_drag, l);
+ evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_DOWN, e_list_item_click, l);
+ evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_UP, e_list_item_select, l);
evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_IN, e_list_item_in, l);
evas_callback_add(evas, im->o_thumb, CALLBACK_MOUSE_OUT, e_list_item_out, l);
im->subst = 1;
@@ -187,6 +189,16 @@
free(im);
}
+void image_delete(Image *im)
+{
+ if (im) {
+ if (im->o_thumb)
+ evas_del_object(evas, im->o_thumb);
+
+ images = evas_list_remove(images, (void *)im);
+ e_image_free(im); }
+}
+
void e_delete_current_image(void)
{
Evas_List l = NULL;
@@ -206,6 +218,8 @@
if (l != NULL) {
if (im->o_thumb) {
+ evas_callback_del(evas,im->o_thumb,CALLBACK_MOUSE_UP );
+ evas_callback_del(evas,im->o_thumb,CALLBACK_MOUSE_MOVE );
evas_callback_del(evas,im->o_thumb,CALLBACK_MOUSE_DOWN );
evas_callback_del(evas,im->o_thumb,CALLBACK_MOUSE_IN );
evas_callback_del(evas,im->o_thumb,CALLBACK_MOUSE_OUT );
@@ -227,6 +241,7 @@
scroll_y = 0;
scroll_sx = 0;
scroll_sy = 0;
+
if (o_mini_image)
{
evas_del_object(evas, o_mini_image);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/image.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -3 -r1.3 -r1.3.2.1
--- image.h 17 Feb 2002 21:34:31 -0000 1.3
+++ image.h 25 Mar 2002 07:49:48 -0000 1.3.2.1
@@ -11,6 +11,7 @@
Image *e_image_new(char *file);
void e_image_free(Image *im);
+void image_delete(Image *im);
void e_delete_current_image(void);
void e_display_current_image(void);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/list.c,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -3 -r1.1 -r1.1.2.1
--- list.c 26 Oct 2001 05:08:09 -0000 1.1
+++ list.c 25 Mar 2002 07:49:48 -0000 1.1.2.1
@@ -13,13 +13,74 @@
ecore_add_event_timer("e_scroll_list()", 0.05, e_scroll_list, v + 1, NULL);
}
-void e_list_click(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+void e_list_item_click(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
Image *im;
- Evas_List l=_data;
+ Evas_List l = _data;
+ int iw, ih;
+ double x, y, w, h;
+ im = l->data;
+
+ if (icon_drag)
+ evas_del_object(evas, icon_drag);
+
+ if (im->thumb && !icon_drag)
+ icon_drag = evas_add_image_from_file(evas, im->thumb);
+ else
+ icon_drag = NULL;
+
+ evas_get_image_size(evas, icon_drag, &iw, &ih);
+ evas_get_geometry(evas, im->o_thumb, &x, &y, &w, &h);
+ evas_set_layer(evas, icon_drag, 300);
+
+ evas_move(evas, icon_drag, ((x + (w / 2)) - (iw / 2)), ((y + (h / 2)) - (ih / 2)));
+ evas_hide(evas, icon_drag);
+}
+
+void e_list_item_drag(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+{
+ Image *im;
+ Evas_List l = _data;
+ int iw, ih;
+ double x, y, w, h;
- im=l->data;
+ im = l->data;
+
+ if (icon_drag) {
+ if (!dragging) {
+ dragging = 1;
+ e_list_item_zoom(-1 , _data);
+ e_fade_trash_in(0, (void *)1); }
+ evas_get_image_size(evas, icon_drag, &iw, &ih);
+ evas_show(evas, icon_drag);
+ evas_move(evas, icon_drag, (_x - (iw / 2)), (_y - (ih / 2)));
+ evas_get_geometry(evas, o_trash, &x, &y, &w, &h);
+ if ((_x > (int)x) && (_y > (int)y))
+ evas_set_color(evas, icon_drag, 200, 200, 200, 100);
+ else
+ evas_set_color(evas, icon_drag, 255, 255, 255, 255);
+ }
+}
+
+void e_list_item_select(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+{
+ Image *im;
+ Evas_List l = _data;
+
+ im = (Image *)(l->data);
+
+ if (dragging) {
+ e_fade_trash_out(0, NULL);
+ dragging = 0; }
+
+ if (icon_drag) {
+ evas_del_object(evas, icon_drag);
+ icon_drag = NULL;
+}
+
+
+
/* CS */
if( 0 )
/* if( e_file_is_dir(im->file) ) */
@@ -33,8 +94,15 @@
}
else
{
- current_image = _data;
- e_display_current_image();
+ double x, y, w, h;
+ evas_get_geometry(evas, o_trash, &x, &y, &w, &h);
+ if ((_x > (int)x) && (_y > (int)y)) {
+ e_list_item_zoom(-1 , _data);
+ image_delete(im);
+ e_display_current_image(); }
+ else {
+ current_image = _data;
+ e_display_current_image(); }
}
}
@@ -72,8 +140,8 @@
evas_get_image_size(evas, im->o_thumb, &iw, &ih);
evas_get_geometry(evas, im->o_thumb, &x, &y, &w, &h);
evas_set_layer(evas, zo, 300);
- nw = (double)iw * t * 2;
- nh = (double)ih * t * 2;
+ nw = (double)iw * t;
+ nh = (double)ih * t;
evas_move(evas, zo, x + w + (t * 32), y + (h - nh) / 2);
evas_resize(evas, zo, nw, nh);
evas_set_image_fill(evas, zo, 0, 0, nw, nh);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/list.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -3 -r1.1 -r1.1.2.1
--- list.h 26 Oct 2001 05:08:09 -0000 1.1
+++ list.h 25 Mar 2002 07:49:48 -0000 1.1.2.1
@@ -3,7 +3,9 @@
void e_scroll_list(int v, void *data);
-void e_list_click(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
+void e_list_item_drag(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
+void e_list_item_click(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
+void e_list_item_select(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
void e_list_item_zoom(int v, void *data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/main.c,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -3 -r1.2 -r1.2.2.1
--- main.c 17 Feb 2002 21:34:31 -0000 1.2
+++ main.c 25 Mar 2002 07:49:48 -0000 1.2.2.1
@@ -27,6 +27,9 @@
Evas_Object o_bt_zoom_out;
Evas_Object o_txt_info[10];
Evas_Object o_txt_tip[5];
+Evas_Object icon_drag;
+Evas_Object o_trash = NULL;
+
char txt_info[2][4096];
@@ -45,6 +48,7 @@
int icon_x = 0;
int icon_y = 0;
+int dragging = 0;
int panel_active = 0;
int buttons_active = 0;
int scroll_x = 0, scroll_y = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/misc.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -3 -r1.3 -r1.3.2.1
--- misc.c 17 Feb 2002 21:34:31 -0000 1.3
+++ misc.c 25 Mar 2002 07:49:48 -0000 1.3.2.1
@@ -81,6 +81,10 @@
o_bt_zoom_in = evas_add_image_from_file(evas, IM"bt_zoom_in_1.png");
o_bt_zoom_normal = evas_add_image_from_file(evas, IM"bt_zoom_normal_1.png");
o_bt_zoom_out = evas_add_image_from_file(evas, IM"bt_zoom_out_1.png");
+
+ o_trash = evas_add_image_from_file(evas, IM"trash.png");
+ evas_set_color(evas, o_trash, 255, 255, 255, 0);
+
evas_set_color(evas, o_logo, 255, 255, 255, 0);
evas_set_color(evas, o_showpanel, 0, 0, 0, 0);
evas_set_color(evas, o_hidepanel, 0, 0, 0, 0);
@@ -121,6 +125,8 @@
evas_show(evas, o_bt_zoom_normal);
evas_show(evas, o_bt_zoom_out);
+ evas_show(evas, o_trash);
+
e_slide_panel_out(0, NULL);
e_slide_buttons_out(0, NULL);
@@ -302,7 +308,7 @@
int iw, ih;
evas_get_image_size(evas, im->o_thumb, &iw, &ih);
- w = iw; h = ih;
+ w = iw / 2; h = ih / 2;
}
d = im_no - i;
if (d < 0) d = -d;
@@ -375,6 +381,5 @@
dnd_num_files = 0;
return;
}
-
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/thumb.c,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -3 -r1.1 -r1.1.2.1
--- thumb.c 26 Oct 2001 05:08:09 -0000 1.1
+++ thumb.c 25 Mar 2002 07:49:48 -0000 1.1.2.1
@@ -18,10 +18,10 @@
ih = 1;
if (w > h)
{
- if (w > 48)
+ if (w > 96)
{
- iw = 48;
- ih = (48 * h) / w;
+ iw = 96;
+ ih = (96 * h) / w;
}
else
{
@@ -31,10 +31,10 @@
}
else
{
- if (h > 48)
+ if (h > 96)
{
- ih = 48;
- iw = (48 * w) / h;
+ ih = 96;
+ iw = (96 * w) / h;
}
else
{
|