summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO10
-rw-r--r--data/themes/default_shelf.edc781
-rw-r--r--src/bin/.cvsignore1
-rw-r--r--src/bin/Makefile.am11
-rw-r--r--src/bin/e.h1
-rw-r--r--src/bin/e_border.c4
-rw-r--r--src/bin/e_border.h1
-rw-r--r--src/bin/e_config.c18
-rw-r--r--src/bin/e_config.h1
-rw-r--r--src/bin/e_fm.c1492
-rw-r--r--src/bin/e_fm.h8
-rw-r--r--src/bin/e_fm_main.c669
-rw-r--r--src/bin/e_fm_prop.c2
-rw-r--r--src/bin/e_fwin.c6
-rw-r--r--src/bin/e_int_config_apps.c8
-rw-r--r--src/bin/e_int_config_desklock.c1
-rw-r--r--src/bin/e_int_config_icon_themes.c1
-rw-r--r--src/bin/e_int_config_imc.c1
-rw-r--r--src/bin/e_int_config_shelf.c1
-rw-r--r--src/bin/e_int_config_startup.c1
-rw-r--r--src/bin/e_int_config_theme.c1
-rw-r--r--src/bin/e_int_config_wallpaper.c2
-rw-r--r--src/bin/e_int_shelf_config.c17
-rw-r--r--src/bin/e_ipc.c4
-rw-r--r--src/bin/e_ipc.h1
-rw-r--r--src/bin/e_main.c16
-rw-r--r--src/bin/e_shelf.c48
-rw-r--r--src/bin/e_shelf.h2
-rw-r--r--src/bin/e_sys.c4
-rw-r--r--src/bin/e_test.c2
-rw-r--r--src/bin/e_thumb.c2
-rw-r--r--src/bin/e_thumb_main.c11
-rw-r--r--src/bin/e_widget_fsel.c2
-rw-r--r--src/bin/e_winlist.c46
34 files changed, 2093 insertions, 1083 deletions
diff --git a/TODO b/TODO
index 7e089c438..80a6d620d 100644
--- a/TODO
+++ b/TODO
@@ -8,6 +8,16 @@ Some of the things (in very short form) that need to be done to E17...
8 BUGS / FIXES 8 BUGS / FIXES
9------------------------------------------------------------------------------- 9-------------------------------------------------------------------------------
10 10
11* shelf autohide uses mouse in/out events for the shelf object. this is not all
12 good as it conflicts with edge flip for desktops (if shelves slide off the
13 screen) also it doesn't account for window placement and sizing when the
14 shelf is hidden so you cant maximize to the now available region when the
15 shelf hides. i think hiding needs to be done noutside of the theme and by
16 the shelf itself. e will still emit signals to let the theme do things, but
17 e will also handle the hide/show based on a unified edge mouse event trap or
18 trap on the region the shelf would normally be in. also need a way to lock
19 the gadcon and thus gadcon asks shelf to lock in (stay visible) for things
20 like popping up menus, popups etc.
11* shelves seem to get confused with their contents if you have 3 shelves over 21* shelves seem to get confused with their contents if you have 3 shelves over
12 2 screens/zones - when you go back to 1 screen form 2, one of the shelves 22 2 screens/zones - when you go back to 1 screen form 2, one of the shelves
13 gts the contents from the now non-existant shelf. 23 gts the contents from the now non-existant shelf.
diff --git a/data/themes/default_shelf.edc b/data/themes/default_shelf.edc
index 53097342e..ddb9a0145 100644
--- a/data/themes/default_shelf.edc
+++ b/data/themes/default_shelf.edc
@@ -15,10 +15,101 @@ group {
15 } 15 }
16 parts { 16 parts {
17 part { 17 part {
18 name: "item_clip_bottom";
19 type: RECT;
20 mouse_events: 0;
21 description {
22 state: "default" 0.0;
23 color: 255 255 255 0;
24 }
25 description {
26 state: "hidden" 0.0;
27 inherit: "default" 0.0;
28 rel1 {
29 relative: 0.0 1.0;
30 offset: 0 -2;
31 }
32 rel2 {
33 relative: 1.0 2.0;
34 offset: -1 -3;
35 }
36 }
37 }
38 part {
39 name: "item_clip_top";
40 type: RECT;
41 mouse_events: 0;
42 description {
43 state: "default" 0.0;
44 color: 255 255 255 0;
45 }
46 description {
47 state: "hidden" 0.0;
48 inherit: "default" 0.0;
49 rel1 {
50 relative: 0.0 -1.0;
51 offset: 0 2;
52 }
53 rel2 {
54 relative: 1.0 0.0;
55 offset: -1 1;
56 }
57 }
58 }
59 part {
60 name: "item_clip_left";
61 type: RECT;
62 mouse_events: 0;
63 description {
64 state: "default" 0.0;
65 color: 255 255 255 0;
66 }
67 description {
68 state: "hidden" 0.0;
69 inherit: "default" 0.0;
70 rel1 {
71 relative: -1.0 0.0;
72 offset: 2 0;
73 }
74 rel2 {
75 relative: 0.0 1.0;
76 offset: 1 -1;
77 }
78 }
79 }
80 part {
81 name: "item_clip_right";
82 type: RECT;
83 mouse_events: 0;
84 description {
85 state: "default" 0.0;
86 color: 255 255 255 0;
87 }
88 description {
89 state: "hidden" 0.0;
90 inherit: "default" 0.0;
91 rel1 {
92 relative: 1.0 0.0;
93 offset: -2 0;
94 }
95 rel2 {
96 relative: 2.0 1.0;
97 offset: -3 -1;
98 }
99 }
100 }
101 part {
18 name: "base"; 102 name: "base";
19 mouse_events: 0; 103 mouse_events: 0;
104// clip_to: "item_clip";
20 description { 105 description {
21 state: "default" 0.0; 106 state: "default" 0.0;
107 rel1 {
108 to: "item_clip_top";
109 }
110 rel2 {
111 to: "item_clip_top";
112 }
22 image { 113 image {
23 normal: "e17_shelf_bg_h.png"; 114 normal: "e17_shelf_bg_h.png";
24 border: 19 19 9 9; 115 border: 19 19 9 9;
@@ -35,6 +126,12 @@ group {
35 description { 126 description {
36 state: "top_left" 0.0; 127 state: "top_left" 0.0;
37 inherit: "default" 0.0; 128 inherit: "default" 0.0;
129 rel1 {
130 to: "item_clip_top";
131 }
132 rel2 {
133 to: "item_clip_top";
134 }
38 fill { 135 fill {
39 origin { 136 origin {
40 offset: -16 -6; 137 offset: -16 -6;
@@ -47,6 +144,12 @@ group {
47 description { 144 description {
48 state: "top_right" 0.0; 145 state: "top_right" 0.0;
49 inherit: "default" 0.0; 146 inherit: "default" 0.0;
147 rel1 {
148 to: "item_clip_top";
149 }
150 rel2 {
151 to: "item_clip_top";
152 }
50 fill { 153 fill {
51 origin { 154 origin {
52 offset: 0 -6; 155 offset: 0 -6;
@@ -59,6 +162,12 @@ group {
59 description { 162 description {
60 state: "bottom" 0.0; 163 state: "bottom" 0.0;
61 inherit: "default" 0.0; 164 inherit: "default" 0.0;
165 rel1 {
166 to: "item_clip_bottom";
167 }
168 rel2 {
169 to: "item_clip_bottom";
170 }
62 fill { 171 fill {
63 origin { 172 origin {
64 offset: 0 0; 173 offset: 0 0;
@@ -71,6 +180,12 @@ group {
71 description { 180 description {
72 state: "bottom_left" 0.0; 181 state: "bottom_left" 0.0;
73 inherit: "default" 0.0; 182 inherit: "default" 0.0;
183 rel1 {
184 to: "item_clip_bottom";
185 }
186 rel2 {
187 to: "item_clip_bottom";
188 }
74 fill { 189 fill {
75 origin { 190 origin {
76 offset: -16 0; 191 offset: -16 0;
@@ -83,6 +198,12 @@ group {
83 description { 198 description {
84 state: "bottom_right" 0.0; 199 state: "bottom_right" 0.0;
85 inherit: "default" 0.0; 200 inherit: "default" 0.0;
201 rel1 {
202 to: "item_clip_bottom";
203 }
204 rel2 {
205 to: "item_clip_bottom";
206 }
86 fill { 207 fill {
87 origin { 208 origin {
88 offset: 0 0; 209 offset: 0 0;
@@ -94,6 +215,13 @@ group {
94 } 215 }
95 description { 216 description {
96 state: "left" 0.0; 217 state: "left" 0.0;
218 inherit: "default" 0.0;
219 rel1 {
220 to: "item_clip_left";
221 }
222 rel2 {
223 to: "item_clip_left";
224 }
97 image { 225 image {
98 normal: "e17_shelf_bg_v.png"; 226 normal: "e17_shelf_bg_v.png";
99 border: 9 9 19 19; 227 border: 9 9 19 19;
@@ -109,6 +237,13 @@ group {
109 } 237 }
110 description { 238 description {
111 state: "left_top" 0.0; 239 state: "left_top" 0.0;
240 inherit: "default" 0.0;
241 rel1 {
242 to: "item_clip_left";
243 }
244 rel2 {
245 to: "item_clip_left";
246 }
112 image { 247 image {
113 normal: "e17_shelf_bg_v.png"; 248 normal: "e17_shelf_bg_v.png";
114 border: 9 9 19 19; 249 border: 9 9 19 19;
@@ -124,6 +259,13 @@ group {
124 } 259 }
125 description { 260 description {
126 state: "left_bottom" 0.0; 261 state: "left_bottom" 0.0;
262 inherit: "default" 0.0;
263 rel1 {
264 to: "item_clip_left";
265 }
266 rel2 {
267 to: "item_clip_left";
268 }
127 image { 269 image {
128 normal: "e17_shelf_bg_v.png"; 270 normal: "e17_shelf_bg_v.png";
129 border: 9 9 19 19; 271 border: 9 9 19 19;
@@ -139,6 +281,13 @@ group {
139 } 281 }
140 description { 282 description {
141 state: "right" 0.0; 283 state: "right" 0.0;
284 inherit: "default" 0.0;
285 rel1 {
286 to: "item_clip_right";
287 }
288 rel2 {
289 to: "item_clip_right";
290 }
142 image { 291 image {
143 normal: "e17_shelf_bg_v.png"; 292 normal: "e17_shelf_bg_v.png";
144 border: 9 9 19 19; 293 border: 9 9 19 19;
@@ -154,6 +303,13 @@ group {
154 } 303 }
155 description { 304 description {
156 state: "right_top" 0.0; 305 state: "right_top" 0.0;
306 inherit: "default" 0.0;
307 rel1 {
308 to: "item_clip_right";
309 }
310 rel2 {
311 to: "item_clip_right";
312 }
157 image { 313 image {
158 normal: "e17_shelf_bg_v.png"; 314 normal: "e17_shelf_bg_v.png";
159 border: 9 9 19 19; 315 border: 9 9 19 19;
@@ -169,6 +325,13 @@ group {
169 } 325 }
170 description { 326 description {
171 state: "right_bottom" 0.0; 327 state: "right_bottom" 0.0;
328 inherit: "default" 0.0;
329 rel1 {
330 to: "item_clip_right";
331 }
332 rel2 {
333 to: "item_clip_right";
334 }
172 image { 335 image {
173 normal: "e17_shelf_bg_v.png"; 336 normal: "e17_shelf_bg_v.png";
174 border: 9 9 19 19; 337 border: 9 9 19 19;
@@ -187,134 +350,170 @@ group {
187 name: "e.swallow.content"; 350 name: "e.swallow.content";
188 mouse_events: 0; 351 mouse_events: 0;
189 type: SWALLOW; 352 type: SWALLOW;
353// clip_to: "item_clip";
190 description { 354 description {
191 state: "default" 0.0; 355 state: "default" 0.0;
192 rel1 { 356 rel1 {
357 to: "item_clip_top";
193 relative: 0.0 0.0; 358 relative: 0.0 0.0;
194 offset: 18 2; 359 offset: 18 2;
195 } 360 }
196 rel2 { 361 rel2 {
362 to: "item_clip_top";
197 relative: 1.0 1.0; 363 relative: 1.0 1.0;
198 offset: -19 -3; 364 offset: -19 -3;
199 } 365 }
200 } 366 }
201 description { 367 description {
202 state: "top_left" 0.0; 368 state: "top_left" 0.0;
369 inherit: "default" 0.0;
203 rel1 { 370 rel1 {
371 to: "item_clip_top";
204 relative: 0.0 0.0; 372 relative: 0.0 0.0;
205 offset: 2 2; 373 offset: 2 2;
206 } 374 }
207 rel2 { 375 rel2 {
376 to: "item_clip_top";
208 relative: 1.0 1.0; 377 relative: 1.0 1.0;
209 offset: -19 -3; 378 offset: -19 -3;
210 } 379 }
211 } 380 }
212 description { 381 description {
213 state: "top_right" 0.0; 382 state: "top_right" 0.0;
383 inherit: "default" 0.0;
214 rel1 { 384 rel1 {
385 to: "item_clip_top";
215 relative: 0.0 0.0; 386 relative: 0.0 0.0;
216 offset: 18 2; 387 offset: 18 2;
217 } 388 }
218 rel2 { 389 rel2 {
390 to: "item_clip_top";
219 relative: 1.0 1.0; 391 relative: 1.0 1.0;
220 offset: -3 -3; 392 offset: -3 -3;
221 } 393 }
222 } 394 }
223 description { 395 description {
224 state: "bottom" 0.0; 396 state: "bottom" 0.0;
397 inherit: "default" 0.0;
225 rel1 { 398 rel1 {
399 to: "item_clip_bottom";
226 relative: 0.0 0.0; 400 relative: 0.0 0.0;
227 offset: 18 2; 401 offset: 18 2;
228 } 402 }
229 rel2 { 403 rel2 {
404 to: "item_clip_bottom";
230 relative: 1.0 1.0; 405 relative: 1.0 1.0;
231 offset: -19 -3; 406 offset: -19 -3;
232 } 407 }
233 } 408 }
234 description { 409 description {
235 state: "bottom_left" 0.0; 410 state: "bottom_left" 0.0;
411 inherit: "default" 0.0;
236 rel1 { 412 rel1 {
413 to: "item_clip_bottom";
237 relative: 0.0 0.0; 414 relative: 0.0 0.0;
238 offset: 2 2; 415 offset: 2 2;
239 } 416 }
240 rel2 { 417 rel2 {
418 to: "item_clip_bottom";
241 relative: 1.0 1.0; 419 relative: 1.0 1.0;
242 offset: -19 -3; 420 offset: -19 -3;
243 } 421 }
244 } 422 }
245 description { 423 description {
246 state: "bottom_right" 0.0; 424 state: "bottom_right" 0.0;
425 inherit: "default" 0.0;
247 rel1 { 426 rel1 {
427 to: "item_clip_bottom";
248 relative: 0.0 0.0; 428 relative: 0.0 0.0;
249 offset: 18 2; 429 offset: 18 2;
250 } 430 }
251 rel2 { 431 rel2 {
432 to: "item_clip_bottom";
252 relative: 1.0 1.0; 433 relative: 1.0 1.0;
253 offset: -3 -3; 434 offset: -3 -3;
254 } 435 }
255 } 436 }
256 description { 437 description {
257 state: "left" 0.0; 438 state: "left" 0.0;
439 inherit: "default" 0.0;
258 rel1 { 440 rel1 {
441 to: "item_clip_left";
259 relative: 0.0 0.0; 442 relative: 0.0 0.0;
260 offset: 2 18; 443 offset: 2 18;
261 } 444 }
262 rel2 { 445 rel2 {
446 to: "item_clip_left";
263 relative: 1.0 1.0; 447 relative: 1.0 1.0;
264 offset: -3 -19; 448 offset: -3 -19;
265 } 449 }
266 } 450 }
267 description { 451 description {
268 state: "left_top" 0.0; 452 state: "left_top" 0.0;
453 inherit: "default" 0.0;
269 rel1 { 454 rel1 {
455 to: "item_clip_left";
270 relative: 0.0 0.0; 456 relative: 0.0 0.0;
271 offset: 2 2; 457 offset: 2 2;
272 } 458 }
273 rel2 { 459 rel2 {
460 to: "item_clip_left";
274 relative: 1.0 1.0; 461 relative: 1.0 1.0;
275 offset: -3 -19; 462 offset: -3 -19;
276 } 463 }
277 } 464 }
278 description { 465 description {
279 state: "left_bottom" 0.0; 466 state: "left_bottom" 0.0;
467 inherit: "default" 0.0;
280 rel1 { 468 rel1 {
469 to: "item_clip_left";
281 relative: 0.0 0.0; 470 relative: 0.0 0.0;
282 offset: 2 18; 471 offset: 2 18;
283 } 472 }
284 rel2 { 473 rel2 {
474 to: "item_clip_left";
285 relative: 1.0 1.0; 475 relative: 1.0 1.0;
286 offset: -3 -3; 476 offset: -3 -3;
287 } 477 }
288 } 478 }
289 description { 479 description {
290 state: "right" 0.0; 480 state: "right" 0.0;
481 inherit: "default" 0.0;
291 rel1 { 482 rel1 {
483 to: "item_clip_right";
292 relative: 0.0 0.0; 484 relative: 0.0 0.0;
293 offset: 2 18; 485 offset: 2 18;
294 } 486 }
295 rel2 { 487 rel2 {
488 to: "item_clip_right";
296 relative: 1.0 1.0; 489 relative: 1.0 1.0;
297 offset: -3 -19; 490 offset: -3 -19;
298 } 491 }
299 } 492 }
300 description { 493 description {
301 state: "right_top" 0.0; 494 state: "right_top" 0.0;
495 inherit: "default" 0.0;
302 rel1 { 496 rel1 {
497 to: "item_clip_right";
303 relative: 0.0 0.0; 498 relative: 0.0 0.0;
304 offset: 2 2; 499 offset: 2 2;
305 } 500 }
306 rel2 { 501 rel2 {
502 to: "item_clip_right";
307 relative: 1.0 1.0; 503 relative: 1.0 1.0;
308 offset: -3 -19; 504 offset: -3 -19;
309 } 505 }
310 } 506 }
311 description { 507 description {
312 state: "right_bottom" 0.0; 508 state: "right_bottom" 0.0;
509 inherit: "default" 0.0;
313 rel1 { 510 rel1 {
511 to: "item_clip_right";
314 relative: 0.0 0.0; 512 relative: 0.0 0.0;
315 offset: 2 18; 513 offset: 2 18;
316 } 514 }
317 rel2 { 515 rel2 {
516 to: "item_clip_right";
318 relative: 1.0 1.0; 517 relative: 1.0 1.0;
319 offset: -3 -3; 518 offset: -3 -3;
320 } 519 }
@@ -323,6 +522,28 @@ group {
323 } 522 }
324 programs { 523 programs {
325 program { 524 program {
525 name: "hide";
526 signal: "e,state,hidden";
527 source: "e";
528 action: STATE_SET "hidden" 0.0;
529 transition: ACCELERATE 0.3;
530 target: "item_clip_bottom";
531 target: "item_clip_top";
532 target: "item_clip_left";
533 target: "item_clip_right";
534 }
535 program {
536 name: "show";
537 signal: "e,state,visible";
538 source: "e";
539 transition: DECELERATE 0.3;
540 action: STATE_SET "default" 0.0;
541 target: "item_clip_bottom";
542 target: "item_clip_top";
543 target: "item_clip_left";
544 target: "item_clip_right";
545 }
546 program {
326 name: "orient1"; 547 name: "orient1";
327 signal: "e,state,orientation,top"; 548 signal: "e,state,orientation,top";
328 source: "e"; 549 source: "e";
@@ -553,6 +774,7 @@ group {
553 774
554 775
555 776
777
556group { 778group {
557 name: "e/shelf/gold/base"; 779 name: "e/shelf/gold/base";
558 data { 780 data {
@@ -561,10 +783,101 @@ group {
561 } 783 }
562 parts { 784 parts {
563 part { 785 part {
786 name: "item_clip_bottom";
787 type: RECT;
788 mouse_events: 0;
789 description {
790 state: "default" 0.0;
791 color: 255 255 255 0;
792 }
793 description {
794 state: "hidden" 0.0;
795 inherit: "default" 0.0;
796 rel1 {
797 relative: 0.0 1.0;
798 offset: 0 -2;
799 }
800 rel2 {
801 relative: 1.0 2.0;
802 offset: -1 -3;
803 }
804 }
805 }
806 part {
807 name: "item_clip_top";
808 type: RECT;
809 mouse_events: 0;
810 description {
811 state: "default" 0.0;
812 color: 255 255 255 0;
813 }
814 description {
815 state: "hidden" 0.0;
816 inherit: "default" 0.0;
817 rel1 {
818 relative: 0.0 -1.0;
819 offset: 0 2;
820 }
821 rel2 {
822 relative: 1.0 0.0;
823 offset: -1 1;
824 }
825 }
826 }
827 part {
828 name: "item_clip_left";
829 type: RECT;
830 mouse_events: 0;
831 description {
832 state: "default" 0.0;
833 color: 255 255 255 0;
834 }
835 description {
836 state: "hidden" 0.0;
837 inherit: "default" 0.0;
838 rel1 {
839 relative: -1.0 0.0;
840 offset: 2 0;
841 }
842 rel2 {
843 relative: 0.0 1.0;
844 offset: 1 -1;
845 }
846 }
847 }
848 part {
849 name: "item_clip_right";
850 type: RECT;
851 mouse_events: 0;
852 description {
853 state: "default" 0.0;
854 color: 255 255 255 0;
855 }
856 description {
857 state: "hidden" 0.0;
858 inherit: "default" 0.0;
859 rel1 {
860 relative: 1.0 0.0;
861 offset: -2 0;
862 }
863 rel2 {
864 relative: 2.0 1.0;
865 offset: -3 -1;
866 }
867 }
868 }
869 part {
564 name: "base"; 870 name: "base";
565 mouse_events: 0; 871 mouse_events: 0;
872// clip_to: "item_clip";
566 description { 873 description {
567 state: "default" 0.0; 874 state: "default" 0.0;
875 rel1 {
876 to: "item_clip_top";
877 }
878 rel2 {
879 to: "item_clip_top";
880 }
568 image { 881 image {
569 normal: "e17_shelf_bg2_h.png"; 882 normal: "e17_shelf_bg2_h.png";
570 border: 19 19 9 9; 883 border: 19 19 9 9;
@@ -581,6 +894,12 @@ group {
581 description { 894 description {
582 state: "top_left" 0.0; 895 state: "top_left" 0.0;
583 inherit: "default" 0.0; 896 inherit: "default" 0.0;
897 rel1 {
898 to: "item_clip_top";
899 }
900 rel2 {
901 to: "item_clip_top";
902 }
584 fill { 903 fill {
585 origin { 904 origin {
586 offset: -16 -6; 905 offset: -16 -6;
@@ -593,6 +912,12 @@ group {
593 description { 912 description {
594 state: "top_right" 0.0; 913 state: "top_right" 0.0;
595 inherit: "default" 0.0; 914 inherit: "default" 0.0;
915 rel1 {
916 to: "item_clip_top";
917 }
918 rel2 {
919 to: "item_clip_top";
920 }
596 fill { 921 fill {
597 origin { 922 origin {
598 offset: 0 -6; 923 offset: 0 -6;
@@ -605,6 +930,12 @@ group {
605 description { 930 description {
606 state: "bottom" 0.0; 931 state: "bottom" 0.0;
607 inherit: "default" 0.0; 932 inherit: "default" 0.0;
933 rel1 {
934 to: "item_clip_bottom";
935 }
936 rel2 {
937 to: "item_clip_bottom";
938 }
608 fill { 939 fill {
609 origin { 940 origin {
610 offset: 0 0; 941 offset: 0 0;
@@ -617,6 +948,12 @@ group {
617 description { 948 description {
618 state: "bottom_left" 0.0; 949 state: "bottom_left" 0.0;
619 inherit: "default" 0.0; 950 inherit: "default" 0.0;
951 rel1 {
952 to: "item_clip_bottom";
953 }
954 rel2 {
955 to: "item_clip_bottom";
956 }
620 fill { 957 fill {
621 origin { 958 origin {
622 offset: -16 0; 959 offset: -16 0;
@@ -629,6 +966,12 @@ group {
629 description { 966 description {
630 state: "bottom_right" 0.0; 967 state: "bottom_right" 0.0;
631 inherit: "default" 0.0; 968 inherit: "default" 0.0;
969 rel1 {
970 to: "item_clip_bottom";
971 }
972 rel2 {
973 to: "item_clip_bottom";
974 }
632 fill { 975 fill {
633 origin { 976 origin {
634 offset: 0 0; 977 offset: 0 0;
@@ -640,6 +983,13 @@ group {
640 } 983 }
641 description { 984 description {
642 state: "left" 0.0; 985 state: "left" 0.0;
986 inherit: "default" 0.0;
987 rel1 {
988 to: "item_clip_left";
989 }
990 rel2 {
991 to: "item_clip_left";
992 }
643 image { 993 image {
644 normal: "e17_shelf_bg2_v.png"; 994 normal: "e17_shelf_bg2_v.png";
645 border: 9 9 19 19; 995 border: 9 9 19 19;
@@ -655,6 +1005,13 @@ group {
655 } 1005 }
656 description { 1006 description {
657 state: "left_top" 0.0; 1007 state: "left_top" 0.0;
1008 inherit: "default" 0.0;
1009 rel1 {
1010 to: "item_clip_left";
1011 }
1012 rel2 {
1013 to: "item_clip_left";
1014 }
658 image { 1015 image {
659 normal: "e17_shelf_bg2_v.png"; 1016 normal: "e17_shelf_bg2_v.png";
660 border: 9 9 19 19; 1017 border: 9 9 19 19;
@@ -670,6 +1027,13 @@ group {
670 } 1027 }
671 description { 1028 description {
672 state: "left_bottom" 0.0; 1029 state: "left_bottom" 0.0;
1030 inherit: "default" 0.0;
1031 rel1 {
1032 to: "item_clip_left";
1033 }
1034 rel2 {
1035 to: "item_clip_left";
1036 }
673 image { 1037 image {
674 normal: "e17_shelf_bg2_v.png"; 1038 normal: "e17_shelf_bg2_v.png";
675 border: 9 9 19 19; 1039 border: 9 9 19 19;
@@ -685,6 +1049,13 @@ group {
685 } 1049 }
686 description { 1050 description {
687 state: "right" 0.0; 1051 state: "right" 0.0;
1052 inherit: "default" 0.0;
1053 rel1 {
1054 to: "item_clip_right";
1055 }
1056 rel2 {
1057 to: "item_clip_right";
1058 }
688 image { 1059 image {
689 normal: "e17_shelf_bg2_v.png"; 1060 normal: "e17_shelf_bg2_v.png";
690 border: 9 9 19 19; 1061 border: 9 9 19 19;
@@ -700,6 +1071,13 @@ group {
700 } 1071 }
701 description { 1072 description {
702 state: "right_top" 0.0; 1073 state: "right_top" 0.0;
1074 inherit: "default" 0.0;
1075 rel1 {
1076 to: "item_clip_right";
1077 }
1078 rel2 {
1079 to: "item_clip_right";
1080 }
703 image { 1081 image {
704 normal: "e17_shelf_bg2_v.png"; 1082 normal: "e17_shelf_bg2_v.png";
705 border: 9 9 19 19; 1083 border: 9 9 19 19;
@@ -715,6 +1093,13 @@ group {
715 } 1093 }
716 description { 1094 description {
717 state: "right_bottom" 0.0; 1095 state: "right_bottom" 0.0;
1096 inherit: "default" 0.0;
1097 rel1 {
1098 to: "item_clip_right";
1099 }
1100 rel2 {
1101 to: "item_clip_right";
1102 }
718 image { 1103 image {
719 normal: "e17_shelf_bg2_v.png"; 1104 normal: "e17_shelf_bg2_v.png";
720 border: 9 9 19 19; 1105 border: 9 9 19 19;
@@ -733,134 +1118,170 @@ group {
733 name: "e.swallow.content"; 1118 name: "e.swallow.content";
734 mouse_events: 0; 1119 mouse_events: 0;
735 type: SWALLOW; 1120 type: SWALLOW;
1121// clip_to: "item_clip";
736 description { 1122 description {
737 state: "default" 0.0; 1123 state: "default" 0.0;
738 rel1 { 1124 rel1 {
1125 to: "item_clip_top";
739 relative: 0.0 0.0; 1126 relative: 0.0 0.0;
740 offset: 18 2; 1127 offset: 18 2;
741 } 1128 }
742 rel2 { 1129 rel2 {
1130 to: "item_clip_top";
743 relative: 1.0 1.0; 1131 relative: 1.0 1.0;
744 offset: -19 -3; 1132 offset: -19 -3;
745 } 1133 }
746 } 1134 }
747 description { 1135 description {
748 state: "top_left" 0.0; 1136 state: "top_left" 0.0;
1137 inherit: "default" 0.0;
749 rel1 { 1138 rel1 {
1139 to: "item_clip_top";
750 relative: 0.0 0.0; 1140 relative: 0.0 0.0;
751 offset: 2 2; 1141 offset: 2 2;
752 } 1142 }
753 rel2 { 1143 rel2 {
1144 to: "item_clip_top";
754 relative: 1.0 1.0; 1145 relative: 1.0 1.0;
755 offset: -19 -3; 1146 offset: -19 -3;
756 } 1147 }
757 } 1148 }
758 description { 1149 description {
759 state: "top_right" 0.0; 1150 state: "top_right" 0.0;
1151 inherit: "default" 0.0;
760 rel1 { 1152 rel1 {
1153 to: "item_clip_top";
761 relative: 0.0 0.0; 1154 relative: 0.0 0.0;
762 offset: 18 2; 1155 offset: 18 2;
763 } 1156 }
764 rel2 { 1157 rel2 {
1158 to: "item_clip_top";
765 relative: 1.0 1.0; 1159 relative: 1.0 1.0;
766 offset: -3 -3; 1160 offset: -3 -3;
767 } 1161 }
768 } 1162 }
769 description { 1163 description {
770 state: "bottom" 0.0; 1164 state: "bottom" 0.0;
1165 inherit: "default" 0.0;
771 rel1 { 1166 rel1 {
1167 to: "item_clip_bottom";
772 relative: 0.0 0.0; 1168 relative: 0.0 0.0;
773 offset: 18 2; 1169 offset: 18 2;
774 } 1170 }
775 rel2 { 1171 rel2 {
1172 to: "item_clip_bottom";
776 relative: 1.0 1.0; 1173 relative: 1.0 1.0;
777 offset: -19 -3; 1174 offset: -19 -3;
778 } 1175 }
779 } 1176 }
780 description { 1177 description {
781 state: "bottom_left" 0.0; 1178 state: "bottom_left" 0.0;
1179 inherit: "default" 0.0;
782 rel1 { 1180 rel1 {
1181 to: "item_clip_bottom";
783 relative: 0.0 0.0; 1182 relative: 0.0 0.0;
784 offset: 2 2; 1183 offset: 2 2;
785 } 1184 }
786 rel2 { 1185 rel2 {
1186 to: "item_clip_bottom";
787 relative: 1.0 1.0; 1187 relative: 1.0 1.0;
788 offset: -19 -3; 1188 offset: -19 -3;
789 } 1189 }
790 } 1190 }
791 description { 1191 description {
792 state: "bottom_right" 0.0; 1192 state: "bottom_right" 0.0;
1193 inherit: "default" 0.0;
793 rel1 { 1194 rel1 {
1195 to: "item_clip_bottom";
794 relative: 0.0 0.0; 1196 relative: 0.0 0.0;
795 offset: 18 2; 1197 offset: 18 2;
796 } 1198 }
797 rel2 { 1199 rel2 {
1200 to: "item_clip_bottom";
798 relative: 1.0 1.0; 1201 relative: 1.0 1.0;
799 offset: -3 -3; 1202 offset: -3 -3;
800 } 1203 }
801 } 1204 }
802 description { 1205 description {
803 state: "left" 0.0; 1206 state: "left" 0.0;
1207 inherit: "default" 0.0;
804 rel1 { 1208 rel1 {
1209 to: "item_clip_left";
805 relative: 0.0 0.0; 1210 relative: 0.0 0.0;
806 offset: 2 18; 1211 offset: 2 18;
807 } 1212 }
808 rel2 { 1213 rel2 {
1214 to: "item_clip_left";
809 relative: 1.0 1.0; 1215 relative: 1.0 1.0;
810 offset: -3 -19; 1216 offset: -3 -19;
811 } 1217 }
812 } 1218 }
813 description { 1219 description {
814 state: "left_top" 0.0; 1220 state: "left_top" 0.0;
1221 inherit: "default" 0.0;
815 rel1 { 1222 rel1 {
1223 to: "item_clip_left";
816 relative: 0.0 0.0; 1224 relative: 0.0 0.0;
817 offset: 2 2; 1225 offset: 2 2;
818 } 1226 }
819 rel2 { 1227 rel2 {
1228 to: "item_clip_left";
820 relative: 1.0 1.0; 1229 relative: 1.0 1.0;
821 offset: -3 -19; 1230 offset: -3 -19;
822 } 1231 }
823 } 1232 }
824 description { 1233 description {
825 state: "left_bottom" 0.0; 1234 state: "left_bottom" 0.0;
1235 inherit: "default" 0.0;
826 rel1 { 1236 rel1 {
1237 to: "item_clip_left";
827 relative: 0.0 0.0; 1238 relative: 0.0 0.0;
828 offset: 2 18; 1239 offset: 2 18;
829 } 1240 }
830 rel2 { 1241 rel2 {
1242 to: "item_clip_left";
831 relative: 1.0 1.0; 1243 relative: 1.0 1.0;
832 offset: -3 -3; 1244 offset: -3 -3;
833 } 1245 }
834 } 1246 }
835 description { 1247 description {
836 state: "right" 0.0; 1248 state: "right" 0.0;
1249 inherit: "default" 0.0;
837 rel1 { 1250 rel1 {
1251 to: "item_clip_right";
838 relative: 0.0 0.0; 1252 relative: 0.0 0.0;
839 offset: 2 18; 1253 offset: 2 18;
840 } 1254 }
841 rel2 { 1255 rel2 {
1256 to: "item_clip_right";
842 relative: 1.0 1.0; 1257 relative: 1.0 1.0;
843 offset: -3 -19; 1258 offset: -3 -19;
844 } 1259 }
845 } 1260 }
846 description { 1261 description {
847 state: "right_top" 0.0; 1262 state: "right_top" 0.0;
1263 inherit: "default" 0.0;
848 rel1 { 1264 rel1 {
1265 to: "item_clip_right";
849 relative: 0.0 0.0; 1266 relative: 0.0 0.0;
850 offset: 2 2; 1267 offset: 2 2;
851 } 1268 }
852 rel2 { 1269 rel2 {
1270 to: "item_clip_right";
853 relative: 1.0 1.0; 1271 relative: 1.0 1.0;
854 offset: -3 -19; 1272 offset: -3 -19;
855 } 1273 }
856 } 1274 }
857 description { 1275 description {
858 state: "right_bottom" 0.0; 1276 state: "right_bottom" 0.0;
1277 inherit: "default" 0.0;
859 rel1 { 1278 rel1 {
1279 to: "item_clip_right";
860 relative: 0.0 0.0; 1280 relative: 0.0 0.0;
861 offset: 2 18; 1281 offset: 2 18;
862 } 1282 }
863 rel2 { 1283 rel2 {
1284 to: "item_clip_right";
864 relative: 1.0 1.0; 1285 relative: 1.0 1.0;
865 offset: -3 -3; 1286 offset: -3 -3;
866 } 1287 }
@@ -869,6 +1290,28 @@ group {
869 } 1290 }
870 programs { 1291 programs {
871 program { 1292 program {
1293 name: "hide";
1294 signal: "e,state,hidden";
1295 source: "e";
1296 action: STATE_SET "hidden" 0.0;
1297 transition: ACCELERATE 0.3;
1298 target: "item_clip_bottom";
1299 target: "item_clip_top";
1300 target: "item_clip_left";
1301 target: "item_clip_right";
1302 }
1303 program {
1304 name: "show";
1305 signal: "e,state,visible";
1306 source: "e";
1307 transition: DECELERATE 0.3;
1308 action: STATE_SET "default" 0.0;
1309 target: "item_clip_bottom";
1310 target: "item_clip_top";
1311 target: "item_clip_left";
1312 target: "item_clip_right";
1313 }
1314 program {
872 name: "orient1"; 1315 name: "orient1";
873 signal: "e,state,orientation,top"; 1316 signal: "e,state,orientation,top";
874 source: "e"; 1317 source: "e";
@@ -1097,14 +1540,352 @@ group {
1097 } 1540 }
1098 parts { 1541 parts {
1099 part { 1542 part {
1543 name: "item_clip_bottom";
1544 type: RECT;
1545 mouse_events: 0;
1546 description {
1547 state: "default" 0.0;
1548 color: 255 255 255 0;
1549 }
1550 description {
1551 state: "hidden" 0.0;
1552 inherit: "default" 0.0;
1553 rel1 {
1554 relative: 0.0 1.0;
1555 offset: 0 -2;
1556 }
1557 rel2 {
1558 relative: 1.0 2.0;
1559 offset: -1 -3;
1560 }
1561 }
1562 }
1563 part {
1564 name: "item_clip_top";
1565 type: RECT;
1566 mouse_events: 0;
1567 description {
1568 state: "default" 0.0;
1569 color: 255 255 255 0;
1570 }
1571 description {
1572 state: "hidden" 0.0;
1573 inherit: "default" 0.0;
1574 rel1 {
1575 relative: 0.0 -1.0;
1576 offset: 0 2;
1577 }
1578 rel2 {
1579 relative: 1.0 0.0;
1580 offset: -1 1;
1581 }
1582 }
1583 }
1584 part {
1585 name: "item_clip_left";
1586 type: RECT;
1587 mouse_events: 0;
1588 description {
1589 state: "default" 0.0;
1590 color: 255 255 255 0;
1591 }
1592 description {
1593 state: "hidden" 0.0;
1594 inherit: "default" 0.0;
1595 rel1 {
1596 relative: -1.0 0.0;
1597 offset: 2 0;
1598 }
1599 rel2 {
1600 relative: 0.0 1.0;
1601 offset: 1 -1;
1602 }
1603 }
1604 }
1605 part {
1606 name: "item_clip_right";
1607 type: RECT;
1608 mouse_events: 0;
1609 description {
1610 state: "default" 0.0;
1611 color: 255 255 255 0;
1612 }
1613 description {
1614 state: "hidden" 0.0;
1615 inherit: "default" 0.0;
1616 rel1 {
1617 relative: 1.0 0.0;
1618 offset: -2 0;
1619 }
1620 rel2 {
1621 relative: 2.0 1.0;
1622 offset: -3 -1;
1623 }
1624 }
1625 }
1626 part {
1100 name: "e.swallow.content"; 1627 name: "e.swallow.content";
1101 mouse_events: 0; 1628 mouse_events: 0;
1102 type: SWALLOW; 1629 type: SWALLOW;
1630// clip_to: "item_clip";
1631 description {
1632 state: "default" 0.0;
1633 rel1 {
1634 to: "base";
1635 }
1636 rel2 {
1637 to: "base";
1638 }
1639 }
1640 }
1641 part {
1642 name: "base";
1643 mouse_events: 1;
1644 type: RECT;
1645 repeat_events: 1;
1646// clip_to: "item_clip";
1103 description { 1647 description {
1104 state: "default" 0.0; 1648 state: "default" 0.0;
1649 color: 255 255 255 0;
1650 rel1 {
1651 to: "item_clip_top";
1652 }
1653 rel2 {
1654 to: "item_clip_top";
1655 }
1656 }
1657 description {
1658 state: "top_left" 0.0;
1659 inherit: "default" 0.0;
1660 rel1 {
1661 to: "item_clip_top";
1662 }
1663 rel2 {
1664 to: "item_clip_top";
1665 }
1666 }
1667 description {
1668 state: "top_right" 0.0;
1669 inherit: "default" 0.0;
1670 rel1 {
1671 to: "item_clip_top";
1672 }
1673 rel2 {
1674 to: "item_clip_top";
1675 }
1676 }
1677 description {
1678 state: "bottom" 0.0;
1679 inherit: "default" 0.0;
1680 rel1 {
1681 to: "item_clip_bottom";
1682 }
1683 rel2 {
1684 to: "item_clip_bottom";
1685 }
1686 }
1687 description {
1688 state: "bottom_left" 0.0;
1689 inherit: "default" 0.0;
1690 rel1 {
1691 to: "item_clip_bottom";
1692 }
1693 rel2 {
1694 to: "item_clip_bottom";
1695 }
1696 }
1697 description {
1698 state: "bottom_right" 0.0;
1699 inherit: "default" 0.0;
1700 rel1 {
1701 to: "item_clip_bottom";
1702 }
1703 rel2 {
1704 to: "item_clip_bottom";
1705 }
1706 }
1707 description {
1708 state: "left" 0.0;
1709 inherit: "default" 0.0;
1710 rel1 {
1711 to: "item_clip_left";
1712 }
1713 rel2 {
1714 to: "item_clip_left";
1715 }
1716 }
1717 description {
1718 state: "left_top" 0.0;
1719 inherit: "default" 0.0;
1720 rel1 {
1721 to: "item_clip_left";
1722 }
1723 rel2 {
1724 to: "item_clip_left";
1725 }
1726 }
1727 description {
1728 state: "left_bottom" 0.0;
1729 inherit: "default" 0.0;
1730 rel1 {
1731 to: "item_clip_left";
1732 }
1733 rel2 {
1734 to: "item_clip_left";
1735 }
1736 }
1737 description {
1738 state: "right" 0.0;
1739 inherit: "default" 0.0;
1740 rel1 {
1741 to: "item_clip_right";
1742 }
1743 rel2 {
1744 to: "item_clip_right";
1745 }
1746 }
1747 description {
1748 state: "right_top" 0.0;
1749 inherit: "default" 0.0;
1750 rel1 {
1751 to: "item_clip_right";
1752 }
1753 rel2 {
1754 to: "item_clip_right";
1755 }
1756 }
1757 description {
1758 state: "right_bottom" 0.0;
1759 inherit: "default" 0.0;
1760 rel1 {
1761 to: "item_clip_right";
1762 }
1763 rel2 {
1764 to: "item_clip_right";
1765 }
1105 } 1766 }
1106 } 1767 }
1107 } 1768 }
1769 programs {
1770 program {
1771 name: "hide";
1772 signal: "e,state,hidden";
1773 source: "e";
1774 action: STATE_SET "hidden" 0.0;
1775 transition: ACCELERATE 0.3;
1776 target: "item_clip_bottom";
1777 target: "item_clip_top";
1778 target: "item_clip_left";
1779 target: "item_clip_right";
1780 }
1781 program {
1782 name: "show";
1783 signal: "e,state,visible";
1784 source: "e";
1785 transition: DECELERATE 0.3;
1786 action: STATE_SET "default" 0.0;
1787 target: "item_clip_bottom";
1788 target: "item_clip_top";
1789 target: "item_clip_left";
1790 target: "item_clip_right";
1791 }
1792 program {
1793 name: "orient1";
1794 signal: "e,state,orientation,top";
1795 source: "e";
1796 action: STATE_SET "default" 0.0;
1797 target: "base";
1798 target: "e.swallow.content";
1799 }
1800 program {
1801 name: "orient2";
1802 signal: "e,state,orientation,top_left";
1803 source: "e";
1804 action: STATE_SET "top_left" 0.0;
1805 target: "base";
1806 target: "e.swallow.content";
1807 }
1808 program {
1809 name: "orient3";
1810 signal: "e,state,orientation,top_right";
1811 source: "e";
1812 action: STATE_SET "top_right" 0.0;
1813 target: "base";
1814 target: "e.swallow.content";
1815 }
1816 program {
1817 name: "orient4";
1818 signal: "e,state,orientation,bottom";
1819 source: "e";
1820 action: STATE_SET "bottom" 0.0;
1821 target: "base";
1822 target: "e.swallow.content";
1823 }
1824 program {
1825 name: "orient5";
1826 signal: "e,state,orientation,bottom_left";
1827 source: "e";
1828 action: STATE_SET "bottom_left" 0.0;
1829 target: "base";
1830 target: "e.swallow.content";
1831 }
1832 program {
1833 name: "orient6";
1834 signal: "e,state,orientation,bottom_right";
1835 source: "e";
1836 action: STATE_SET "bottom_right" 0.0;
1837 target: "base";
1838 target: "e.swallow.content";
1839 }
1840 program {
1841 name: "orient7";
1842 signal: "e,state,orientation,left";
1843 source: "e";
1844 action: STATE_SET "left" 0.0;
1845 target: "base";
1846 target: "e.swallow.content";
1847 }
1848 program {
1849 name: "orient8";
1850 signal: "e,state,orientation,left_top";
1851 source: "e";
1852 action: STATE_SET "left_top" 0.0;
1853 target: "base";
1854 target: "e.swallow.content";
1855 }
1856 program {
1857 name: "orient9";
1858 signal: "e,state,orientation,left_bottom";
1859 source: "e";
1860 action: STATE_SET "left_bottom" 0.0;
1861 target: "base";
1862 target: "e.swallow.content";
1863 }
1864 program {
1865 name: "orient10";
1866 signal: "e,state,orientation,right";
1867 source: "e";
1868 action: STATE_SET "right" 0.0;
1869 target: "base";
1870 target: "e.swallow.content";
1871 }
1872 program {
1873 name: "orient11";
1874 signal: "e,state,orientation,right_top";
1875 source: "e";
1876 action: STATE_SET "right_top" 0.0;
1877 target: "base";
1878 target: "e.swallow.content";
1879 }
1880 program {
1881 name: "orient12";
1882 signal: "e,state,orientation,right_bottom";
1883 source: "e";
1884 action: STATE_SET "right_bottom" 0.0;
1885 target: "base";
1886 target: "e.swallow.content";
1887 }
1888 }
1108} 1889}
1109 1890
1110group { 1891group {
diff --git a/src/bin/.cvsignore b/src/bin/.cvsignore
index cb5e16f6a..e580006cc 100644
--- a/src/bin/.cvsignore
+++ b/src/bin/.cvsignore
@@ -10,3 +10,4 @@ enlightenment_imc
10enlightenment_start 10enlightenment_start
11enlightenment_sys 11enlightenment_sys
12enlightenment_thumb 12enlightenment_thumb
13enlightenment_fm
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 3e4af5a6f..c3d9d838f 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -19,7 +19,8 @@ enlightenment_remote \
19enlightenment_imc \ 19enlightenment_imc \
20enlightenment_start \ 20enlightenment_start \
21enlightenment_thumb \ 21enlightenment_thumb \
22enlightenment_sys 22enlightenment_sys \
23enlightenment_fm
23 24
24ENLIGHTENMENTHEADERS = \ 25ENLIGHTENMENTHEADERS = \
25e.h \ 26e.h \
@@ -377,13 +378,19 @@ e_start_main.c
377enlightenment_start_LDFLAGS = @dlopen_libs@ 378enlightenment_start_LDFLAGS = @dlopen_libs@
378 379
379enlightenment_thumb_SOURCES = \ 380enlightenment_thumb_SOURCES = \
380e.h \
381e_thumb_main.c \ 381e_thumb_main.c \
382e_user.c \ 382e_user.c \
383e_sha1.c 383e_sha1.c
384 384
385enlightenment_thumb_LDFLAGS = @e_libs@ @dlopen_libs@ 385enlightenment_thumb_LDFLAGS = @e_libs@ @dlopen_libs@
386 386
387enlightenment_fm_SOURCES = \
388e_fm_main.c \
389e_user.c \
390e_sha1.c
391
392enlightenment_fm_LDFLAGS = @e_libs@ @dlopen_libs@
393
387enlightenment_sys_SOURCES = \ 394enlightenment_sys_SOURCES = \
388e_sys_main.c 395e_sys_main.c
389 396
diff --git a/src/bin/e.h b/src/bin/e.h
index 9ef9e670b..e4f35725a 100644
--- a/src/bin/e.h
+++ b/src/bin/e.h
@@ -18,7 +18,6 @@
18#include <sys/stat.h> 18#include <sys/stat.h>
19#include <sys/time.h> 19#include <sys/time.h>
20#include <sys/param.h> 20#include <sys/param.h>
21#include <pwd.h>
22#include <dlfcn.h> 21#include <dlfcn.h>
23#include <math.h> 22#include <math.h>
24#include <fnmatch.h> 23#include <fnmatch.h>
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index 87c6bf492..b10a733ad 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -422,6 +422,7 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal)
422 422
423 bd->resize_mode = RESIZE_NONE; 423 bd->resize_mode = RESIZE_NONE;
424 bd->layer = 100; 424 bd->layer = 100;
425 bd->saved.layer = bd->layer;
425 bd->changes.icon = 1; 426 bd->changes.icon = 1;
426 bd->changes.size = 1; 427 bd->changes.size = 1;
427 bd->changes.shape = 1; 428 bd->changes.shape = 1;
@@ -974,6 +975,7 @@ e_border_layer_set(E_Border *bd, int layer)
974 975
975 raise = e_config->transient.raise; 976 raise = e_config->transient.raise;
976 977
978 bd->saved.layer = bd->layer;
977 bd->layer = layer; 979 bd->layer = layer;
978 if (e_config->transient.layer) 980 if (e_config->transient.layer)
979 { 981 {
@@ -2071,7 +2073,7 @@ e_border_unfullscreen(E_Border *bd)
2071 e_border_move_resize(bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h); 2073 e_border_move_resize(bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h);
2072 2074
2073 /* FIXME: Find right layer */ 2075 /* FIXME: Find right layer */
2074 e_border_layer_set(bd, 100); 2076 e_border_layer_set(bd, bd->saved.layer);
2075 2077
2076 e_hints_window_fullscreen_set(bd, 0); 2078 e_hints_window_fullscreen_set(bd, 0);
2077 bd->client.border.changed = 1; 2079 bd->client.border.changed = 1;
diff --git a/src/bin/e_border.h b/src/bin/e_border.h
index 0e2293d3e..896637e32 100644
--- a/src/bin/e_border.h
+++ b/src/bin/e_border.h
@@ -389,6 +389,7 @@ struct _E_Border
389 389
390 struct { 390 struct {
391 int x, y, w, h; 391 int x, y, w, h;
392 unsigned int layer;
392 } saved; 393 } saved;
393 394
394 struct { 395 struct {
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 00c31fa1e..0b2346fb9 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -121,6 +121,7 @@ e_config_init(void)
121 E_CONFIG_VAL(D, T, style, STR); 121 E_CONFIG_VAL(D, T, style, STR);
122 E_CONFIG_VAL(D, T, size, INT); 122 E_CONFIG_VAL(D, T, size, INT);
123 E_CONFIG_VAL(D, T, overlap, INT); 123 E_CONFIG_VAL(D, T, overlap, INT);
124 E_CONFIG_VAL(D, T, autohide, INT);
124 125
125 _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", E_Config_Desktop_Background); 126 _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", E_Config_Desktop_Background);
126#undef T 127#undef T
@@ -1133,7 +1134,7 @@ e_config_init(void)
1133 { 1134 {
1134 E_Config_Shelf *cf_es; 1135 E_Config_Shelf *cf_es;
1135 1136
1136#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap) \ 1137#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap, _autohide) \
1137 cf_es = E_NEW(E_Config_Shelf, 1); \ 1138 cf_es = E_NEW(E_Config_Shelf, 1); \
1138 cf_es->name = evas_stringshare_add(_name); \ 1139 cf_es->name = evas_stringshare_add(_name); \
1139 cf_es->container = _con; \ 1140 cf_es->container = _con; \
@@ -1146,30 +1147,31 @@ e_config_init(void)
1146 cf_es->style = evas_stringshare_add(_style); \ 1147 cf_es->style = evas_stringshare_add(_style); \
1147 cf_es->size = _size; \ 1148 cf_es->size = _size; \
1148 cf_es->overlap = _overlap; \ 1149 cf_es->overlap = _overlap; \
1150 cf_es->autohide = _autohide; \
1149 e_config->shelves = evas_list_append(e_config->shelves, cf_es) 1151 e_config->shelves = evas_list_append(e_config->shelves, cf_es)
1150 /* shelves for 4 zones on head 0 by default */ 1152 /* shelves for 4 zones on head 0 by default */
1151 CFG_SHELF("shelf", 0, 0, 1153 CFG_SHELF("shelf", 0, 0,
1152 1, 200, E_GADCON_ORIENT_BOTTOM, 1154 1, 200, E_GADCON_ORIENT_BOTTOM,
1153 1, 0, "default", 40, 0); 1155 1, 0, "default", 40, 0, 0);
1154 CFG_SHELF("shelf", 0, 1, 1156 CFG_SHELF("shelf", 0, 1,
1155 1, 200, E_GADCON_ORIENT_BOTTOM, 1157 1, 200, E_GADCON_ORIENT_BOTTOM,
1156 1, 0, "default", 40, 0); 1158 1, 0, "default", 40, 0, 0);
1157 CFG_SHELF("shelf", 0, 2, 1159 CFG_SHELF("shelf", 0, 2,
1158 1, 200, E_GADCON_ORIENT_BOTTOM, 1160 1, 200, E_GADCON_ORIENT_BOTTOM,
1159 1, 0, "default", 40, 0); 1161 1, 0, "default", 40, 0, 0);
1160 CFG_SHELF("shelf", 0, 3, 1162 CFG_SHELF("shelf", 0, 3,
1161 1, 200, E_GADCON_ORIENT_BOTTOM, 1163 1, 200, E_GADCON_ORIENT_BOTTOM,
1162 1, 0, "default", 40, 0); 1164 1, 0, "default", 40, 0, 0);
1163 /* shelves for heada 1, 2, and 3 by default */ 1165 /* shelves for heada 1, 2, and 3 by default */
1164 CFG_SHELF("shelf", 1, 0, 1166 CFG_SHELF("shelf", 1, 0,
1165 1, 200, E_GADCON_ORIENT_BOTTOM, 1167 1, 200, E_GADCON_ORIENT_BOTTOM,
1166 1, 0, "default", 40, 0); 1168 1, 0, "default", 40, 0, 0);
1167 CFG_SHELF("shelf", 2, 0, 1169 CFG_SHELF("shelf", 2, 0,
1168 1, 200, E_GADCON_ORIENT_BOTTOM, 1170 1, 200, E_GADCON_ORIENT_BOTTOM,
1169 1, 0, "default", 40, 0); 1171 1, 0, "default", 40, 0, 0);
1170 CFG_SHELF("shelf", 3, 0, 1172 CFG_SHELF("shelf", 3, 0,
1171 1, 200, E_GADCON_ORIENT_BOTTOM, 1173 1, 200, E_GADCON_ORIENT_BOTTOM,
1172 1, 0, "default", 40, 0); 1174 1, 0, "default", 40, 0, 0);
1173 } 1175 }
1174 IFCFGEND; 1176 IFCFGEND;
1175 1177
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index cb98715df..b8e130e8c 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -390,6 +390,7 @@ struct _E_Config_Shelf
390 const char *style; 390 const char *style;
391 int size; 391 int size;
392 int overlap; 392 int overlap;
393 int autohide;
393}; 394};
394 395
395struct _E_Config_Mime_Icon 396struct _E_Config_Mime_Icon
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index c23ae361f..bf43c2da4 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -20,22 +20,15 @@ typedef enum _E_Fm2_Action_Type
20 FILE_CHANGE 20 FILE_CHANGE
21} E_Fm2_Action_Type; 21} E_Fm2_Action_Type;
22 22
23typedef enum _E_Fm2_Fop_Type
24{
25 FOP_DELETE,
26 FOP_MOVE,
27 FOP_LINK,
28 FOP_ADD
29} E_Fm2_Fop_Type;
30
31typedef struct _E_Fm2_Smart_Data E_Fm2_Smart_Data; 23typedef struct _E_Fm2_Smart_Data E_Fm2_Smart_Data;
32typedef struct _E_Fm2_Region E_Fm2_Region; 24typedef struct _E_Fm2_Region E_Fm2_Region;
25typedef struct _E_Fm2_Finfo E_Fm2_Finfo;
33typedef struct _E_Fm2_Action E_Fm2_Action; 26typedef struct _E_Fm2_Action E_Fm2_Action;
34typedef struct _E_Fm2_Fop E_Fm2_Fop; 27typedef struct _E_Fm2_Client E_Fm2_Client;
35typedef struct _E_Fm2_Fop_Item E_Fm2_Fop_Item;
36 28
37struct _E_Fm2_Smart_Data 29struct _E_Fm2_Smart_Data
38{ 30{
31 int id;
39 Evas_Coord x, y, w, h; 32 Evas_Coord x, y, w, h;
40 Evas_Object *obj; 33 Evas_Object *obj;
41 Evas_Object *clip; 34 Evas_Object *clip;
@@ -67,20 +60,18 @@ struct _E_Fm2_Smart_Data
67 60
68 Evas_List *icons; 61 Evas_List *icons;
69 Evas_List *queue; 62 Evas_List *queue;
70 Ecore_Idler *scan_idler;
71 Ecore_Timer *scan_timer; 63 Ecore_Timer *scan_timer;
72 Ecore_Timer *sort_idler; 64 Ecore_Timer *sort_idler;
73 Ecore_Job *scroll_job; 65 Ecore_Job *scroll_job;
74 Ecore_Job *resize_job; 66 Ecore_Job *resize_job;
75 Ecore_Job *refresh_job; 67 Ecore_Job *refresh_job;
76 DIR *dir;
77 FILE *order;
78 E_Menu *menu; 68 E_Menu *menu;
79 E_Entry_Dialog *entry_dialog; 69 E_Entry_Dialog *entry_dialog;
80 unsigned char iconlist_changed : 1; 70 unsigned char iconlist_changed : 1;
81 unsigned char order_file : 1; 71 unsigned char order_file : 1;
82 unsigned char typebuf_visible : 1; 72 unsigned char typebuf_visible : 1;
83 unsigned char show_hidden_files : 1; 73 unsigned char show_hidden_files : 1;
74 unsigned char listing : 1;
84 75
85 E_Fm2_Config *config; 76 E_Fm2_Config *config;
86 77
@@ -99,14 +90,9 @@ struct _E_Fm2_Smart_Data
99 } live; 90 } live;
100 91
101 struct { 92 struct {
102 Ecore_File_Monitor *monitor;
103 } monitor;
104
105 struct {
106 char *buf; 93 char *buf;
107 } typebuf; 94 } typebuf;
108 95
109 E_Fm2_Fop *fop;
110 int busy_count; 96 int busy_count;
111 97
112 E_Object *eobj; 98 E_Object *eobj;
@@ -155,41 +141,32 @@ struct _E_Fm2_Icon
155 unsigned char down_sel : 1; 141 unsigned char down_sel : 1;
156}; 142};
157 143
144struct _E_Fm2_Finfo
145{
146 struct stat st;
147 int broken_link;
148 const char *lnk;
149 const char *rlnk;
150};
151
158struct _E_Fm2_Action 152struct _E_Fm2_Action
159{ 153{
160 E_Fm2_Action_Type type; 154 E_Fm2_Action_Type type;
161 const char *file; 155 const char *file;
162 const char *file2; 156 const char *file2;
163 int flags; 157 int flags;
158 E_Fm2_Finfo finf;
164}; 159};
165 160
166struct _E_Fm2_Fop 161struct _E_Fm2_Client
167{ 162{
168 Evas_Object *obj; 163 Ecore_Ipc_Client *cl;
169 const char *dir; 164 int req;
170 Evas_List *items;
171 Ecore_Idler *idler;
172 Ecore_Timer *timer;
173};
174
175struct _E_Fm2_Fop_Item
176{
177 E_Fm2_Fop_Type type;
178 E_Fm2_Fop *fop;
179 const char *file;
180 const char *file2;
181 const char *file3;
182 int after;
183 DIR *dir;
184 unsigned char is_dir : 1;
185 unsigned char file_add : 1;
186}; 165};
187 166
188static const char *_e_fm2_dev_path_map(const char *dev, const char *path); 167static const char *_e_fm2_dev_path_map(const char *dev, const char *path);
189static void _e_fm2_file_add(Evas_Object *obj, const char *file, int unique, const char *file_rel, int after); 168static void _e_fm2_file_add(Evas_Object *obj, const char *file, int unique, const char *file_rel, int after, E_Fm2_Finfo *finf);
190static void _e_fm2_file_del(Evas_Object *obj, const char *file); 169static void _e_fm2_file_del(Evas_Object *obj, const char *file);
191static void _e_fm2_scan_start(Evas_Object *obj);
192static void _e_fm2_scan_stop(Evas_Object *obj);
193static void _e_fm2_queue_process(Evas_Object *obj); 170static void _e_fm2_queue_process(Evas_Object *obj);
194static void _e_fm2_queue_free(Evas_Object *obj); 171static void _e_fm2_queue_free(Evas_Object *obj);
195static void _e_fm2_regions_free(Evas_Object *obj); 172static void _e_fm2_regions_free(Evas_Object *obj);
@@ -199,9 +176,9 @@ static void _e_fm2_icons_free(Evas_Object *obj);
199static void _e_fm2_regions_eval(Evas_Object *obj); 176static void _e_fm2_regions_eval(Evas_Object *obj);
200static void _e_fm2_config_free(E_Fm2_Config *cfg); 177static void _e_fm2_config_free(E_Fm2_Config *cfg);
201 178
202static E_Fm2_Icon *_e_fm2_icon_new(E_Fm2_Smart_Data *sd, const char *file); 179static E_Fm2_Icon *_e_fm2_icon_new(E_Fm2_Smart_Data *sd, const char *file, E_Fm2_Finfo *finf);
203static void _e_fm2_icon_unfill(E_Fm2_Icon *ic); 180static void _e_fm2_icon_unfill(E_Fm2_Icon *ic);
204static int _e_fm2_icon_fill(E_Fm2_Icon *ic); 181static int _e_fm2_icon_fill(E_Fm2_Icon *ic, E_Fm2_Finfo *finf);
205static void _e_fm2_icon_free(E_Fm2_Icon *ic); 182static void _e_fm2_icon_free(E_Fm2_Icon *ic);
206static void _e_fm2_icon_realize(E_Fm2_Icon *ic); 183static void _e_fm2_icon_realize(E_Fm2_Icon *ic);
207static void _e_fm2_icon_unrealize(E_Fm2_Icon *ic); 184static void _e_fm2_icon_unrealize(E_Fm2_Icon *ic);
@@ -253,7 +230,6 @@ static void _e_fm2_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *ev
253static void _e_fm2_cb_scroll_job(void *data); 230static void _e_fm2_cb_scroll_job(void *data);
254static void _e_fm2_cb_resize_job(void *data); 231static void _e_fm2_cb_resize_job(void *data);
255static int _e_fm2_cb_icon_sort(void *data1, void *data2); 232static int _e_fm2_cb_icon_sort(void *data1, void *data2);
256static int _e_fm2_cb_scan_idler(void *data);
257static int _e_fm2_cb_scan_timer(void *data); 233static int _e_fm2_cb_scan_timer(void *data);
258static int _e_fm2_cb_sort_idler(void *data); 234static int _e_fm2_cb_sort_idler(void *data);
259 235
@@ -293,22 +269,14 @@ static void _e_fm2_file_delete_yes_cb(void *data, E_Dialog *dialog);
293static void _e_fm2_file_delete_no_cb(void *data, E_Dialog *dialog); 269static void _e_fm2_file_delete_no_cb(void *data, E_Dialog *dialog);
294static void _e_fm2_refresh_job_cb(void *data); 270static void _e_fm2_refresh_job_cb(void *data);
295 271
296static void _e_fm2_live_file_add(Evas_Object *obj, const char *file, const char *file_rel, int after); 272static void _e_fm2_live_file_add(Evas_Object *obj, const char *file, const char *file_rel, int after, E_Fm2_Finfo *finf);
297static void _e_fm2_live_file_del(Evas_Object *obj, const char *file); 273static void _e_fm2_live_file_del(Evas_Object *obj, const char *file);
298static void _e_fm2_live_file_changed(Evas_Object *obj, char *file); 274static void _e_fm2_live_file_changed(Evas_Object *obj, const char *file, E_Fm2_Finfo *finf);
299static void _e_fm2_live_process_begin(Evas_Object *obj); 275static void _e_fm2_live_process_begin(Evas_Object *obj);
300static void _e_fm2_live_process_end(Evas_Object *obj); 276static void _e_fm2_live_process_end(Evas_Object *obj);
301static void _e_fm2_live_process(Evas_Object *obj); 277static void _e_fm2_live_process(Evas_Object *obj);
302static int _e_fm2_cb_live_idler(void *data); 278static int _e_fm2_cb_live_idler(void *data);
303static int _e_fm2_cb_live_timer(void *data); 279static int _e_fm2_cb_live_timer(void *data);
304static void _e_fm2_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path);
305
306static E_Fm2_Fop *_e_fm2_fop_add(E_Fm2_Smart_Data *sd);
307static void _e_fm2_fop_del(E_Fm2_Fop *fop);
308static void _e_fm2_fop_detach(E_Fm2_Smart_Data *sd);
309static int _e_fm2_fop_process(E_Fm2_Fop *fop);
310static int _e_fm2_cb_fop_idler(void *data);
311static int _e_fm2_cb_fop_timer(void *data);
312 280
313static const char *_e_fm2_removable_dev_label_get(const char *uuid); 281static const char *_e_fm2_removable_dev_label_get(const char *uuid);
314static void _e_fm2_removable_dev_add(const char *uuid); 282static void _e_fm2_removable_dev_add(const char *uuid);
@@ -326,12 +294,18 @@ static void _e_fm2_cb_dbus_method_name_has_owner(void *data, Ecore_DBus_Method_R
326static void _e_fm2_cb_dbus_method_add_match(void *data, Ecore_DBus_Method_Return *reply); 294static void _e_fm2_cb_dbus_method_add_match(void *data, Ecore_DBus_Method_Return *reply);
327static void _e_fm2_cb_dbus_method_error(void *data, const char *error); 295static void _e_fm2_cb_dbus_method_error(void *data, const char *error);
328 296
297static void _e_fm2_client_spawn(void);
298static E_Fm2_Client *_e_fm2_client_get(void);
299static void _e_fm2_client_monitor_add(int id, const char *path);
300static void _e_fm2_client_monitor_del(int id, const char *path);
301
329static Ecore_DBus_Server *_e_fm2_dbus = NULL; 302static Ecore_DBus_Server *_e_fm2_dbus = NULL;
330static Evas_List *_e_fm2_dbus_handlers = NULL; 303static Evas_List *_e_fm2_dbus_handlers = NULL;
331static char *_e_fm2_meta_path = NULL; 304static char *_e_fm2_meta_path = NULL;
332static Evas_Smart *_e_fm2_smart = NULL; 305static Evas_Smart *_e_fm2_smart = NULL;
333static Evas_List *_e_fm2_list = NULL; 306static Evas_List *_e_fm2_list = NULL;
334static Evas_List *_e_fm2_fop_list = NULL; 307static Evas_List *_e_fm2_client_list = NULL;
308static int _e_fm2_id = 0;
335 309
336EAPI int E_EVENT_REMOVABLE_ADD = 0; 310EAPI int E_EVENT_REMOVABLE_ADD = 0;
337EAPI int E_EVENT_REMOVABLE_DEL = 0; 311EAPI int E_EVENT_REMOVABLE_DEL = 0;
@@ -416,6 +390,7 @@ e_fm2_init(void)
416 E_EVENT_REMOVABLE_ADD = ecore_event_type_new(); 390 E_EVENT_REMOVABLE_ADD = ecore_event_type_new();
417 E_EVENT_REMOVABLE_DEL = ecore_event_type_new(); 391 E_EVENT_REMOVABLE_DEL = ecore_event_type_new();
418 } 392 }
393 _e_fm2_client_spawn();
419 return 1; 394 return 1;
420} 395}
421 396
@@ -455,8 +430,6 @@ e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path)
455 if (!evas_object_type_get(obj)) return; // safety 430 if (!evas_object_type_get(obj)) return; // safety
456 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety 431 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
457 432
458 _e_fm2_fop_detach(sd);
459
460 /* internal config for now - don't see a pont making this configurable */ 433 /* internal config for now - don't see a pont making this configurable */
461 sd->regions.member_max = 64; 434 sd->regions.member_max = 64;
462 435
@@ -488,6 +461,9 @@ e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path)
488 sd->config->theme.fixed = 0; 461 sd->config->theme.fixed = 0;
489 } 462 }
490 463
464 if (sd->realpath) _e_fm2_client_monitor_del(sd->id, sd->realpath);
465 sd->listing = 0;
466
491 if (sd->dev) evas_stringshare_del(sd->dev); 467 if (sd->dev) evas_stringshare_del(sd->dev);
492 if (sd->path) evas_stringshare_del(sd->path); 468 if (sd->path) evas_stringshare_del(sd->path);
493 if (sd->realpath) 469 if (sd->realpath)
@@ -496,18 +472,22 @@ e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path)
496 evas_stringshare_del(sd->realpath); 472 evas_stringshare_del(sd->realpath);
497 } 473 }
498 sd->dev = sd->path = sd->realpath = NULL; 474 sd->dev = sd->path = sd->realpath = NULL;
475
476 sd->order_file = 0;
477
499 if (dev) sd->dev = evas_stringshare_add(dev); 478 if (dev) sd->dev = evas_stringshare_add(dev);
500 sd->path = evas_stringshare_add(path); 479 sd->path = evas_stringshare_add(path);
501 sd->realpath = _e_fm2_dev_path_map(sd->dev, sd->path); 480 sd->realpath = _e_fm2_dev_path_map(sd->dev, sd->path);
502 _e_fm2_removable_path_mount(sd->realpath); 481 _e_fm2_removable_path_mount(sd->realpath);
503 482
504 _e_fm2_scan_stop(obj);
505 _e_fm2_queue_free(obj); 483 _e_fm2_queue_free(obj);
506 _e_fm2_regions_free(obj); 484 _e_fm2_regions_free(obj);
507 _e_fm2_icons_free(obj); 485 _e_fm2_icons_free(obj);
508 edje_object_part_text_set(sd->overlay, "e.text.busy_label", ""); 486 edje_object_part_text_set(sd->overlay, "e.text.busy_label", "");
509 487
510 _e_fm2_scan_start(obj); 488 _e_fm2_client_monitor_add(sd->id, sd->realpath);
489 sd->listing = 1;
490
511 evas_object_smart_callback_call(obj, "dir_changed", NULL); 491 evas_object_smart_callback_call(obj, "dir_changed", NULL);
512 sd->tmp.iter = 0; 492 sd->tmp.iter = 0;
513} 493}
@@ -537,13 +517,20 @@ e_fm2_refresh(Evas_Object *obj)
537 if (!evas_object_type_get(obj)) return; // safety 517 if (!evas_object_type_get(obj)) return; // safety
538 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety 518 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
539 519
540 _e_fm2_scan_stop(obj);
541 _e_fm2_queue_free(obj); 520 _e_fm2_queue_free(obj);
542 _e_fm2_regions_free(obj); 521 _e_fm2_regions_free(obj);
543 _e_fm2_icons_free(obj); 522 _e_fm2_icons_free(obj);
544 523
545 _e_fm2_scan_start(obj); 524 sd->order_file = 0;
546// evas_object_smart_callback_call(obj, "dir_changed", NULL); 525
526 if (sd->realpath)
527 {
528 sd->listing = 0;
529 _e_fm2_client_monitor_del(sd->id, sd->realpath);
530 _e_fm2_client_monitor_add(sd->id, sd->realpath);
531 sd->listing = 1;
532 }
533
547 sd->tmp.iter = 0; 534 sd->tmp.iter = 0;
548} 535}
549 536
@@ -608,7 +595,6 @@ e_fm2_config_set(Evas_Object *obj, E_Fm2_Config *cfg)
608 sd->config = E_NEW(E_Fm2_Config, 1); 595 sd->config = E_NEW(E_Fm2_Config, 1);
609 if (!sd->config) return; 596 if (!sd->config) return;
610 memcpy(sd->config, cfg, sizeof(E_Fm2_Config)); 597 memcpy(sd->config, cfg, sizeof(E_Fm2_Config));
611 if (cfg->view.extra_file_source) sd->config->view.extra_file_source = evas_stringshare_add(cfg->view.extra_file_source);
612 if (cfg->icon.key_hint) sd->config->icon.key_hint = evas_stringshare_add(cfg->icon.key_hint); 598 if (cfg->icon.key_hint) sd->config->icon.key_hint = evas_stringshare_add(cfg->icon.key_hint);
613 if (cfg->theme.background) sd->config->theme.background = evas_stringshare_add(cfg->theme.background); 599 if (cfg->theme.background) sd->config->theme.background = evas_stringshare_add(cfg->theme.background);
614 if (cfg->theme.frame) sd->config->theme.frame = evas_stringshare_add(cfg->theme.frame); 600 if (cfg->theme.frame) sd->config->theme.frame = evas_stringshare_add(cfg->theme.frame);
@@ -895,114 +881,6 @@ e_fm2_all_icons_update(void)
895 e_fm2_icons_update(l->data); 881 e_fm2_icons_update(l->data);
896} 882}
897 883
898EAPI void
899e_fm2_fop_delete_add(Evas_Object *obj, E_Fm2_Icon_Info *ici)
900{
901 E_Fm2_Smart_Data *sd;
902 E_Fm2_Fop *fop;
903 E_Fm2_Fop_Item *fi;
904
905 sd = evas_object_smart_data_get(obj);
906 if (!sd) return; // safety
907 if (!evas_object_type_get(obj)) return; // safety
908 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
909 /* if no obj fop struct, create fop struct and add idler */
910 /* append fop node for delete and this file to the fop */
911
912 /* if obj is deleted what to do to fop: */
913 /* if obj is deleted, detach fop and let it run on its own till end */
914 /* if obj changes dir detach fop obj */
915
916 /* on fop queue empty - deete idler and free fop */
917 /* in fop idler go to the item on the head of the fop queue. if it is
918 * a file or a symlink, delete it directly. if it is a dir then
919 * opendir it in the fop entry (fope->dir != NULL now) and if dir is
920 * not null, readdir till end (when at end remove item) and per item
921 * if it is a file or link - delete it directly, if it is a dir, prepend to
922 * fop queue.
923 * per fop item processed, if obj is attached to fop - report status usig
924 * the status overlay for the fm edj obj.
925 */
926 fop = _e_fm2_fop_add(sd);
927 if (!fop) return;
928
929 fi = E_NEW(E_Fm2_Fop_Item, 1);
930 fi->fop = fop;
931 fi->type = FOP_DELETE;
932 fi->file = evas_stringshare_add(ici->file);
933 if ((S_ISDIR(ici->statinfo.st_mode)) && (!ici->real_link))
934 fi->is_dir = 1;
935 fi->fop->items = evas_list_append(fi->fop->items, fi);
936// printf("ADD0: %s\n", fi->file);
937}
938
939EAPI void
940e_fm2_fop_move_add(Evas_Object *obj, const char *src, const char *dst, const char *rel, int after, int file_add)
941{
942 E_Fm2_Smart_Data *sd;
943 E_Fm2_Fop *fop;
944 E_Fm2_Fop_Item *fi;
945
946 sd = evas_object_smart_data_get(obj);
947 if (!sd) return; // safety
948 if (!evas_object_type_get(obj)) return; // safety
949 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
950 fop = _e_fm2_fop_add(sd);
951 if (!fop) return;
952 fi = E_NEW(E_Fm2_Fop_Item, 1);
953 fi->fop = fop;
954 fi->type = FOP_MOVE;
955 fi->file = evas_stringshare_add(src);
956 fi->file2 = evas_stringshare_add(dst);
957 if (rel) fi->file3 = evas_stringshare_add(rel);
958 fi->after = after;
959 fi->file_add = file_add;
960 fi->fop->items = evas_list_append(fi->fop->items, fi);
961}
962
963EAPI void
964e_fm2_fop_link_add(Evas_Object *obj, const char *src, const char *dst)
965{
966 E_Fm2_Smart_Data *sd;
967 E_Fm2_Fop *fop;
968 E_Fm2_Fop_Item *fi;
969
970 sd = evas_object_smart_data_get(obj);
971 if (!sd) return; // safety
972 if (!evas_object_type_get(obj)) return; // safety
973 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
974 fop = _e_fm2_fop_add(sd);
975 if (!fop) return;
976 fi = E_NEW(E_Fm2_Fop_Item, 1);
977 fi->fop = fop;
978 fi->type = FOP_LINK;
979 fi->file = evas_stringshare_add(src);
980 fi->file2 = evas_stringshare_add(dst);
981 fi->fop->items = evas_list_append(fi->fop->items, fi);
982}
983
984EAPI void
985e_fm2_fop_add_add(Evas_Object *obj, const char *file, const char *rel, int after)
986{
987 E_Fm2_Smart_Data *sd;
988 E_Fm2_Fop *fop;
989 E_Fm2_Fop_Item *fi;
990
991 sd = evas_object_smart_data_get(obj);
992 if (!sd) return; // safety
993 if (!evas_object_type_get(obj)) return; // safety
994 if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
995 fop = _e_fm2_fop_add(sd);
996 if (!fop) return;
997 fi = E_NEW(E_Fm2_Fop_Item, 1);
998 fi->fop = fop;
999 fi->type = FOP_ADD;
1000 fi->file = evas_stringshare_add(file);
1001 if (rel) fi->file3 = evas_stringshare_add(rel);
1002 fi->after = after;
1003 fi->fop->items = evas_list_append(fi->fop->items, fi);
1004}
1005
1006EAPI Evas_Object * 884EAPI Evas_Object *
1007e_fm2_icon_get(Evas *evas, const char *realpath, 885e_fm2_icon_get(Evas *evas, const char *realpath,
1008 E_Fm2_Icon *ic, E_Fm2_Icon_Info *ici, 886 E_Fm2_Icon *ic, E_Fm2_Icon_Info *ici,
@@ -1054,11 +932,7 @@ e_fm2_icon_get(Evas *evas, const char *realpath,
1054 { 932 {
1055 if (ici->icon_type == 1) 933 if (ici->icon_type == 1)
1056 { 934 {
1057 if (ici->pseudo_link) 935 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1058 snprintf(buf, sizeof(buf), "%s/%s", ici->pseudo_dir, ici->file);
1059 else
1060 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1061
1062 oic = e_thumb_icon_add(evas); 936 oic = e_thumb_icon_add(evas);
1063 e_thumb_icon_file_set(oic, buf, NULL); 937 e_thumb_icon_file_set(oic, buf, NULL);
1064 e_thumb_icon_size_set(oic, 128, 128); 938 e_thumb_icon_size_set(oic, 128, 128);
@@ -1086,10 +960,7 @@ e_fm2_icon_get(Evas *evas, const char *realpath,
1086 } 960 }
1087 else if (!strcmp(icon, "THUMB")) 961 else if (!strcmp(icon, "THUMB"))
1088 { 962 {
1089 if (ici->pseudo_link) 963 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1090 snprintf(buf, sizeof(buf), "%s/%s", ici->pseudo_dir, ici->file);
1091 else
1092 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1093 964
1094 oic = e_thumb_icon_add(evas); 965 oic = e_thumb_icon_add(evas);
1095 e_thumb_icon_file_set(oic, buf, NULL); 966 e_thumb_icon_file_set(oic, buf, NULL);
@@ -1108,10 +979,7 @@ e_fm2_icon_get(Evas *evas, const char *realpath,
1108 E_App *app; 979 E_App *app;
1109 980
1110 oic = NULL; 981 oic = NULL;
1111 if (ici->pseudo_link) 982 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1112 snprintf(buf, sizeof(buf), "%s/%s", ici->pseudo_dir, ici->file);
1113 else
1114 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1115 app = e_app_new(buf, 0); 983 app = e_app_new(buf, 0);
1116 if (app) 984 if (app)
1117 { 985 {
@@ -1151,10 +1019,7 @@ e_fm2_icon_get(Evas *evas, const char *realpath,
1151 } 1019 }
1152 else 1020 else
1153 { 1021 {
1154 if (ici->pseudo_link) 1022 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1155 snprintf(buf, sizeof(buf), "%s/%s", ici->pseudo_dir, ici->file);
1156 else
1157 snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
1158 /* fallback */ 1023 /* fallback */
1159 if ( 1024 if (
1160 (e_util_glob_case_match(ici->file, "*.edj")) 1025 (e_util_glob_case_match(ici->file, "*.edj"))
@@ -1281,6 +1146,299 @@ e_fm2_icon_get(Evas *evas, const char *realpath,
1281 return oic; 1146 return oic;
1282} 1147}
1283 1148
1149/* FIXME: tmp delay - fix later */
1150static int
1151_e_fm2_cb_spawn_timer(void *data)
1152{
1153 Ecore_Exe *exe;
1154 char buf[4096];
1155
1156 snprintf(buf, sizeof(buf), "%s/enlightenment_fm", e_prefix_bin_get());
1157 exe = ecore_exe_run(buf, NULL);
1158 return 0;
1159}
1160
1161static void
1162_e_fm2_client_spawn(void)
1163{
1164 /* for now spawn the fm 1.0 seconds later making sure e is up -
1165 * in reality this needs to be be done on demand and queued - tracking exe
1166 * as well as clients - so if client dies - we know (before it connects),
1167 * and all requests need to be queued until slave is up.
1168 */
1169 ecore_timer_add(1.0, _e_fm2_cb_spawn_timer, NULL);
1170}
1171
1172static E_Fm2_Client *
1173_e_fm2_client_get(void)
1174{
1175 Evas_List *l;
1176 E_Fm2_Client *cl, *cl_chosen = NULL;
1177 int min_req = 0x7fffffff;
1178
1179 /* if we don't have a slave - spane one */
1180 if (!_e_fm2_client_list)
1181 {
1182// _e_fm2_client_spawn();
1183 return NULL;
1184 }
1185 for (l = _e_fm2_client_list; l; l = l->next)
1186 {
1187 cl = l->data;
1188 if (cl->req < min_req)
1189 {
1190 min_req = cl->req;
1191 cl_chosen = cl;
1192 }
1193 }
1194 return cl_chosen;
1195}
1196
1197static void
1198_e_fm2_client_monitor_add(int id, const char *path)
1199{
1200 E_Fm2_Client *cl;
1201
1202 /* FIXME: for now if there is no client - abort the op entirely */
1203 cl = _e_fm2_client_get();
1204 if (!cl) return;
1205 ecore_ipc_client_send(cl->cl, E_IPC_DOMAIN_FM, 1,
1206 id, 0, 0,
1207 (void *)path, strlen(path) + 1);
1208 cl->req++;
1209}
1210
1211static void
1212_e_fm2_client_monitor_del(int id, const char *path)
1213{
1214 E_Fm2_Client *cl;
1215
1216 /* FIXME: for now if there is no client - abort the op entirely */
1217 cl = _e_fm2_client_get();
1218 if (!cl) return;
1219 ecore_ipc_client_send(cl->cl, E_IPC_DOMAIN_FM, 2,
1220 id, 0, 0,
1221 (void *)path, strlen(path) + 1);
1222 cl->req++;
1223}
1224
1225static void
1226_e_fm2_client_monitor_list_end(Evas_Object *obj)
1227{
1228 E_Fm2_Smart_Data *sd;
1229
1230 sd = evas_object_smart_data_get(obj);
1231 sd->busy_count--;
1232 if (sd->busy_count == 0)
1233 {
1234 edje_object_signal_emit(sd->overlay, "e,state,busy,stop", "e");
1235 e_fm2_custom_file_flush();
1236 }
1237 if (sd->tmp.obj)
1238 {
1239 evas_object_del(sd->tmp.obj);
1240 sd->tmp.obj = NULL;
1241 }
1242 if (sd->tmp.obj2)
1243 {
1244 evas_object_del(sd->tmp.obj2);
1245 sd->tmp.obj2 = NULL;
1246 }
1247 if (sd->scan_timer)
1248 {
1249 ecore_timer_del(sd->scan_timer);
1250 sd->scan_timer = NULL;
1251 }
1252 if (sd->sort_idler)
1253 {
1254 ecore_idler_del(sd->sort_idler);
1255 sd->sort_idler = NULL;
1256 }
1257 E_FREE(sd->tmp.list_index);
1258 _e_fm2_queue_free(obj);
1259 _e_fm2_obj_icons_place(sd);
1260 _e_fm2_live_process_begin(obj);
1261}
1262
1263EAPI void
1264e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
1265{
1266 Evas_List *l;
1267 E_Fm2_Client *cl;
1268
1269 if (e->major != 6/*E_IPC_DOMAIN_FM*/) return;
1270 for (l = _e_fm2_client_list; l; l = l->next)
1271 {
1272 cl = l->data;
1273 if (cl->cl == e->client) break;
1274 }
1275 if (!l)
1276 {
1277 cl = E_NEW(E_Fm2_Client, 1);
1278 cl->cl = e->client;
1279 _e_fm2_client_list = evas_list_prepend(_e_fm2_client_list, cl);
1280 }
1281
1282 for (l = _e_fm2_list; l; l = l->next)
1283 {
1284 unsigned char *p;
1285 char *evdir;
1286 const char *dir, *path, *lnk, *rlnk, *file;
1287 struct stat st;
1288 int broken_link;
1289 E_Fm2_Smart_Data *sd;
1290 void **sdat;
1291
1292 dir = e_fm2_real_path_get(l->data);
1293 sd = evas_object_smart_data_get(l->data);
1294 switch (e->minor)
1295 {
1296 case 1:/*hello*/
1297 break;
1298 case 2:/*req ok*/
1299 cl->req--;
1300 break;
1301 case 3:/*file add*/
1302 case 5:/*file change*/
1303 {
1304 E_Fm2_Finfo finf;
1305
1306 p = e->data;
1307 /* NOTE: i am NOT converting this data to portable arch/os independant
1308 * format. i am ASSUMING e_fm_main and e are local and built together
1309 * and thus this will work. if this ever changes this here needs to
1310 * change */
1311 memcpy(&st, p, sizeof(struct stat));
1312 p += sizeof(struct stat);
1313
1314 broken_link = p[0];
1315 p += 1;
1316
1317 path = p;
1318 p += strlen(path) + 1;
1319
1320 lnk = p;
1321 p += strlen(lnk) + 1;
1322
1323 rlnk = p;
1324 p += strlen(rlnk) + 1;
1325
1326 memcpy(&(finf.st), &st, sizeof(struct stat));
1327 finf.broken_link = broken_link;
1328 finf.lnk = lnk;
1329 finf.rlnk = rlnk;
1330
1331 evdir = ecore_file_get_dir(path);
1332 if ((sd->id == e->ref_to) && (!strcmp(dir, evdir)))
1333 {
1334 if (e->response == 0)/*live changes*/
1335 {
1336 if (e->minor == 3)/*file add*/
1337 {
1338 _e_fm2_live_file_add
1339 (l->data, ecore_file_get_file(path),
1340 NULL, 0, &finf);
1341 }
1342 else if (e->minor == 5)/*file change*/
1343 {
1344 _e_fm2_live_file_changed
1345 (l->data, (char *)ecore_file_get_file(path),
1346 &finf);
1347 }
1348 }
1349 else/*file add - listing*/
1350 {
1351 if (e->minor == 3)/*file add*/
1352 {
1353 if (!sd->scan_timer)
1354 {
1355 sd->scan_timer =
1356 ecore_timer_add(0.5,
1357 _e_fm2_cb_scan_timer,
1358 sd->obj);
1359 sd->busy_count++;
1360 if (sd->busy_count == 1)
1361 edje_object_signal_emit(sd->overlay, "e,state,busy,start", "e");
1362 }
1363 file = ecore_file_get_file(path);
1364 if ((!strcmp(file, ".order")))
1365 sd->order_file = 1;
1366 else
1367 {
1368 if (!((file[0] == '.') &&
1369 (!sd->show_hidden_files)))
1370 _e_fm2_file_add(l->data, file,
1371 sd->order_file,
1372 NULL, 0, &finf);
1373 }
1374 if (e->response == 2)/* end of scan */
1375 {
1376 sd->listing = 0;
1377 if (sd->scan_timer)
1378 {
1379 ecore_timer_del(sd->scan_timer);
1380 sd->scan_timer =
1381 ecore_timer_add(0.0001,
1382 _e_fm2_cb_scan_timer,
1383 sd->obj);
1384 }
1385 else
1386 {
1387 _e_fm2_client_monitor_list_end(l->data);
1388 }
1389 }
1390 }
1391 }
1392 }
1393 free(evdir);
1394 }
1395 break;
1396 case 4:/*file del*/
1397 path = e->data;
1398 evdir = ecore_file_get_dir(path);
1399 if ((sd->id == e->ref_to) && (!strcmp(dir, evdir)))
1400 {
1401 _e_fm2_live_file_del
1402 (l->data, ecore_file_get_file(path));
1403 }
1404 free(evdir);
1405 break;
1406 case 6:/*mon dir del*/
1407 path = e->data;
1408 if ((sd->id == e->ref_to) && (!strcmp(dir, path)))
1409 {
1410 }
1411 break;
1412 default:
1413 break;
1414 }
1415 }
1416 if (e->minor == 7)
1417 {
1418 ecore_ipc_client_send(cl->cl, E_IPC_DOMAIN_FM, 12,
1419 0, 0, e->response,
1420 NULL, 0);
1421 }
1422}
1423
1424EAPI void
1425e_fm2_client_del(Ecore_Ipc_Event_Client_Del *e)
1426{
1427 Evas_List *l;
1428 E_Fm2_Client *cl;
1429
1430 for (l = _e_fm2_client_list; l; l = l->next)
1431 {
1432 cl = l->data;
1433 if (cl->cl == e->client)
1434 {
1435 _e_fm2_client_list = evas_list_remove_list(_e_fm2_client_list, l);
1436 free(cl);
1437 break;
1438 }
1439 }
1440}
1441
1284/* local subsystem functions */ 1442/* local subsystem functions */
1285static const char * 1443static const char *
1286_e_fm2_dev_path_map(const char *dev, const char *path) 1444_e_fm2_dev_path_map(const char *dev, const char *path)
@@ -1362,7 +1520,7 @@ _e_fm2_dev_path_map(const char *dev, const char *path)
1362} 1520}
1363 1521
1364static void 1522static void
1365_e_fm2_file_add(Evas_Object *obj, const char *file, int unique, const char *file_rel, int after) 1523_e_fm2_file_add(Evas_Object *obj, const char *file, int unique, const char *file_rel, int after, E_Fm2_Finfo *finf)
1366{ 1524{
1367 E_Fm2_Smart_Data *sd; 1525 E_Fm2_Smart_Data *sd;
1368 E_Fm2_Icon *ic, *ic2; 1526 E_Fm2_Icon *ic, *ic2;
@@ -1379,7 +1537,6 @@ _e_fm2_file_add(Evas_Object *obj, const char *file, int unique, const char *file
1379 if (!strcmp(ic->info.file, file)) 1537 if (!strcmp(ic->info.file, file))
1380 { 1538 {
1381 sd->tmp.last_insert = NULL; 1539 sd->tmp.last_insert = NULL;
1382// sd->iconlist_changed = 1;
1383 return; 1540 return;
1384 } 1541 }
1385 } 1542 }
@@ -1389,13 +1546,12 @@ _e_fm2_file_add(Evas_Object *obj, const char *file, int unique, const char *file
1389 if (!strcmp(ic->info.file, file)) 1546 if (!strcmp(ic->info.file, file))
1390 { 1547 {
1391 sd->tmp.last_insert = NULL; 1548 sd->tmp.last_insert = NULL;
1392// sd->iconlist_changed = 1;
1393 return; 1549 return;
1394 } 1550 }
1395 } 1551 }
1396 } 1552 }
1397 /* create icon obj and append to unsorted list */ 1553 /* create icon obj and append to unsorted list */
1398 ic = _e_fm2_icon_new(sd, file); 1554 ic = _e_fm2_icon_new(sd, file, finf);
1399 if (ic) 1555 if (ic)
1400 { 1556 {
1401 if (!file_rel) 1557 if (!file_rel)
@@ -1463,100 +1619,6 @@ _e_fm2_file_del(Evas_Object *obj, const char *file)
1463} 1619}
1464 1620
1465static void 1621static void
1466_e_fm2_scan_start(Evas_Object *obj)
1467{
1468 E_Fm2_Smart_Data *sd;
1469
1470 sd = evas_object_smart_data_get(obj);
1471 if (!sd) return;
1472 /* start scanning the dir in an idler and putting found items on the */
1473 /* queue as icons - waiting for sorting and region insertion by a */
1474 /* timer that ticks off taking queued icons and putting them in a */
1475 /* sorted position in the icon list */
1476 /* this system is great - it completely does the dir scanning in idle
1477 * time when e has nothing better to do - BUt it will mean that the dir
1478 * will first draw with an empty view then slowly fill up as the scan
1479 * happens - this means e remains interactive, but could mean for more
1480 * redraws that we want. what we want to do is maybe bring some of the
1481 * scan forward to here for a short period of time so when the window
1482 * is drawn - its drawn with contents ... if they didnt take too long
1483 * to fill
1484 */
1485 /* if i add the above pre-scan and it doesnt finish - continue here */
1486 if ((sd->scan_idler) || (sd->scan_timer)) return;
1487 sd->order_file = 0;
1488 ecore_desktop_instrumentation_reset();
1489 if (sd->monitor.monitor) ecore_file_monitor_del(sd->monitor.monitor);
1490 sd->monitor.monitor = ecore_file_monitor_add(sd->realpath, _e_fm2_cb_file_monitor, obj);
1491 sd->scan_idler = ecore_idler_add(_e_fm2_cb_scan_idler, obj);
1492 sd->scan_timer = ecore_timer_add(0.5, _e_fm2_cb_scan_timer, obj);
1493 sd->busy_count++;
1494 if (sd->busy_count == 1)
1495 edje_object_signal_emit(sd->overlay, "e,state,busy,start", "e");
1496}
1497
1498static void
1499_e_fm2_scan_stop(Evas_Object *obj)
1500{
1501 E_Fm2_Smart_Data *sd;
1502
1503 sd = evas_object_smart_data_get(obj);
1504 if (!sd) return;
1505 if ((sd->dir) || (sd->order))
1506 {
1507 sd->busy_count--;
1508 if (sd->busy_count == 0)
1509 {
1510 edje_object_signal_emit(sd->overlay, "e,state,busy,stop", "e");
1511 e_fm2_custom_file_flush();
1512 }
1513 }
1514 /* stop the scan idler, the sort timer and free the queue */
1515 if (sd->dir)
1516 {
1517 closedir(sd->dir);
1518 sd->dir = NULL;
1519 }
1520 if (sd->order)
1521 {
1522 fclose(sd->order);
1523 sd->order = NULL;
1524 }
1525 if (sd->tmp.obj)
1526 {
1527 evas_object_del(sd->tmp.obj);
1528 sd->tmp.obj = NULL;
1529 }
1530 if (sd->tmp.obj2)
1531 {
1532 evas_object_del(sd->tmp.obj2);
1533 sd->tmp.obj2 = NULL;
1534 }
1535 if (sd->scan_idler)
1536 {
1537 ecore_idler_del(sd->scan_idler);
1538 sd->scan_idler = NULL;
1539 }
1540 if (sd->scan_timer)
1541 {
1542 ecore_timer_del(sd->scan_timer);
1543 sd->scan_timer = NULL;
1544 }
1545 if (sd->sort_idler)
1546 {
1547 ecore_idler_del(sd->sort_idler);
1548 sd->sort_idler = NULL;
1549 }
1550
1551 E_FREE(sd->tmp.list_index);
1552 _e_fm2_queue_free(obj);
1553 _e_fm2_obj_icons_place(sd);
1554 ecore_desktop_instrumentation_print();
1555
1556 _e_fm2_live_process_begin(obj);
1557}
1558
1559static void
1560_e_fm2_queue_process(Evas_Object *obj) 1622_e_fm2_queue_process(Evas_Object *obj)
1561{ 1623{
1562 E_Fm2_Smart_Data *sd; 1624 E_Fm2_Smart_Data *sd;
@@ -1614,7 +1676,6 @@ _e_fm2_queue_process(Evas_Object *obj)
1614 l = sd->tmp.last_insert; 1676 l = sd->tmp.last_insert;
1615 while (sd->queue) 1677 while (sd->queue)
1616 { 1678 {
1617
1618 ic = sd->queue->data; 1679 ic = sd->queue->data;
1619 sd->queue = evas_list_remove_list(sd->queue, sd->queue); 1680 sd->queue = evas_list_remove_list(sd->queue, sd->queue);
1620 /* insertion sort - better than qsort for the way we are doing 1681 /* insertion sort - better than qsort for the way we are doing
@@ -1655,8 +1716,6 @@ _e_fm2_queue_process(Evas_Object *obj)
1655// added, sd->tmp.iter); 1716// added, sd->tmp.iter);
1656 snprintf(buf, sizeof(buf), _("%i Files"), evas_list_count(sd->icons)); 1717 snprintf(buf, sizeof(buf), _("%i Files"), evas_list_count(sd->icons));
1657 edje_object_part_text_set(sd->overlay, "e.text.busy_label", buf); 1718 edje_object_part_text_set(sd->overlay, "e.text.busy_label", buf);
1658 /* FIXME: this could get a lot faster - avoid it or something. scan
1659 speed goes from 200-250 files/0.2 sec to 80 or so in my tests */
1660 if (sd->resize_job) ecore_job_del(sd->resize_job); 1719 if (sd->resize_job) ecore_job_del(sd->resize_job);
1661 sd->resize_job = ecore_job_add(_e_fm2_cb_resize_job, obj); 1720 sd->resize_job = ecore_job_add(_e_fm2_cb_resize_job, obj);
1662 evas_object_smart_callback_call(sd->obj, "changed", NULL); 1721 evas_object_smart_callback_call(sd->obj, "changed", NULL);
@@ -1991,7 +2050,6 @@ _e_fm2_regions_eval(Evas_Object *obj)
1991static void 2050static void
1992_e_fm2_config_free(E_Fm2_Config *cfg) 2051_e_fm2_config_free(E_Fm2_Config *cfg)
1993{ 2052{
1994 if (cfg->view.extra_file_source) evas_stringshare_del(cfg->view.extra_file_source);
1995 if (cfg->icon.key_hint) evas_stringshare_del(cfg->icon.key_hint); 2053 if (cfg->icon.key_hint) evas_stringshare_del(cfg->icon.key_hint);
1996 if (cfg->theme.background) evas_stringshare_del(cfg->theme.background); 2054 if (cfg->theme.background) evas_stringshare_del(cfg->theme.background);
1997 if (cfg->theme.frame) evas_stringshare_del(cfg->theme.frame); 2055 if (cfg->theme.frame) evas_stringshare_del(cfg->theme.frame);
@@ -2002,7 +2060,7 @@ _e_fm2_config_free(E_Fm2_Config *cfg)
2002/**************************/ 2060/**************************/
2003 2061
2004static E_Fm2_Icon * 2062static E_Fm2_Icon *
2005_e_fm2_icon_new(E_Fm2_Smart_Data *sd, const char *file) 2063_e_fm2_icon_new(E_Fm2_Smart_Data *sd, const char *file, E_Fm2_Finfo *finf)
2006{ 2064{
2007 E_Fm2_Icon *ic; 2065 E_Fm2_Icon *ic;
2008 2066
@@ -2011,7 +2069,7 @@ _e_fm2_icon_new(E_Fm2_Smart_Data *sd, const char *file)
2011 ic->info.fm = sd->obj; 2069 ic->info.fm = sd->obj;
2012 ic->info.file = evas_stringshare_add(file); 2070 ic->info.file = evas_stringshare_add(file);
2013 ic->sd = sd; 2071 ic->sd = sd;
2014 if (!_e_fm2_icon_fill(ic)) 2072 if (!_e_fm2_icon_fill(ic, finf))
2015 { 2073 {
2016 evas_stringshare_del(ic->info.file); 2074 evas_stringshare_del(ic->info.file);
2017 free(ic); 2075 free(ic);
@@ -2030,7 +2088,6 @@ _e_fm2_icon_unfill(E_Fm2_Icon *ic)
2030 if (ic->info.icon) evas_stringshare_del(ic->info.icon); 2088 if (ic->info.icon) evas_stringshare_del(ic->info.icon);
2031 if (ic->info.link) evas_stringshare_del(ic->info.link); 2089 if (ic->info.link) evas_stringshare_del(ic->info.link);
2032 if (ic->info.real_link) evas_stringshare_del(ic->info.real_link); 2090 if (ic->info.real_link) evas_stringshare_del(ic->info.real_link);
2033 if (ic->info.pseudo_dir) evas_stringshare_del(ic->info.pseudo_dir);
2034 ic->info.mime = NULL; 2091 ic->info.mime = NULL;
2035 ic->info.label = NULL; 2092 ic->info.label = NULL;
2036 ic->info.comment = NULL; 2093 ic->info.comment = NULL;
@@ -2038,16 +2095,14 @@ _e_fm2_icon_unfill(E_Fm2_Icon *ic)
2038 ic->info.icon = NULL; 2095 ic->info.icon = NULL;
2039 ic->info.link = NULL; 2096 ic->info.link = NULL;
2040 ic->info.real_link = NULL; 2097 ic->info.real_link = NULL;
2041 ic->info.pseudo_dir = NULL;
2042 ic->info.mount = 0; 2098 ic->info.mount = 0;
2043 ic->info.removable = 0; 2099 ic->info.removable = 0;
2044 ic->info.pseudo_link = 0;
2045 ic->info.deleted = 0; 2100 ic->info.deleted = 0;
2046 ic->info.broken_link = 0; 2101 ic->info.broken_link = 0;
2047} 2102}
2048 2103
2049static int 2104static int
2050_e_fm2_icon_fill(E_Fm2_Icon *ic) 2105_e_fm2_icon_fill(E_Fm2_Icon *ic, E_Fm2_Finfo *finf)
2051{ 2106{
2052 Evas_Coord mw = 0, mh = 0; 2107 Evas_Coord mw = 0, mh = 0;
2053 Evas_Object *obj, *obj2; 2108 Evas_Object *obj, *obj2;
@@ -2057,47 +2112,51 @@ _e_fm2_icon_fill(E_Fm2_Icon *ic)
2057 2112
2058 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); 2113 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
2059 cf = e_fm2_custom_file_get(buf); 2114 cf = e_fm2_custom_file_get(buf);
2060 lnk = ecore_file_readlink(buf); 2115 if (finf)
2061 if (stat(buf, &(ic->info.statinfo)) == -1)
2062 { 2116 {
2063 if (lnk) 2117 memcpy(&(ic->info.statinfo), &(finf->st), sizeof(struct stat));
2064 ic->info.broken_link = 1; 2118 if ((finf->lnk) && (finf->lnk[0]))
2065 else 2119 ic->info.link = evas_stringshare_add(finf->lnk);
2066 { 2120 if ((finf->rlnk) && (finf->rlnk[0]))
2067 if (ic->sd->config->view.extra_file_source) 2121 ic->info.real_link = evas_stringshare_add(finf->rlnk);
2068 { 2122 ic->info.broken_link = finf->broken_link;
2069 snprintf(buf, sizeof(buf), "%s/%s",
2070 ic->sd->config->view.extra_file_source, ic->info.file);
2071 if (stat(buf, &(ic->info.statinfo)) == -1)
2072 return 0;
2073 ic->info.pseudo_dir = evas_stringshare_add(ic->sd->config->view.extra_file_source);
2074 ic->info.pseudo_link = 1;
2075 }
2076 else
2077 return 0;
2078 }
2079 } 2123 }
2080 if (lnk) 2124 else
2081 { 2125 {
2082 if (lnk[0] == '/') 2126 /* FIXME: this should go away... */
2127 lnk = ecore_file_readlink(buf);
2128 if (stat(buf, &(ic->info.statinfo)) == -1)
2083 { 2129 {
2084 ic->info.link = evas_stringshare_add(lnk); 2130 if (lnk)
2085 ic->info.real_link = evas_stringshare_add(lnk); 2131 ic->info.broken_link = 1;
2132 else
2133 {
2134 return 0;
2135 }
2086 } 2136 }
2087 else 2137 if (lnk)
2088 { 2138 {
2089 char *rp; 2139 if (lnk[0] == '/')
2090
2091 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, lnk);
2092 rp = ecore_file_realpath(buf);
2093 if (rp)
2094 { 2140 {
2095 ic->info.link = evas_stringshare_add(rp); 2141 ic->info.link = evas_stringshare_add(lnk);
2096 free(rp); 2142 ic->info.real_link = evas_stringshare_add(lnk);
2097 } 2143 }
2098 ic->info.real_link = evas_stringshare_add(lnk); 2144 else
2145 {
2146 char *rp;
2147
2148 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, lnk);
2149 rp = ecore_file_realpath(buf);
2150 if (rp)
2151 {
2152 ic->info.link = evas_stringshare_add(rp);
2153 free(rp);
2154 }
2155 ic->info.real_link = evas_stringshare_add(lnk);
2156 }
2157 free(lnk);
2099 } 2158 }
2100 free(lnk); 2159 /* FIXME: end go away chunk */
2101 } 2160 }
2102 2161
2103 if (!ic->info.mime) 2162 if (!ic->info.mime)
@@ -2243,7 +2302,6 @@ _e_fm2_icon_free(E_Fm2_Icon *ic)
2243 if (ic->info.icon) evas_stringshare_del(ic->info.icon); 2302 if (ic->info.icon) evas_stringshare_del(ic->info.icon);
2244 if (ic->info.link) evas_stringshare_del(ic->info.link); 2303 if (ic->info.link) evas_stringshare_del(ic->info.link);
2245 if (ic->info.real_link) evas_stringshare_del(ic->info.real_link); 2304 if (ic->info.real_link) evas_stringshare_del(ic->info.real_link);
2246 if (ic->info.pseudo_dir) evas_stringshare_del(ic->info.pseudo_dir);
2247 free(ic); 2305 free(ic);
2248} 2306}
2249 2307
@@ -2408,7 +2466,7 @@ _e_fm2_icon_thumb(E_Fm2_Icon *ic, Evas_Object *oic, int force)
2408 ((_e_fm2_icon_visible(ic)) && 2466 ((_e_fm2_icon_visible(ic)) &&
2409 (!ic->sd->queue) && 2467 (!ic->sd->queue) &&
2410 (!ic->sd->sort_idler) && 2468 (!ic->sd->sort_idler) &&
2411 (!ic->sd->scan_idler))) 2469 (!ic->sd->listing)))
2412 e_thumb_icon_begin(oic); 2470 e_thumb_icon_begin(oic);
2413} 2471}
2414 2472
@@ -2423,8 +2481,6 @@ _e_fm2_icon_select(E_Fm2_Icon *ic)
2423 edje_object_signal_emit(ic->obj, "e,state,selected", "e"); 2481 edje_object_signal_emit(ic->obj, "e,state,selected", "e");
2424 edje_object_signal_emit(ic->obj_icon, "e,state,selected", "e"); 2482 edje_object_signal_emit(ic->obj_icon, "e,state,selected", "e");
2425 evas_object_stack_below(ic->obj, ic->sd->drop); 2483 evas_object_stack_below(ic->obj, ic->sd->drop);
2426// evas_object_stack_below(ic->sd->drop, ic->sd->overlay);
2427// evas_object_stack_below(ic->sd->drop_in, ic->sd->overlay);
2428 } 2484 }
2429} 2485}
2430 2486
@@ -2463,10 +2519,7 @@ _e_fm2_icon_desktop_load(E_Fm2_Icon *ic)
2463 char buf[4096]; 2519 char buf[4096];
2464 Ecore_Desktop *desktop; 2520 Ecore_Desktop *desktop;
2465 2521
2466 if (ic->info.pseudo_link) 2522 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
2467 snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file);
2468 else
2469 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
2470 2523
2471 desktop = ecore_desktop_get(buf, NULL); 2524 desktop = ecore_desktop_get(buf, NULL);
2472 if (desktop) 2525 if (desktop)
@@ -2524,13 +2577,11 @@ _e_fm2_icon_desktop_load(E_Fm2_Icon *ic)
2524 if (ic->info.generic) evas_stringshare_del(ic->info.generic); 2577 if (ic->info.generic) evas_stringshare_del(ic->info.generic);
2525 if (ic->info.icon) evas_stringshare_del(ic->info.icon); 2578 if (ic->info.icon) evas_stringshare_del(ic->info.icon);
2526 if (ic->info.link) evas_stringshare_del(ic->info.link); 2579 if (ic->info.link) evas_stringshare_del(ic->info.link);
2527 if (ic->info.pseudo_dir) evas_stringshare_del(ic->info.pseudo_dir);
2528 ic->info.label = NULL; 2580 ic->info.label = NULL;
2529 ic->info.comment = NULL; 2581 ic->info.comment = NULL;
2530 ic->info.generic = NULL; 2582 ic->info.generic = NULL;
2531 ic->info.icon = NULL; 2583 ic->info.icon = NULL;
2532 ic->info.link = NULL; 2584 ic->info.link = NULL;
2533 ic->info.pseudo_dir = NULL;
2534 return 0; 2585 return 0;
2535} 2586}
2536 2587
@@ -2844,10 +2895,7 @@ _e_fm2_typebuf_run(Evas_Object *obj)
2844 char buf[4096], *dev = NULL; 2895 char buf[4096], *dev = NULL;
2845 2896
2846 if (ic->sd->dev) dev = strdup(ic->sd->dev); 2897 if (ic->sd->dev) dev = strdup(ic->sd->dev);
2847 if (ic->info.pseudo_link) 2898 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
2848 snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file);
2849 else
2850 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
2851 e_fm2_path_set(ic->sd->obj, dev, buf); 2899 e_fm2_path_set(ic->sd->obj, dev, buf);
2852 E_FREE(dev); 2900 E_FREE(dev);
2853 } 2901 }
@@ -3288,53 +3336,16 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
3288 /* if the file is not in the target dir */ 3336 /* if the file is not in the target dir */
3289 if (strcmp(d, sd->realpath)) 3337 if (strcmp(d, sd->realpath))
3290 { 3338 {
3291 /* if the file is not a pseudo-link */ 3339 _e_fm2_live_file_add(sd->obj,
3292 if (e_util_strcmp(sd->config->view.extra_file_source, d)) 3340 ecore_file_get_file(fp),
3293 { 3341 NULL, 0, NULL);
3294 /* move the file into the subdir */
3295 snprintf(buf, sizeof(buf), "%s/%s",
3296 sd->realpath, ecore_file_get_file(fp));
3297 e_fm2_fop_move_add(sd->obj,
3298 fp, buf,
3299 NULL, 0, 1);
3300// if (ecore_file_exists(buf))
3301// {
3302// /* FIXME: error - file exists */
3303// }
3304// else
3305// {
3306/*FOPME*/
3307// if (ecore_file_mv(fp, buf))
3308// _e_fm2_live_file_add(sd->obj,
3309// ecore_file_get_file(fp),
3310// NULL, 0);
3311// }
3312 }
3313 else
3314 _e_fm2_live_file_add(sd->obj,
3315 ecore_file_get_file(fp),
3316 NULL, 0);
3317 } 3342 }
3318 else 3343 else
3319 { 3344 {
3320 /* file is in target dir - move into subdir */ 3345 /* file is in target dir - move into subdir */
3321 snprintf(buf, sizeof(buf), "%s/%s", 3346 snprintf(buf, sizeof(buf), "%s/%s",
3322 sd->realpath, ecore_file_get_file(fp)); 3347 sd->realpath, ecore_file_get_file(fp));
3323 e_fm2_fop_move_add(sd->obj, 3348 printf("mv %s %s\n", (char *)fp, buf);
3324 fp, buf,
3325 NULL, 0, 1);
3326// if (ecore_file_exists(buf))
3327// {
3328// /* FIXME: error - file exists */
3329// }
3330// else
3331// {
3332/*FOPME*/
3333// if (ecore_file_mv(fp, buf))
3334// _e_fm2_live_file_add(sd->obj,
3335// ecore_file_get_file(fp),
3336// NULL, 0);
3337// }
3338 } 3349 }
3339 free(d); 3350 free(d);
3340 } 3351 }
@@ -3355,15 +3366,6 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
3355 snprintf(buf, sizeof(buf), "%s/%s/%s", 3366 snprintf(buf, sizeof(buf), "%s/%s/%s",
3356 sd->realpath, sd->drop_icon->info.file, ecore_file_get_file(fp)); 3367 sd->realpath, sd->drop_icon->info.file, ecore_file_get_file(fp));
3357 printf("mv %s %s\n", (char *)fp, buf); 3368 printf("mv %s %s\n", (char *)fp, buf);
3358 e_fm2_fop_move_add(sd->obj,
3359 fp, buf,
3360 NULL, 0, 0);
3361// if (ecore_file_exists(buf))
3362// {
3363// /* FIXME: error - file exists */
3364// }
3365// else
3366///*FOPME*/ ecore_file_mv(fp, buf);
3367 evas_stringshare_del(fp); 3369 evas_stringshare_del(fp);
3368 } 3370 }
3369 } 3371 }
@@ -3390,28 +3392,16 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
3390 else 3392 else
3391 { 3393 {
3392 if (sd->config->view.link_drop) 3394 if (sd->config->view.link_drop)
3393 e_fm2_fop_link_add(sd->obj, fp, buf); 3395 {
3396 printf("ln -s %s %s\n", (char *)fp, buf);
3397 }
3394 else 3398 else
3395 e_fm2_fop_move_add(sd->obj, 3399 {
3396 fp, buf, 3400 printf("mv %s %s\n", (char *)fp, buf);
3397 NULL, 0, 0); 3401 }
3398 } 3402 }
3399 free(d); 3403 free(d);
3400 } 3404 }
3401// d = ecore_file_get_dir(fp);
3402// if (d)
3403// {
3404// if (!strcmp(d, sd->realpath))
3405// {
3406// printf("listrm %s\n", ecore_file_get_file(fp));
3407// _e_fm2_live_file_del(sd->obj, ecore_file_get_file(fp));
3408// }
3409// else
3410// {
3411///*FOPME*/ ecore_file_symlink(fp, buf);
3412// }
3413// free(d);
3414// }
3415 evas_stringshare_del(fp); 3405 evas_stringshare_del(fp);
3416 } 3406 }
3417 if (sd->drop_after == 0) 3407 if (sd->drop_after == 0)
@@ -3420,7 +3410,9 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
3420 { 3410 {
3421 fp = _e_fm2_icon_desktop_url_eval(ll->data); 3411 fp = _e_fm2_icon_desktop_url_eval(ll->data);
3422 if (!fp) continue; 3412 if (!fp) continue;
3413/*
3423 e_fm2_fop_add_add(sd->obj, fp, sd->drop_icon->info.file, 0); 3414 e_fm2_fop_add_add(sd->obj, fp, sd->drop_icon->info.file, 0);
3415 */
3424// printf("listadd %s, before %s\n", ecore_file_get_file(fp), sd->drop_icon->info.file); 3416// printf("listadd %s, before %s\n", ecore_file_get_file(fp), sd->drop_icon->info.file);
3425// _e_fm2_live_file_add(sd->obj, 3417// _e_fm2_live_file_add(sd->obj,
3426// ecore_file_get_file(fp), 3418// ecore_file_get_file(fp),
@@ -3434,7 +3426,9 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
3434 { 3426 {
3435 fp = _e_fm2_icon_desktop_url_eval(ll->data); 3427 fp = _e_fm2_icon_desktop_url_eval(ll->data);
3436 if (!fp) continue; 3428 if (!fp) continue;
3429/*
3437 e_fm2_fop_add_add(sd->obj, fp, sd->drop_icon->info.file, 1); 3430 e_fm2_fop_add_add(sd->obj, fp, sd->drop_icon->info.file, 1);
3431 */
3438// printf("listadd %s, after %s\n", ecore_file_get_file(fp), sd->drop_icon->info.file); 3432// printf("listadd %s, after %s\n", ecore_file_get_file(fp), sd->drop_icon->info.file);
3439// _e_fm2_live_file_add(sd->obj, 3433// _e_fm2_live_file_add(sd->obj,
3440// ecore_file_get_file(fp), 3434// ecore_file_get_file(fp),
@@ -3453,20 +3447,6 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
3453 snprintf(buf, sizeof(buf), "%s/%s", 3447 snprintf(buf, sizeof(buf), "%s/%s",
3454 sd->realpath, ecore_file_get_file(fp)); 3448 sd->realpath, ecore_file_get_file(fp));
3455 printf("mv %s %s\n", (char *)fp, buf); 3449 printf("mv %s %s\n", (char *)fp, buf);
3456 e_fm2_fop_move_add(sd->obj,
3457 fp, buf,
3458 NULL, 0, 1);
3459// if (ecore_file_exists(buf))
3460// {
3461// /* FIXME: error - file exists */
3462// }
3463// else
3464// {
3465///*FOPME*/ if (ecore_file_mv(fp, buf))
3466// _e_fm2_live_file_add(sd->obj,
3467// ecore_file_get_file(fp),
3468// NULL, 0);
3469// }
3470 evas_stringshare_del(fp); 3450 evas_stringshare_del(fp);
3471 } 3451 }
3472 } 3452 }
@@ -3618,10 +3598,7 @@ _e_fm2_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
3618 char buf[4096], *dev = NULL; 3598 char buf[4096], *dev = NULL;
3619 3599
3620 if (ic->sd->dev) dev = strdup(ic->sd->dev); 3600 if (ic->sd->dev) dev = strdup(ic->sd->dev);
3621 if (ic->info.pseudo_link) 3601 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
3622 snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file);
3623 else
3624 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
3625 e_fm2_path_set(ic->sd->obj, dev, buf); 3602 e_fm2_path_set(ic->sd->obj, dev, buf);
3626 E_FREE(dev); 3603 E_FREE(dev);
3627 } 3604 }
@@ -3747,15 +3724,10 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_inf
3747 { 3724 {
3748 ici = l->data; 3725 ici = l->data;
3749 /* file:///path is correct: file://<host>/<path> with null <host> */ 3726 /* file:///path is correct: file://<host>/<path> with null <host> */
3750 if (ici->pseudo_link) 3727 if (!strcmp(realpath, "/"))
3751 snprintf(buf, sizeof(buf), "file://%s/%s", ici->pseudo_dir, ici->file); 3728 snprintf(buf, sizeof(buf), "file:///%s", ici->file);
3752 else 3729 else
3753 { 3730 snprintf(buf, sizeof(buf), "file://%s/%s", realpath, ici->file);
3754 if (!strcmp(realpath, "/"))
3755 snprintf(buf, sizeof(buf), "file:///%s", ici->file);
3756 else
3757 snprintf(buf, sizeof(buf), "file://%s/%s", realpath, ici->file);
3758 }
3759 fsel = evas_list_append(fsel, strdup(buf)); 3731 fsel = evas_list_append(fsel, strdup(buf));
3760 } 3732 }
3761 evas_list_free(sl); 3733 evas_list_free(sl);
@@ -3976,10 +3948,7 @@ _e_fm2_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
3976 char buf[4096], *dev = NULL; 3948 char buf[4096], *dev = NULL;
3977 3949
3978 if (ic->sd->dev) dev = strdup(ic->sd->dev); 3950 if (ic->sd->dev) dev = strdup(ic->sd->dev);
3979 if (ic->info.pseudo_link) 3951 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
3980 snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file);
3981 else
3982 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file);
3983 e_fm2_path_set(ic->sd->obj, dev, buf); 3952 e_fm2_path_set(ic->sd->obj, dev, buf);
3984 E_FREE(dev); 3953 E_FREE(dev);
3985 } 3954 }
@@ -4115,7 +4084,13 @@ _e_fm2_cb_resize_job(void *data)
4115 if (sd->iconlist_changed) 4084 if (sd->iconlist_changed)
4116 { 4085 {
4117 for (l = sd->icons; l; l = l->next) 4086 for (l = sd->icons; l; l = l->next)
4118 _e_fm2_icon_unrealize(l->data); 4087 {
4088 E_Fm2_Icon *ic;
4089
4090 ic = l->data;
4091 ic->region = NULL;
4092// _e_fm2_icon_unrealize(ic);
4093 }
4119 } 4094 }
4120 _e_fm2_regions_free(sd->obj); 4095 _e_fm2_regions_free(sd->obj);
4121 _e_fm2_icons_place(sd->obj); 4096 _e_fm2_icons_place(sd->obj);
@@ -4185,74 +4160,6 @@ _e_fm2_cb_icon_sort(void *data1, void *data2)
4185} 4160}
4186 4161
4187static int 4162static int
4188_e_fm2_cb_scan_idler(void *data)
4189{
4190 E_Fm2_Smart_Data *sd;
4191 struct dirent *dp;
4192 int len;
4193 char buf[4096];
4194
4195 sd = evas_object_smart_data_get(data);
4196 if (!sd) return 0;
4197
4198 if ((!sd->dir) && (!sd->order))
4199 {
4200 if (!sd->order_file)
4201 {
4202 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
4203 sd->order = fopen(buf, "rb");
4204 if (sd->order) sd->order_file = 1;
4205 }
4206 if (!sd->order)
4207 {
4208// sd->order_file = 0;
4209 sd->dir = opendir(sd->realpath);
4210 if (!sd->dir) goto endscan;
4211 }
4212 }
4213
4214 if (sd->order)
4215 {
4216 if (!fgets(buf, sizeof(buf), sd->order))
4217 {
4218 /* stop order file read - now pick up real files */
4219 fclose(sd->order);
4220 sd->order = NULL;
4221 }
4222 else
4223 {
4224 len = strlen(buf);
4225 if ((len > 0) && (buf[len - 1] == '\n')) buf[len - 1] = 0;
4226 _e_fm2_file_add(data, buf, 0, NULL, 0);
4227 }
4228 }
4229 else if (sd->dir)
4230 {
4231 dp = readdir(sd->dir);
4232 if (!dp) goto endscan;
4233 /* no - you don't want the current and parent dir links listed */
4234 if ((!strcmp(dp->d_name, ".")) || (!strcmp(dp->d_name, ".."))) return 1;
4235 /* skip dotfiles if we're not showing hidden files */
4236 if (dp->d_name[0] == '.' && !sd->show_hidden_files) return 1;
4237 /* always hide .order files */
4238 if (!strcmp(dp->d_name, ".order")) return 1;
4239 _e_fm2_file_add(data, dp->d_name, sd->order_file, NULL, 0);
4240 }
4241 return 1;
4242
4243 endscan:
4244 sd->scan_idler = NULL;
4245 if (sd->scan_timer)
4246 {
4247 ecore_timer_del(sd->scan_timer);
4248 sd->scan_timer = ecore_timer_add(0.0001, _e_fm2_cb_scan_timer, sd->obj);
4249 }
4250 else
4251 _e_fm2_scan_stop(data);
4252 return 0;
4253}
4254
4255static int
4256_e_fm2_cb_scan_timer(void *data) 4163_e_fm2_cb_scan_timer(void *data)
4257{ 4164{
4258 E_Fm2_Smart_Data *sd; 4165 E_Fm2_Smart_Data *sd;
@@ -4261,12 +4168,12 @@ _e_fm2_cb_scan_timer(void *data)
4261 if (!sd) return 0; 4168 if (!sd) return 0;
4262 _e_fm2_queue_process(data); 4169 _e_fm2_queue_process(data);
4263 sd->scan_timer = NULL; 4170 sd->scan_timer = NULL;
4264 if ((!sd->queue) && (!sd->scan_idler)) 4171 if (!sd->listing)
4265 { 4172 {
4266 _e_fm2_scan_stop(data); 4173 _e_fm2_client_monitor_list_end(data);
4267 return 0; 4174 return 0;
4268 } 4175 }
4269 if (sd->scan_idler) 4176 if (sd->busy_count > 0)
4270 sd->scan_timer = ecore_timer_add(0.2, _e_fm2_cb_scan_timer, sd->obj); 4177 sd->scan_timer = ecore_timer_add(0.2, _e_fm2_cb_scan_timer, sd->obj);
4271 else 4178 else
4272 { 4179 {
@@ -4284,10 +4191,10 @@ _e_fm2_cb_sort_idler(void *data)
4284 sd = evas_object_smart_data_get(data); 4191 sd = evas_object_smart_data_get(data);
4285 if (!sd) return 0; 4192 if (!sd) return 0;
4286 _e_fm2_queue_process(data); 4193 _e_fm2_queue_process(data);
4287 if (!sd->queue) 4194 if (!sd->listing)
4288 { 4195 {
4289 sd->sort_idler = NULL; 4196 sd->sort_idler = NULL;
4290 _e_fm2_scan_stop(data); 4197 _e_fm2_client_monitor_list_end(data);
4291 return 0; 4198 return 0;
4292 } 4199 }
4293 return 1; 4200 return 1;
@@ -4335,6 +4242,9 @@ _e_fm2_smart_add(Evas_Object *obj)
4335 4242
4336 sd = E_NEW(E_Fm2_Smart_Data, 1); 4243 sd = E_NEW(E_Fm2_Smart_Data, 1);
4337 if (!sd) return; 4244 if (!sd) return;
4245
4246 _e_fm2_id++;
4247 sd->id = _e_fm2_id;
4338 sd->obj = obj; 4248 sd->obj = obj;
4339 sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj)); 4249 sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
4340 evas_object_smart_member_add(sd->clip, obj); 4250 evas_object_smart_member_add(sd->clip, obj);
@@ -4386,15 +4296,8 @@ _e_fm2_smart_del(Evas_Object *obj)
4386 sd = evas_object_smart_data_get(obj); 4296 sd = evas_object_smart_data_get(obj);
4387 if (!sd) return; 4297 if (!sd) return;
4388 4298
4389 _e_fm2_fop_detach(sd); 4299 if (sd->realpath) _e_fm2_client_monitor_del(sd->id, sd->realpath);
4390
4391 if (sd->monitor.monitor)
4392 {
4393 ecore_file_monitor_del(sd->monitor.monitor);
4394 sd->monitor.monitor = NULL;
4395 }
4396 _e_fm2_live_process_end(obj); 4300 _e_fm2_live_process_end(obj);
4397 _e_fm2_scan_stop(obj);
4398 _e_fm2_queue_free(obj); 4301 _e_fm2_queue_free(obj);
4399 _e_fm2_regions_free(obj); 4302 _e_fm2_regions_free(obj);
4400 _e_fm2_icons_free(obj); 4303 _e_fm2_icons_free(obj);
@@ -4545,7 +4448,7 @@ _e_fm2_order_file_rewrite(Evas_Object *obj)
4545 E_Fm2_Icon *ic; 4448 E_Fm2_Icon *ic;
4546 FILE *f; 4449 FILE *f;
4547 char buf[4096]; 4450 char buf[4096];
4548 4451
4549 sd = evas_object_smart_data_get(obj); 4452 sd = evas_object_smart_data_get(obj);
4550 if (!sd) return; 4453 if (!sd) return;
4551 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath); 4454 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
@@ -4644,6 +4547,7 @@ _e_fm2_menu(Evas_Object *obj, unsigned int timestamp)
4644 4547
4645 if (!(sd->icon_menu.flags & E_FM2_MENU_NO_NEW_DIRECTORY)) 4548 if (!(sd->icon_menu.flags & E_FM2_MENU_NO_NEW_DIRECTORY))
4646 { 4549 {
4550 /* FIXME: stat the dir itself - move to e_fm_main */
4647 if (ecore_file_can_write(sd->realpath)) 4551 if (ecore_file_can_write(sd->realpath))
4648 { 4552 {
4649 mi = e_menu_item_new(mn); 4553 mi = e_menu_item_new(mn);
@@ -4785,6 +4689,7 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
4785 4689
4786 if (!(sd->icon_menu.flags & E_FM2_MENU_NO_NEW_DIRECTORY)) 4690 if (!(sd->icon_menu.flags & E_FM2_MENU_NO_NEW_DIRECTORY))
4787 { 4691 {
4692 /* FIXME: stat the dir itself - move to e_fm_main */
4788 if (ecore_file_can_write(sd->realpath)) 4693 if (ecore_file_can_write(sd->realpath))
4789 { 4694 {
4790 mi = e_menu_item_new(mn); 4695 mi = e_menu_item_new(mn);
@@ -4805,13 +4710,11 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
4805 if (ic->sd->order_file) 4710 if (ic->sd->order_file)
4806 { 4711 {
4807 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath); 4712 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
4713 /* FIXME: stat the .order itself - move to e_fm_main */
4808 can_w2 = ecore_file_can_write(buf); 4714 can_w2 = ecore_file_can_write(buf);
4809 } 4715 }
4810 if (ic->info.pseudo_link) 4716 snprintf(buf, sizeof(buf), "%s/%s", sd->realpath, ic->info.file);
4811 snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); 4717 if (ic->info.link)
4812 else
4813 snprintf(buf, sizeof(buf), "%s/%s", sd->realpath, ic->info.file);
4814 if ((ic->info.link) && (!ic->info.pseudo_link))
4815 { 4718 {
4816 struct stat st; 4719 struct stat st;
4817 4720
@@ -4831,12 +4734,6 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
4831 } 4734 }
4832 } 4735 }
4833 } 4736 }
4834 else
4835 {
4836 if (ic->info.pseudo_link)
4837 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
4838 if (ecore_file_can_write(buf)) can_w = 1;
4839 }
4840 4737
4841 sel = e_fm2_selected_list_get(ic->sd->obj); 4738 sel = e_fm2_selected_list_get(ic->sd->obj);
4842 if ((!sel) || evas_list_count(sel) == 1) 4739 if ((!sel) || evas_list_count(sel) == 1)
@@ -4960,6 +4857,7 @@ _e_fm2_toggle_ordering(void *data, E_Menu *m, E_Menu_Item *mi)
4960 if (sd->order_file) 4857 if (sd->order_file)
4961 { 4858 {
4962 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath); 4859 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
4860 /* FIXME: move to e_fm_main */
4963 ecore_file_unlink(buf); 4861 ecore_file_unlink(buf);
4964 } 4862 }
4965 else 4863 else
@@ -5028,6 +4926,7 @@ _e_fm2_new_directory_yes_cb(char *text, void *data)
5028 { 4926 {
5029 snprintf(buf, sizeof(buf), "%s/%s", sd->realpath, text); 4927 snprintf(buf, sizeof(buf), "%s/%s", sd->realpath, text);
5030 4928
4929 /* FIXME: move to e_fm_main */
5031 if (!ecore_file_mkdir(buf)) 4930 if (!ecore_file_mkdir(buf))
5032 { 4931 {
5033 man = e_manager_current_get(); 4932 man = e_manager_current_get();
@@ -5048,24 +4947,7 @@ _e_fm2_new_directory_yes_cb(char *text, void *data)
5048 e_dialog_show(dialog); 4947 e_dialog_show(dialog);
5049 return; 4948 return;
5050 } 4949 }
5051/* 4950 _e_fm2_live_file_add(sd->obj, text, NULL, 0, NULL);
5052 if (sd->order_file)
5053 {
5054 FILE *f;
5055
5056 snprintf(buf, sizeof(buf), "%s/.order", sd->realpath);
5057 f = fopen(buf, "a");
5058 if (f)
5059 {
5060 fprintf(f, "%s\n", text);
5061 fclose(f);
5062 }
5063 }
5064 */
5065 _e_fm2_live_file_add(sd->obj, text, NULL, 0);
5066 /* FIXME: disable refresh - modify icons in-place */
5067// if (sd->refresh_job) ecore_job_del(sd->refresh_job);
5068// sd->refresh_job = ecore_job_add(_e_fm2_refresh_job_cb, sd->obj);
5069 } 4951 }
5070} 4952}
5071 4953
@@ -5129,18 +5011,11 @@ _e_fm2_file_rename_yes_cb(char *text, void *data)
5129 ic->entry_dialog = NULL; 5011 ic->entry_dialog = NULL;
5130 if ((text) && (strcmp(text, ic->info.file))) 5012 if ((text) && (strcmp(text, ic->info.file)))
5131 { 5013 {
5132 if (ic->info.pseudo_link) 5014 snprintf(oldpath, sizeof(oldpath), "%s/%s", ic->sd->realpath, ic->info.file);
5133 { 5015 snprintf(newpath, sizeof(newpath), "%s/%s", ic->sd->realpath, text);
5134 snprintf(oldpath, sizeof(oldpath), "%s/%s", ic->info.pseudo_dir, ic->info.file);
5135 snprintf(newpath, sizeof(newpath), "%s/%s", ic->info.pseudo_dir, text);
5136 }
5137 else
5138 {
5139 snprintf(oldpath, sizeof(oldpath), "%s/%s", ic->sd->realpath, ic->info.file);
5140 snprintf(newpath, sizeof(newpath), "%s/%s", ic->sd->realpath, text);
5141 }
5142 if (e_filereg_file_protected(oldpath)) return; 5016 if (e_filereg_file_protected(oldpath)) return;
5143 5017
5018 /* FIXME: move to e_fm_main */
5144 if (!ecore_file_mv(oldpath, newpath)) 5019 if (!ecore_file_mv(oldpath, newpath))
5145 { 5020 {
5146 man = e_manager_current_get(); 5021 man = e_manager_current_get();
@@ -5162,13 +5037,7 @@ _e_fm2_file_rename_yes_cb(char *text, void *data)
5162 } 5037 }
5163 e_fm2_custom_file_rename(oldpath, newpath); 5038 e_fm2_custom_file_rename(oldpath, newpath);
5164 _e_fm2_live_file_del(ic->sd->obj, ic->info.file); 5039 _e_fm2_live_file_del(ic->sd->obj, ic->info.file);
5165 _e_fm2_live_file_add(ic->sd->obj, text, NULL, 0); 5040 _e_fm2_live_file_add(ic->sd->obj, text, NULL, 0, NULL);
5166// evas_stringshare_del(ic->info.file);
5167// ic->info.file = evas_stringshare_add(text);
5168// if (ic->sd->order_file) _e_fm2_order_file_rewrite(ic->sd->obj);
5169 /* FIXME: disable refresh - modify icons in-place */
5170// if (ic->sd->refresh_job) ecore_job_del(ic->sd->refresh_job);
5171// ic->sd->refresh_job = ecore_job_add(_e_fm2_refresh_job_cb, ic->sd->obj);
5172 } 5041 }
5173} 5042}
5174 5043
@@ -5262,7 +5131,6 @@ _e_fm2_file_delete_yes_cb(void *data, E_Dialog *dialog)
5262 char buf[4096]; 5131 char buf[4096];
5263 Evas_List *sel, *l; 5132 Evas_List *sel, *l;
5264 E_Fm2_Icon_Info *ici; 5133 E_Fm2_Icon_Info *ici;
5265 int ok;
5266 5134
5267 ic = data; 5135 ic = data;
5268 ic->dialog = NULL; 5136 ic->dialog = NULL;
@@ -5273,97 +5141,21 @@ _e_fm2_file_delete_yes_cb(void *data, E_Dialog *dialog)
5273 { 5141 {
5274 for (l = sel; l; l = l->next) 5142 for (l = sel; l; l = l->next)
5275 { 5143 {
5276 ok = 1;
5277 ici = l->data; 5144 ici = l->data;
5278 if (!ici->pseudo_link) 5145 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ici->file);
5279 { 5146 if (e_filereg_file_protected(buf)) continue;
5280 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ici->file); 5147
5281 if (e_filereg_file_protected(buf)) continue; 5148 printf("rm -rf %s\n", buf);
5282
5283 /* FIXME: recursive rm might block - need to get smart */
5284 e_fm2_fop_delete_add(ic->sd->obj, ici);
5285/*
5286 if (!(ecore_file_recursive_rm(buf)))
5287 {
5288 char text[4096 + 256];
5289
5290 ok = 0;
5291 man = e_manager_current_get();
5292 if (man)
5293 {
5294 con = e_container_current_get(man);
5295 if (con)
5296 {
5297 dialog = e_dialog_new(con, "E", "_fm_file_delete_error_dialog");
5298 e_dialog_button_add(dialog, _("OK"), NULL, NULL, NULL);
5299 e_dialog_button_focus_num(dialog, 1);
5300 e_dialog_title_set(dialog, _("Error"));
5301 snprintf(text, sizeof(text),
5302 _("Could not delete <br>"
5303 "<hilight>%s</hilight>"), buf);
5304 e_dialog_text_set(dialog, text);
5305 e_win_centered_set(dialog->win, 1);
5306 e_dialog_show(dialog);
5307 // e_object_del(E_OBJECT(dialog));
5308 }
5309 }
5310 }
5311 else
5312 */
5313// ici->deleted = 1;
5314 ok = 0;
5315 }
5316 else ici->deleted = 1;
5317 if (ok) _e_fm2_live_file_del(ic->sd->obj, ici->file);
5318 } 5149 }
5319 evas_list_free(sel); 5150 evas_list_free(sel);
5320 } 5151 }
5321 else 5152 else
5322 { 5153 {
5323 if (!ic->info.pseudo_link) 5154 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file);
5324 { 5155 if (e_filereg_file_protected(buf)) return;
5325 snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); 5156 printf("rm -rf %s\n", buf);
5326 if (e_filereg_file_protected(buf)) return;
5327
5328 /* FIXME: recursive rm might block - need to get smart */
5329 e_fm2_fop_delete_add(ic->sd->obj, &(ic->info));
5330/*
5331 if (!(ecore_file_recursive_rm(buf)))
5332 {
5333 char text[4096 + 256];
5334
5335 man = e_manager_current_get();
5336 if (!man) return;
5337 con = e_container_current_get(man);
5338 if (!con) return;
5339
5340 dialog = e_dialog_new(con, "E", "_fm_file_delete_error_dialog");
5341 e_dialog_button_add(dialog, _("OK"), NULL, NULL, NULL);
5342 e_dialog_button_focus_num(dialog, 1);
5343 e_dialog_title_set(dialog, _("Error"));
5344 snprintf(text, sizeof(text),
5345 _("Could not delete <br>"
5346 "<hilight>%s</hilight>"), buf);
5347 e_dialog_text_set(dialog, text);
5348 e_win_centered_set(dialog->win, 1);
5349 e_dialog_show(dialog);
5350 // e_object_del(E_OBJECT(dialog));
5351 return;
5352 }
5353 */
5354 }
5355 else
5356 {
5357 ic->info.deleted = 1;
5358 _e_fm2_live_file_del(ic->sd->obj, ic->info.file);
5359 }
5360 } 5157 }
5361 5158
5362// if (ic->sd->order_file) _e_fm2_order_file_rewrite(ic->sd->obj);
5363 /* FIXME: disable refresh - modify icons in-place */
5364// if (ic->sd->refresh_job) ecore_job_del(ic->sd->refresh_job);
5365// ic->sd->refresh_job = ecore_job_add(_e_fm2_refresh_job_cb, ic->sd->obj);
5366
5367 evas_object_smart_callback_call(ic->sd->obj, "files_deleted", NULL); 5159 evas_object_smart_callback_call(ic->sd->obj, "files_deleted", NULL);
5368} 5160}
5369 5161
@@ -5392,7 +5184,7 @@ _e_fm2_refresh_job_cb(void *data)
5392 5184
5393 5185
5394static void 5186static void
5395_e_fm2_live_file_add(Evas_Object *obj, const char *file, const char *file_rel, int after) 5187_e_fm2_live_file_add(Evas_Object *obj, const char *file, const char *file_rel, int after, E_Fm2_Finfo *finf)
5396{ 5188{
5397 E_Fm2_Smart_Data *sd; 5189 E_Fm2_Smart_Data *sd;
5398 E_Fm2_Action *a; 5190 E_Fm2_Action *a;
@@ -5406,6 +5198,9 @@ _e_fm2_live_file_add(Evas_Object *obj, const char *file, const char *file_rel, i
5406 a->file = evas_stringshare_add(file); 5198 a->file = evas_stringshare_add(file);
5407 if (file_rel) a->file2 = evas_stringshare_add(file_rel); 5199 if (file_rel) a->file2 = evas_stringshare_add(file_rel);
5408 a->flags = after; 5200 a->flags = after;
5201 memcpy(&(a->finf), finf, sizeof(E_Fm2_Finfo));
5202 a->finf.lnk = evas_stringshare_add(a->finf.lnk);
5203 a->finf.rlnk = evas_stringshare_add(a->finf.rlnk);
5409 _e_fm2_live_process_begin(obj); 5204 _e_fm2_live_process_begin(obj);
5410} 5205}
5411 5206
@@ -5426,7 +5221,7 @@ _e_fm2_live_file_del(Evas_Object *obj, const char *file)
5426} 5221}
5427 5222
5428static void 5223static void
5429_e_fm2_live_file_changed(Evas_Object *obj, char *file) 5224_e_fm2_live_file_changed(Evas_Object *obj, const char *file, E_Fm2_Finfo *finf)
5430{ 5225{
5431 E_Fm2_Smart_Data *sd; 5226 E_Fm2_Smart_Data *sd;
5432 E_Fm2_Action *a; 5227 E_Fm2_Action *a;
@@ -5438,6 +5233,9 @@ _e_fm2_live_file_changed(Evas_Object *obj, char *file)
5438 sd->live.actions = evas_list_append(sd->live.actions, a); 5233 sd->live.actions = evas_list_append(sd->live.actions, a);
5439 a->type = FILE_CHANGE; 5234 a->type = FILE_CHANGE;
5440 a->file = evas_stringshare_add(file); 5235 a->file = evas_stringshare_add(file);
5236 memcpy(&(a->finf), finf, sizeof(E_Fm2_Finfo));
5237 a->finf.lnk = evas_stringshare_add(a->finf.lnk);
5238 a->finf.rlnk = evas_stringshare_add(a->finf.rlnk);
5441 _e_fm2_live_process_begin(obj); 5239 _e_fm2_live_process_begin(obj);
5442} 5240}
5443 5241
@@ -5447,10 +5245,9 @@ _e_fm2_live_process_begin(Evas_Object *obj)
5447 E_Fm2_Smart_Data *sd; 5245 E_Fm2_Smart_Data *sd;
5448 5246
5449 sd = evas_object_smart_data_get(obj); 5247 sd = evas_object_smart_data_get(obj);
5450 if ((sd->order) || (sd->dir)) return;
5451 if (!sd->live.actions) return; 5248 if (!sd->live.actions) return;
5452 if ((sd->live.idler) || (sd->live.timer) || 5249 if ((sd->live.idler) || (sd->live.timer) ||
5453 (sd->scan_idler) || (sd->scan_timer)) return; 5250 (sd->listing) || (sd->scan_timer)) return;
5454 sd->live.idler = ecore_idler_add(_e_fm2_cb_live_idler, obj); 5251 sd->live.idler = ecore_idler_add(_e_fm2_cb_live_idler, obj);
5455 sd->live.timer = ecore_timer_add(0.2, _e_fm2_cb_live_timer, obj); 5252 sd->live.timer = ecore_timer_add(0.2, _e_fm2_cb_live_timer, obj);
5456} 5253}
@@ -5468,6 +5265,8 @@ _e_fm2_live_process_end(Evas_Object *obj)
5468 sd->live.actions = evas_list_remove_list(sd->live.actions, sd->live.actions); 5265 sd->live.actions = evas_list_remove_list(sd->live.actions, sd->live.actions);
5469 if (a->file) evas_stringshare_del(a->file); 5266 if (a->file) evas_stringshare_del(a->file);
5470 if (a->file2) evas_stringshare_del(a->file2); 5267 if (a->file2) evas_stringshare_del(a->file2);
5268 if (a->finf.lnk) evas_stringshare_del(a->finf.lnk);
5269 if (a->finf.rlnk) evas_stringshare_del(a->finf.rlnk);
5471 free(a); 5270 free(a);
5472 } 5271 }
5473 if (sd->live.idler) 5272 if (sd->live.idler)
@@ -5499,9 +5298,11 @@ _e_fm2_live_process(Evas_Object *obj)
5499 case FILE_ADD: 5298 case FILE_ADD:
5500 /* new file to sort in place */ 5299 /* new file to sort in place */
5501 if (!((a->file[0] == '.') && (!sd->show_hidden_files))) 5300 if (!((a->file[0] == '.') && (!sd->show_hidden_files)))
5502 _e_fm2_file_add(obj, a->file, 1, a->file2, a->flags); 5301 _e_fm2_file_add(obj, a->file, 1, a->file2, a->flags, &(a->finf));
5503 break; 5302 break;
5504 case FILE_DEL: 5303 case FILE_DEL:
5304 if (!strcmp(a->file, ".order"))
5305 sd->order_file = 0;
5505 if (!((a->file[0] == '.') && (!sd->show_hidden_files))) 5306 if (!((a->file[0] == '.') && (!sd->show_hidden_files)))
5506 _e_fm2_file_del(obj, a->file); 5307 _e_fm2_file_del(obj, a->file);
5507 sd->live.deletions = 1; 5308 sd->live.deletions = 1;
@@ -5519,7 +5320,7 @@ _e_fm2_live_process(Evas_Object *obj)
5519 realized = ic->realized; 5320 realized = ic->realized;
5520 if (realized) _e_fm2_icon_unrealize(ic); 5321 if (realized) _e_fm2_icon_unrealize(ic);
5521 _e_fm2_icon_unfill(ic); 5322 _e_fm2_icon_unfill(ic);
5522 _e_fm2_icon_fill(ic); 5323 _e_fm2_icon_fill(ic, &(a->finf));
5523 if (realized) _e_fm2_icon_realize(ic); 5324 if (realized) _e_fm2_icon_realize(ic);
5524 break; 5325 break;
5525 } 5326 }
@@ -5531,6 +5332,8 @@ _e_fm2_live_process(Evas_Object *obj)
5531 } 5332 }
5532 if (a->file) evas_stringshare_del(a->file); 5333 if (a->file) evas_stringshare_del(a->file);
5533 if (a->file2) evas_stringshare_del(a->file2); 5334 if (a->file2) evas_stringshare_del(a->file2);
5335 if (a->finf.lnk) evas_stringshare_del(a->finf.lnk);
5336 if (a->finf.rlnk) evas_stringshare_del(a->finf.rlnk);
5534 free(a); 5337 free(a);
5535} 5338}
5536 5339
@@ -5553,7 +5356,10 @@ _e_fm2_cb_live_idler(void *data)
5553 _e_fm2_live_process_end(data); 5356 _e_fm2_live_process_end(data);
5554 _e_fm2_cb_live_timer(data); 5357 _e_fm2_cb_live_timer(data);
5555 if ((sd->order_file) || (sd->config->view.always_order)) 5358 if ((sd->order_file) || (sd->config->view.always_order))
5556 _e_fm2_order_file_rewrite(data); 5359 {
5360 printf("attempt rewrite of order 3\n");
5361 _e_fm2_order_file_rewrite(data);
5362 }
5557 sd->live.idler = NULL; 5363 sd->live.idler = NULL;
5558 return 0; 5364 return 0;
5559} 5365}
@@ -5587,368 +5393,6 @@ _e_fm2_cb_live_timer(void *data)
5587 return 0; 5393 return 0;
5588} 5394}
5589 5395
5590static void
5591_e_fm2_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
5592{
5593 E_Fm2_Smart_Data *sd;
5594 char *file;
5595
5596 sd = evas_object_smart_data_get(data);
5597 if (!sd) return;
5598 file = (char *)ecore_file_get_file(path);
5599 if (!strcmp(file, ".order"))
5600 {
5601 /* FIXME: for now, ignore, BUT later load up .order - compare with icon
5602 * order in list and fi they differ - use new .order */
5603 }
5604 else
5605 {
5606 if ((event == ECORE_FILE_EVENT_CREATED_FILE) ||
5607 (event == ECORE_FILE_EVENT_CREATED_DIRECTORY))
5608 {
5609 _e_fm2_live_file_add(sd->obj, file, NULL, 0);
5610// printf("FADD %s\n", file);
5611 }
5612 else if ((event == ECORE_FILE_EVENT_DELETED_FILE) ||
5613 (event == ECORE_FILE_EVENT_DELETED_DIRECTORY))
5614 {
5615 _e_fm2_live_file_del(sd->obj, file);
5616// printf("FDEL %s\n", file);
5617 }
5618 else if (event == ECORE_FILE_EVENT_MODIFIED)
5619 {
5620 _e_fm2_live_file_changed(sd->obj, file);
5621// printf("FMOD %s\n", file);
5622 }
5623 else if (event == ECORE_FILE_EVENT_DELETED_SELF)
5624 {
5625 evas_object_smart_callback_call(sd->obj, "dir_deleted", NULL);
5626 }
5627 }
5628}
5629
5630static E_Fm2_Fop *
5631_e_fm2_fop_add(E_Fm2_Smart_Data *sd)
5632{
5633 if (!sd->fop)
5634 {
5635 sd->fop = E_NEW(E_Fm2_Fop, 1);
5636 if (!sd->fop) return NULL;
5637 sd->fop->obj = sd->obj;
5638 sd->fop->dir = evas_stringshare_add(e_fm2_real_path_get(sd->obj));
5639 if (!sd->fop->dir)
5640 {
5641 free(sd->fop);
5642 sd->fop = NULL;
5643 return NULL;
5644 }
5645 sd->fop->idler = ecore_idler_add(_e_fm2_cb_fop_idler, sd->fop);
5646 if (!sd->fop->idler)
5647 {
5648 evas_stringshare_del(sd->fop->dir);
5649 free(sd->fop);
5650 sd->fop = NULL;
5651 return NULL;
5652 }
5653 sd->fop->timer = ecore_timer_add(0.2, _e_fm2_cb_fop_timer, sd->fop);
5654 sd->busy_count++;
5655 if (sd->busy_count == 1)
5656 edje_object_signal_emit(sd->overlay, "e,state,busy,start", "e");
5657 }
5658 _e_fm2_fop_list = evas_list_append(_e_fm2_fop_list, sd->fop);
5659 return sd->fop;
5660}
5661
5662static void
5663_e_fm2_fop_del(E_Fm2_Fop *fop)
5664{
5665 if (fop->idler)
5666 {
5667 ecore_idler_del(fop->idler);
5668 fop->idler = NULL;
5669 }
5670 if (fop->timer)
5671 {
5672 _e_fm2_cb_fop_timer(fop);
5673 ecore_timer_del(fop->timer);
5674 fop->timer = NULL;
5675 }
5676 if (fop->dir)
5677 {
5678 evas_stringshare_del(fop->dir);
5679 fop->dir = NULL;
5680 }
5681 if (fop->obj)
5682 {
5683 E_Fm2_Smart_Data *sd;
5684
5685 sd = evas_object_smart_data_get(fop->obj);
5686 if (sd) sd->fop = NULL;
5687 fop->obj = NULL;
5688 sd->busy_count--;
5689 if (sd->busy_count == 0)
5690 edje_object_signal_emit(sd->overlay, "e,state,busy,stop", "e");
5691 }
5692 _e_fm2_fop_list = evas_list_remove(_e_fm2_fop_list, fop);
5693 free(fop);
5694}
5695
5696static void
5697_e_fm2_fop_detach(E_Fm2_Smart_Data *sd)
5698{
5699 if (!sd->fop) return;
5700 sd->fop->obj = NULL;
5701 sd->fop = NULL;
5702 sd->busy_count--;
5703 if (sd->busy_count == 0)
5704 edje_object_signal_emit(sd->overlay, "e,state,busy,stop", "e");
5705}
5706
5707static int
5708_e_fm2_fop_process(E_Fm2_Fop *fop)
5709{
5710 E_Fm2_Fop_Item *fi, *fi2;
5711 char buf[4096];
5712 struct dirent *dp;
5713 E_Manager *man;
5714 E_Container *con;
5715 E_Dialog *dialog;
5716
5717 if (!fop->items) return 0;
5718 fi = fop->items->data;
5719 switch (fi->type)
5720 {
5721 case FOP_DELETE:
5722 if (fi->dir)
5723 {
5724 dp = readdir(fi->dir);
5725 if (!dp)
5726 {
5727 snprintf(buf, sizeof(buf), "%s/%s", fi->fop->dir, fi->file);
5728 if (ecore_file_rmdir(buf))
5729 {
5730 if ((fi->fop->obj) && (!strchr(fi->file, '/')))
5731 _e_fm2_live_file_del(fi->fop->obj, fi->file);
5732 }
5733 /* FIXME: if deletign vast dirs and lots of errors happen
5734 * we need a central dialog that just collects all of them
5735 * and not have dozens or 100's of dialogs */
5736 else
5737 {
5738 char text[4096 + 256];
5739
5740 man = e_manager_current_get();
5741 if (man)
5742 {
5743 con = e_container_current_get(man);
5744 if (con)
5745 {
5746 dialog = e_dialog_new(con, "E", "_fm_file_delete_error_dialog");
5747 e_dialog_button_add(dialog, _("OK"), NULL, NULL, NULL);
5748 e_dialog_button_focus_num(dialog, 1);
5749 e_dialog_title_set(dialog, _("Error"));
5750 snprintf(text, sizeof(text),
5751 _("Could not delete <br>"
5752 "<hilight>%s</hilight>"), buf);
5753 e_dialog_text_set(dialog, text);
5754 e_win_centered_set(dialog->win, 1);
5755 e_dialog_show(dialog);
5756 }
5757 }
5758 }
5759 }
5760 else
5761 {
5762 if ((!strcmp(dp->d_name, ".")) || (!strcmp(dp->d_name, ".."))) return 1;
5763 fi2 = E_NEW(E_Fm2_Fop_Item, 1);
5764 fi2->fop = fop;
5765 fi2->type = FOP_DELETE;
5766 snprintf(buf, sizeof(buf), "%s/%s/%s", fi->fop->dir, fi->file, dp->d_name);
5767 if (ecore_file_is_dir(buf))
5768 {
5769 char *lnk;
5770
5771 lnk = ecore_file_readlink(buf);
5772 if (lnk) free(lnk);
5773 else fi2->is_dir = 1;
5774 }
5775 snprintf(buf, sizeof(buf), "%s/%s", fi->file, dp->d_name);
5776 fi2->file = evas_stringshare_add(buf);
5777 fi->fop->items = evas_list_prepend(fi->fop->items, fi2);
5778// printf("ADD: %s\n", fi2->file);
5779 return 1;
5780 }
5781 }
5782 else if (fi->is_dir)
5783 {
5784 snprintf(buf, sizeof(buf), "%s/%s", fi->fop->dir, fi->file);
5785 fi->dir = opendir(buf);
5786 if (!fi->dir)
5787 {
5788 if (ecore_file_rmdir(buf))
5789 {
5790 if ((fi->fop->obj) && (!strchr(fi->file, '/')))
5791 _e_fm2_live_file_del(fi->fop->obj, fi->file);
5792 }
5793 /* FIXME: if deletign vast dirs and lots of errors happen
5794 * we need a central dialog that just collects all of them
5795 * and not have dozens or 100's of dialogs */
5796 else
5797 {
5798 char text[4096 + 256];
5799
5800 man = e_manager_current_get();
5801 if (man)
5802 {
5803 con = e_container_current_get(man);
5804 if (con)
5805 {
5806 dialog = e_dialog_new(con, "E", "_fm_file_delete_error_dialog");
5807 e_dialog_button_add(dialog, _("OK"), NULL, NULL, NULL);
5808 e_dialog_button_focus_num(dialog, 1);
5809 e_dialog_title_set(dialog, _("Error"));
5810 snprintf(text, sizeof(text),
5811 _("Could not delete <br>"
5812 "<hilight>%s</hilight>"), buf);
5813 e_dialog_text_set(dialog, text);
5814 e_win_centered_set(dialog->win, 1);
5815 e_dialog_show(dialog);
5816 }
5817 }
5818 }
5819 }
5820 else
5821 return 1;
5822 }
5823 else
5824 {
5825 snprintf(buf, sizeof(buf), "%s/%s", fi->fop->dir, fi->file);
5826 if (ecore_file_unlink(buf))
5827 {
5828 e_fm2_custom_file_del(buf);
5829 if ((fi->fop->obj) && (!strchr(fi->file, '/')))
5830 _e_fm2_live_file_del(fi->fop->obj, fi->file);
5831 }
5832 /* FIXME: if deletign vast dirs and lots of errors happen
5833 * we need a central dialog that just collects all of them
5834 * and not have dozens or 100's of dialogs */
5835 else
5836 {
5837 char text[4096 + 256];
5838
5839 man = e_manager_current_get();
5840 if (man)
5841 {
5842 con = e_container_current_get(man);
5843 if (con)
5844 {
5845 dialog = e_dialog_new(con, "E", "_fm_file_delete_error_dialog");
5846 e_dialog_button_add(dialog, _("OK"), NULL, NULL, NULL);
5847 e_dialog_button_focus_num(dialog, 1);
5848 e_dialog_title_set(dialog, _("Error"));
5849 snprintf(text, sizeof(text),
5850 _("Could not delete <br>"
5851 "<hilight>%s</hilight>"), buf);
5852 e_dialog_text_set(dialog, text);
5853 e_win_centered_set(dialog->win, 1);
5854 e_dialog_show(dialog);
5855 }
5856 }
5857 }
5858 }
5859 break;
5860 case FOP_MOVE:
5861 /* FIXME: handle moves */
5862 if (ecore_file_exists(fi->file2))
5863 {
5864 /* FIXME: error - file exists */
5865 }
5866 else
5867 {
5868 if (ecore_file_mv(fi->file, fi->file2))
5869 {
5870 e_fm2_custom_file_rename(fi->file, fi->file2);
5871 if ((fi->fop->obj) && (fi->file_add))
5872 _e_fm2_live_file_add(fi->fop->obj,
5873 fi->file, fi->file3, fi->