summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--data/backgrounds/view.bg.dbbin217088 -> 393216 bytes
-rw-r--r--src/Makefile.am1
-rw-r--r--src/text.c49
-rw-r--r--src/text.h46
-rw-r--r--src/view.c133
-rw-r--r--src/view.h2
7 files changed, 153 insertions, 82 deletions
diff --git a/Makefile.am b/Makefile.am
index a80ebd0a6..fa972a8ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,7 @@ install-data-local:
12 if test -d $(srcdir)/data; then \ 12 if test -d $(srcdir)/data; then \
13 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/data; \ 13 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/data; \
14 for d in $(srcdir)/data/*; do \ 14 for d in $(srcdir)/data/*; do \
15 cp -afr $$d $(DESTDIR)$(pkgdatadir)/data; \ 15 cp -dpRf $$d $(DESTDIR)$(pkgdatadir)/data; \
16 done \ 16 done \
17 fi 17 fi
18 18
@@ -20,7 +20,7 @@ dist-hook:
20 if test -d data; then \ 20 if test -d data; then \
21 mkdir $(distdir)/data; \ 21 mkdir $(distdir)/data; \
22 for d in data/*; do \ 22 for d in data/*; do \
23 cp -ar $$d $(distdir)/data; \ 23 cp -dpR $$d $(distdir)/data; \
24 done \ 24 done \
25 fi 25 fi
26 26
diff --git a/data/backgrounds/view.bg.db b/data/backgrounds/view.bg.db
index 1eb059de4..ed3efa86f 100644
--- a/data/backgrounds/view.bg.db
+++ b/data/backgrounds/view.bg.db
Binary files differ
diff --git a/src/Makefile.am b/src/Makefile.am
index 2803fa83f..be9bd6bd8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,6 +25,7 @@ enlightenment_SOURCES = \
25 pack.c \ 25 pack.c \
26 resist.h resist.c \ 26 resist.h resist.c \
27 shelf.c \ 27 shelf.c \
28 text.h text.c \
28 util.h util.c \ 29 util.h util.c \
29 view.h view.c \ 30 view.h view.c \
30 e.h 31 e.h
diff --git a/src/text.c b/src/text.c
new file mode 100644
index 000000000..dd3e1604b
--- /dev/null
+++ b/src/text.c
@@ -0,0 +1,49 @@
1#include "text.h"
2
3E_Text *
4e_text_new(Evas evas, char *text, char *class)
5{
6 E_Text *t;
7
8 t = NEW(E_Text, 1);
9 ZERO(t, E_Text, 1);
10 t->state = strdup("normal");
11 if (class) t->class = strdup(class);
12 else t->class = strdup("");
13 if (text) t->text = strdup(text);
14 else t->text = strdup("");
15 t->evas = evas;
16 t->obj = evas_add_text(t->evas, "borzoib", 8, t->text);
17 evas_set_color(t->evas, t->obj, 0, 0, 0, 255);
18 return t;
19}
20
21void e_text_free(E_Text *t)
22{
23 IF_FREE(t->state);
24 IF_FREE(t->class);
25 IF_FREE(t->text);
26
27 if ((t->evas) && (t->obj))
28 {
29 evas_del_object(t->evas, t->obj);
30 }
31 FREE(t);
32}
33
34void e_text_set_text(E_Text *t){}
35void e_text_set_layer(E_Text *t, int l){}
36void e_text_set_clip(E_Text *t, Evas_Object clip){}
37void e_text_unset_clip(E_Text *t){}
38void e_text_raise(E_Text *t){}
39void e_text_lower(E_Text *t){}
40void e_text_show(E_Text *t){}
41void e_text_hide(E_Text *t){}
42void e_text_set_color(E_Text *t, int r, int g, int b, int a){}
43void e_text_move(E_Text *t, double x, double y){}
44void e_text_resize(E_Text *t, double w, double h){}
45void e_text_get_geometry(E_Text *t, double *x, double *y, double *w, double *h){}
46void e_text_get_min_size(E_Text *t, double *w, double *h){}
47void e_text_get_max_size(E_Text *t, double *w, double *h){}
48void e_text_set_state(E_Text *t, char *state){}
49
diff --git a/src/text.h b/src/text.h
new file mode 100644
index 000000000..6dd1913c1
--- /dev/null
+++ b/src/text.h
@@ -0,0 +1,46 @@
1#ifndef E_TEXT_H
2#define E_TEXT_H
3
4#include "e.h"
5
6typedef struct _E_Text E_Text;
7
8struct _E_Text
9{
10 char *text;
11 char *class;
12 char *state;
13
14 int visible;
15 double x, y, w, h;
16 struct {
17 double w, h;
18 } min, max;
19 struct {
20 int r, g, b, a;
21 } color;
22 int layer;
23
24 Evas evas;
25 Evas_Object obj;
26};
27
28E_Text *e_text_new(Evas evas, char *text, char *class);
29void e_text_free(E_Text *t);
30void e_text_set_text(E_Text *t);
31void e_text_set_layer(E_Text *t, int l);
32void e_text_set_clip(E_Text *t, Evas_Object clip);
33void e_text_unset_clip(E_Text *t);
34void e_text_raise(E_Text *t);
35void e_text_lower(E_Text *t);
36void e_text_show(E_Text *t);
37void e_text_hide(E_Text *t);
38void e_text_set_color(E_Text *t, int r, int g, int b, int a);
39void e_text_move(E_Text *t, double x, double y);
40void e_text_resize(E_Text *t, double w, double h);
41void e_text_get_geometry(E_Text *t, double *x, double *y, double *w, double *h);
42void e_text_get_min_size(E_Text *t, double *w, double *h);
43void e_text_get_max_size(E_Text *t, double *w, double *h);
44void e_text_set_state(E_Text *t, char *state);
45
46#endif
diff --git a/src/view.c b/src/view.c
index 29d778b07..a7c0fa66c 100644
--- a/src/view.c
+++ b/src/view.c
@@ -43,6 +43,7 @@ static void e_view_handle_fs(EfsdEvent *ev);
43static void e_view_handle_fs_restart(void *data); 43static void e_view_handle_fs_restart(void *data);
44static void e_view_resort_timeout(int val, void *data); 44static void e_view_resort_timeout(int val, void *data);
45static int e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2); 45static int e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2);
46static void e_view_geometry_record_timeout(int val, void *data);
46 47
47void 48void
48e_view_selection_update(E_View *v) 49e_view_selection_update(E_View *v)
@@ -293,7 +294,6 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
293 } 294 }
294 } 295 }
295 } 296 }
296 /* errr. select files in box */
297 } 297 }
298 else 298 else
299 { 299 {
@@ -721,7 +721,6 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
721 { 721 {
722 if ((ic->state.selected) && (!ic->state.just_selected)) 722 if ((ic->state.selected) && (!ic->state.just_selected))
723 e_view_icon_deselect(ic); 723 e_view_icon_deselect(ic);
724/* e_view_icon_invert_selection(ic);*/
725 } 724 }
726 else 725 else
727 { 726 {
@@ -800,7 +799,6 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
800 } 799 }
801 } 800 }
802 e_window_get_geometry(0, NULL, NULL, &rw, &rh); 801 e_window_get_geometry(0, NULL, NULL, &rw, &rh);
803 printf("%i %i\n", ic->view->location.x, ic->view->location.y);
804 downx = ic->view->select.down.x + ic->view->location.x; 802 downx = ic->view->select.down.x + ic->view->location.x;
805 downy = ic->view->select.down.y + ic->view->location.y; 803 downy = ic->view->select.down.y + ic->view->location.y;
806 804
@@ -833,16 +831,6 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
833 ic->view->drag.win = e_window_override_new(0, wx, wy, ww, wh); 831 ic->view->drag.win = e_window_override_new(0, wx, wy, ww, wh);
834 pmap = e_pixmap_new(ic->view->drag.win, ww, wh, 0); 832 pmap = e_pixmap_new(ic->view->drag.win, ww, wh, 0);
835 mask = e_pixmap_new(ic->view->drag.win, ww, wh, 1); 833 mask = e_pixmap_new(ic->view->drag.win, ww, wh, 1);
836#if 0
837 {
838 GC gc;
839
840 gc = e_gc_new(mask);
841 e_gc_set_fg(gc, 0);
842 e_fill_rectangle(mask, gc, 0, 0, ww, wh);
843 e_gc_free(gc);
844 }
845#endif
846 { 834 {
847 Imlib_Image im; 835 Imlib_Image im;
848 836
@@ -924,39 +912,6 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
924 imlib_context_set_mask(mask); 912 imlib_context_set_mask(mask);
925 imlib_context_set_blend(0); 913 imlib_context_set_blend(0);
926 imlib_render_image_on_drawable(0, 0); 914 imlib_render_image_on_drawable(0, 0);
927#if 0
928 for (l = views; l; l = l->next)
929 {
930 E_View *v;
931 Evas_List ll;
932
933 v = l->data;
934 if (v->sel_count > 0)
935 {
936 for (ll = v->icons; ll; ll = ll->next)
937 {
938 E_Icon *ic;
939
940 ic = ll->data;
941 if (ic->state.selected)
942 {
943 double ix, iy, iw, ih;
944 int icx, icy, icw, ich;
945
946 evas_get_geometry(ic->view->evas,
947 ic->obj.icon,
948 &ix, &iy, &iw, &ih);
949 icx = ix + v->location.x - wx;
950 icy = iy + v->location.y - wy;
951 icw = iw;
952 ich = ih;
953 imlib_render_image_part_on_drawable_at_size(0, 0, icw, ich,
954 icx, icy, icw, ich);
955 }
956 }
957 }
958 }
959#endif
960 imlib_free_image(); 915 imlib_free_image();
961 } 916 }
962 e_window_set_background_pixmap(ic->view->drag.win, pmap); 917 e_window_set_background_pixmap(ic->view->drag.win, pmap);
@@ -1001,8 +956,51 @@ e_idle(void *data)
1001 UN(data); 956 UN(data);
1002} 957}
1003 958
1004static 959void
1005void e_configure(Eevent * ev) 960e_view_geometry_record(E_View *v)
961{
962 if (e_fs_get_connection())
963 {
964 int left, top;
965
966 e_window_get_frame_size(v->win.base, &left, NULL,
967 &top, NULL);
968 efsd_set_metadata_int(e_fs_get_connection(),
969 "/view/x", v->dir,
970 v->location.x - left);
971 efsd_set_metadata_int(e_fs_get_connection(),
972 "/view/y", v->dir,
973 v->location.y - top);
974 efsd_set_metadata_int(e_fs_get_connection(),
975 "/view/w", v->dir,
976 v->size.w);
977 efsd_set_metadata_int(e_fs_get_connection(),
978 "/view/h", v->dir,
979 v->size.h);
980 }
981}
982
983static void
984e_view_geometry_record_timeout(int val, void *data)
985{
986 E_View *v;
987
988 v = data;
989 e_view_geometry_record(v);
990 UN(val);
991}
992
993void
994e_view_queue_geometry_record(E_View *v)
995{
996 char name[4096];
997
998 sprintf(name, "geometry_record.%s", v->dir);
999 e_add_event_timer(name, 0.10, e_view_geometry_record_timeout, 0, v);
1000}
1001
1002static void
1003e_configure(Eevent * ev)
1006{ 1004{
1007 Ev_Window_Configure *e; 1005 Ev_Window_Configure *e;
1008 Evas_List l; 1006 Evas_List l;
@@ -1022,19 +1020,7 @@ void e_configure(Eevent * ev)
1022 { 1020 {
1023 v->location.x = e->x; 1021 v->location.x = e->x;
1024 v->location.y = e->y; 1022 v->location.y = e->y;
1025 if (e_fs_get_connection()) 1023 e_view_queue_geometry_record(v);
1026 {
1027 int left, top;
1028
1029 e_window_get_frame_size(v->win.base, &left, NULL,
1030 &top, NULL);
1031 efsd_set_metadata_int(e_fs_get_connection(),
1032 "/view/x", v->dir,
1033 v->location.x - left);
1034 efsd_set_metadata_int(e_fs_get_connection(),
1035 "/view/y", v->dir,
1036 v->location.y - top);
1037 }
1038 } 1024 }
1039 } 1025 }
1040 if ((e->w != v->size.w) || (e->h != v->size.h)) 1026 if ((e->w != v->size.w) || (e->h != v->size.h))
@@ -1060,15 +1046,7 @@ void e_configure(Eevent * ev)
1060 evas_set_output_viewport(v->evas, 0, 0, v->size.w, v->size.h); 1046 evas_set_output_viewport(v->evas, 0, 0, v->size.w, v->size.h);
1061 evas_set_output_size(v->evas, v->size.w, v->size.h); 1047 evas_set_output_size(v->evas, v->size.w, v->size.h);
1062 e_view_arrange(v); 1048 e_view_arrange(v);
1063 if (e_fs_get_connection()) 1049 e_view_queue_geometry_record(v);
1064 {
1065 efsd_set_metadata_int(e_fs_get_connection(),
1066 "/view/w", v->dir,
1067 v->size.w);
1068 efsd_set_metadata_int(e_fs_get_connection(),
1069 "/view/h", v->dir,
1070 v->size.h);
1071 }
1072 } 1050 }
1073 } 1051 }
1074 } 1052 }
@@ -1227,9 +1205,11 @@ e_key_down(Eevent * ev)
1227 } 1205 }
1228 else if (!strcmp(e->key, "Left")) 1206 else if (!strcmp(e->key, "Left"))
1229 { 1207 {
1208 e_view_scroll_by(v, 8, 0);
1230 } 1209 }
1231 else if (!strcmp(e->key, "Right")) 1210 else if (!strcmp(e->key, "Right"))
1232 { 1211 {
1212 e_view_scroll_by(v, 0, 8);
1233 } 1213 }
1234 else if (!strcmp(e->key, "Escape")) 1214 else if (!strcmp(e->key, "Escape"))
1235 { 1215 {
@@ -1917,6 +1897,8 @@ e_view_free(E_View *v)
1917 1897
1918 sprintf(name, "resort_timer.%s", v->dir); 1898 sprintf(name, "resort_timer.%s", v->dir);
1919 e_del_event_timer(name); 1899 e_del_event_timer(name);
1900 sprintf(name, "geometry_record.%s", v->dir);
1901 e_del_event_timer(name);
1920 1902
1921 views = evas_list_remove(views, v); 1903 views = evas_list_remove(views, v);
1922 efsd_stop_monitor(e_fs_get_connection(), v->dir, TRUE); 1904 efsd_stop_monitor(e_fs_get_connection(), v->dir, TRUE);
@@ -2312,7 +2294,6 @@ e_view_handle_fs(EfsdEvent *ev)
2312 if (v->is_desktop) continue; 2294 if (v->is_desktop) continue;
2313 if (v->geom_get.x == cmd) 2295 if (v->geom_get.x == cmd)
2314 { 2296 {
2315 printf("Got X\n");
2316 v->geom_get.x = 0; 2297 v->geom_get.x = 0;
2317 if (efsd_metadata_get_type(ev) == EFSD_INT) 2298 if (efsd_metadata_get_type(ev) == EFSD_INT)
2318 { 2299 {
@@ -2321,7 +2302,6 @@ e_view_handle_fs(EfsdEvent *ev)
2321 if (efsd_metadata_get_int(ev, 2302 if (efsd_metadata_get_int(ev,
2322 &(v->location.x))) 2303 &(v->location.x)))
2323 { 2304 {
2324 printf("mov x\n");
2325 e_window_move(v->win.base, 2305 e_window_move(v->win.base,
2326 v->location.x, 2306 v->location.x,
2327 v->location.y); 2307 v->location.y);
@@ -2335,7 +2315,6 @@ e_view_handle_fs(EfsdEvent *ev)
2335 } 2315 }
2336 else if (v->geom_get.y == cmd) 2316 else if (v->geom_get.y == cmd)
2337 { 2317 {
2338 printf("Got Y\n");
2339 v->geom_get.y = 0; 2318 v->geom_get.y = 0;
2340 if (efsd_metadata_get_type(ev) == EFSD_INT) 2319 if (efsd_metadata_get_type(ev) == EFSD_INT)
2341 { 2320 {
@@ -2344,7 +2323,6 @@ e_view_handle_fs(EfsdEvent *ev)
2344 if (efsd_metadata_get_int(ev, 2323 if (efsd_metadata_get_int(ev,
2345 &(v->location.y))) 2324 &(v->location.y)))
2346 { 2325 {
2347 printf("mov y\n");
2348 e_window_move(v->win.base, 2326 e_window_move(v->win.base,
2349 v->location.x, 2327 v->location.x,
2350 v->location.y); 2328 v->location.y);
@@ -2358,7 +2336,6 @@ e_view_handle_fs(EfsdEvent *ev)
2358 } 2336 }
2359 else if (v->geom_get.w == cmd) 2337 else if (v->geom_get.w == cmd)
2360 { 2338 {
2361 printf("Got W\n");
2362 v->geom_get.w = 0; 2339 v->geom_get.w = 0;
2363 if (efsd_metadata_get_type(ev) == EFSD_INT) 2340 if (efsd_metadata_get_type(ev) == EFSD_INT)
2364 { 2341 {
@@ -2375,7 +2352,6 @@ e_view_handle_fs(EfsdEvent *ev)
2375 } 2352 }
2376 else if (v->geom_get.h == cmd) 2353 else if (v->geom_get.h == cmd)
2377 { 2354 {
2378 printf("Got H\n");
2379 v->geom_get.h = 0; 2355 v->geom_get.h = 0;
2380 if (efsd_metadata_get_type(ev) == EFSD_INT) 2356 if (efsd_metadata_get_type(ev) == EFSD_INT)
2381 { 2357 {
@@ -2401,10 +2377,7 @@ e_view_handle_fs(EfsdEvent *ev)
2401 E_Border *b; 2377 E_Border *b;
2402 2378
2403 v->geom_get.busy = 0; 2379 v->geom_get.busy = 0;
2404 printf("ok.. adopt!\n"); 2380 e_background_set_size(v->bg, v->size.w, v->size.h);
2405 printf("at %i %i, %ix%i\n",
2406 v->location.x, v->location.y,
2407 v->size.w, v->size.h);
2408 if (v->options.back_pixmap) e_view_update(v); 2381 if (v->options.back_pixmap) e_view_update(v);
2409 b = e_border_adopt(v->win.base, 1); 2382 b = e_border_adopt(v->win.base, 1);
2410 } 2383 }
diff --git a/src/view.h b/src/view.h
index 24c4de3de..5c3f47fe9 100644
--- a/src/view.h
+++ b/src/view.h
@@ -199,6 +199,8 @@ void e_view_icon_apply_xy(E_Icon *ic);
199void e_view_resort_alphabetical(E_View *v); 199void e_view_resort_alphabetical(E_View *v);
200void e_view_arrange(E_View *v); 200void e_view_arrange(E_View *v);
201void e_view_resort(E_View *v); 201void e_view_resort(E_View *v);
202void e_view_queue_geometry_record(E_View *v);
203void e_view_geometry_record(E_View *v);
202void e_view_queue_resort(E_View *v); 204void e_view_queue_resort(E_View *v);
203void e_view_file_added(int id, char *file); 205void e_view_file_added(int id, char *file);
204void e_view_file_deleted(int id, char *file); 206void e_view_file_deleted(int id, char *file);