summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am1
-rw-r--r--src/config.c11
-rw-r--r--src/e_view_model.c8
-rw-r--r--src/iconbar.c62
-rw-r--r--src/scrollbar.c59
-rw-r--r--src/scrollbar.h18
-rw-r--r--src/view.c461
-rw-r--r--src/view.h21
8 files changed, 489 insertions, 152 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 988e2817f..8883c071c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -80,6 +80,7 @@ enlightenment_SOURCES = \
80 e_file.h e_file.c \ 80 e_file.h e_file.c \
81 e_view_model.h e_view_model.c \ 81 e_view_model.h e_view_model.c \
82 e_view_machine.h e_view_machine.c \ 82 e_view_machine.h e_view_machine.c \
83 view_layout.h view_layout.c \
83 e.h 84 e.h
84 85
85enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ebg_libs@ @ferite_libs@ -lm -lc $(INTLLIBS) 86enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ebg_libs@ @ferite_libs@ -lm -lc $(INTLLIBS)
diff --git a/src/config.c b/src/config.c
index d8fa313a1..4b48d81e1 100644
--- a/src/config.c
+++ b/src/config.c
@@ -22,6 +22,7 @@ static char cfg_cursors_dir[PATH_MAX] = "";
22static char cfg_backgrounds_dir[PATH_MAX] = ""; 22static char cfg_backgrounds_dir[PATH_MAX] = "";
23static char cfg_fonts_dir[PATH_MAX] = ""; 23static char cfg_fonts_dir[PATH_MAX] = "";
24static char cfg_epplets_dir[PATH_MAX] = ""; 24static char cfg_epplets_dir[PATH_MAX] = "";
25static char cfg_layout_dir[PATH_MAX] = "";
25 26
26char * 27char *
27e_config_get(char *type) 28e_config_get(char *type)
@@ -73,9 +74,13 @@ e_config_get(char *type)
73 E_CONF("images", cfg_images_dir, PACKAGE_DATA_DIR "/data/images/"); 74 E_CONF("images", cfg_images_dir, PACKAGE_DATA_DIR "/data/images/");
74 E_CONF("cursors", cfg_cursors_dir, PACKAGE_DATA_DIR "/data/cursors/"); 75 E_CONF("cursors", cfg_cursors_dir, PACKAGE_DATA_DIR "/data/cursors/");
75 E_CONF("backgrounds", cfg_backgrounds_dir, 76 E_CONF("backgrounds", cfg_backgrounds_dir,
76 PACKAGE_DATA_DIR "/data/backgrounds/"); 77 PACKAGE_DATA_DIR"/data/backgrounds/");
77 E_CONF("fonts", cfg_fonts_dir, PACKAGE_DATA_DIR "/data/fonts/"); 78 E_CONF("fonts", cfg_fonts_dir,
78 E_CONF("epplets", cfg_epplets_dir, PACKAGE_DATA_DIR "/data/epplets/"); 79 PACKAGE_DATA_DIR"/data/fonts/");
80 E_CONF("epplets", cfg_epplets_dir,
81 PACKAGE_DATA_DIR"/data/epplets/");
82 E_CONF("layout", cfg_layout_dir,
83 PACKAGE_DATA_DIR"/data/layout/");
79 84
80 D_RETURN_(""); 85 D_RETURN_("");
81} 86}
diff --git a/src/e_view_model.c b/src/e_view_model.c
index 9dfd6ac95..eebe366ab 100644
--- a/src/e_view_model.c
+++ b/src/e_view_model.c
@@ -580,12 +580,12 @@ e_view_model_file_added(int id, char *file)
580 snprintf(buf, PATH_MAX, "background_reload:%s", m->dir); 580 snprintf(buf, PATH_MAX, "background_reload:%s", m->dir);
581 ecore_add_event_timer(buf, 0.5, e_view_model_bg_reload_timeout, 0, m); 581 ecore_add_event_timer(buf, 0.5, e_view_model_bg_reload_timeout, 0, m);
582 } 582 }
583 else if ((!strcmp(".e_iconbar.db", file)) || 583 /*else if ((!strcmp(".e_iconbar.db", file)) ||
584 (!strcmp(".e_iconbar.bits.db", file))) 584 (!strcmp(".e_iconbar.bits.db", file)))
585 { 585 {
586 snprintf(buf, PATH_MAX, "iconbar_reload:%s", m->dir); 586 snprintf(buf, PATH_MAX, "iconbar_reload:%s", m->dir);
587 ecore_add_event_timer(buf, 0.5, e_view_model_ib_reload_timeout, 0, m); 587 ecore_add_event_timer(buf, 0.5, e_view_model_ib_reload_timeout, 0, m);
588 } 588 }*/
589 else if (file[0] != '.') 589 else if (file[0] != '.')
590 { 590 {
591 f = e_file_new(file); 591 f = e_file_new(file);
@@ -620,7 +620,7 @@ e_view_model_file_deleted(int id, char *file)
620 { 620 {
621 e_view_model_set_default_background(m); 621 e_view_model_set_default_background(m);
622 } 622 }
623 else if ((!strcmp(".e_iconbar.db", file)) || 623 /*else if ((!strcmp(".e_iconbar.db", file)) ||
624 (!strcmp(".e_iconbar.bits.db", file))) 624 (!strcmp(".e_iconbar.bits.db", file)))
625 { 625 {
626 for (l = m->views; l; l = l->next) 626 for (l = m->views; l; l = l->next)
@@ -630,7 +630,7 @@ e_view_model_file_deleted(int id, char *file)
630 e_object_unref(E_OBJECT(v->iconbar)); 630 e_object_unref(E_OBJECT(v->iconbar));
631 v->iconbar = NULL; 631 v->iconbar = NULL;
632 } 632 }
633 } 633 }*/
634 else if (file[0] != '.') 634 else if (file[0] != '.')
635 { 635 {
636 for (l = m->views; l; l = l->next) 636 for (l = m->views; l; l = l->next)
diff --git a/src/iconbar.c b/src/iconbar.c
index 70f468ab6..4f4abdce2 100644
--- a/src/iconbar.c
+++ b/src/iconbar.c
@@ -5,6 +5,7 @@
5#include "border.h" 5#include "border.h"
6#include "file.h" 6#include "file.h"
7#include "icons.h" 7#include "icons.h"
8#include "view_layout.h"
8 9
9static E_Config_Base_Type *cf_iconbar = NULL; 10static E_Config_Base_Type *cf_iconbar = NULL;
10static E_Config_Base_Type *cf_iconbar_icon = NULL; 11static E_Config_Base_Type *cf_iconbar_icon = NULL;
@@ -146,6 +147,7 @@ e_iconbar_cleanup(E_Iconbar * ib)
146 /* free up our ebits */ 147 /* free up our ebits */
147 if (ib->bit) 148 if (ib->bit)
148 ebits_free(ib->bit); 149 ebits_free(ib->bit);
150
149 /* if we have any icons... */ 151 /* if we have any icons... */
150 if (ib->icons) 152 if (ib->icons)
151 { 153 {
@@ -234,9 +236,10 @@ e_iconbar_new(E_View * v)
234 236
235 D_ENTER; 237 D_ENTER;
236 238
239 D("new iconbar\n");
237 /* first we want to load the iconbar data itself - ie the config info */ 240 /* first we want to load the iconbar data itself - ie the config info */
238 /* for what icons we have and what they execute */ 241 /* for what icons we have and what they execute */
239 snprintf(buf, PATH_MAX, "%s/.e_iconbar.db", v->model->dir); 242 snprintf(buf, PATH_MAX, "%s/.e_layout/iconbar.db", v->model->dir);
240 /* use the config system to simply load up the db and start making */ 243 /* use the config system to simply load up the db and start making */
241 /* structs and lists and stuff for us... we told it how to in init */ 244 /* structs and lists and stuff for us... we told it how to in init */
242 ib = e_config_load(buf, "", cf_iconbar); 245 ib = e_config_load(buf, "", cf_iconbar);
@@ -255,7 +258,10 @@ e_iconbar_new(E_View * v)
255 e_db_flush(); 258 e_db_flush();
256 /* no iconbar config loaded ? return NULL */ 259 /* no iconbar config loaded ? return NULL */
257 if (!ib) 260 if (!ib)
258 D_RETURN_(NULL); 261 {
262 D("no config loaded, return null\n");
263 D_RETURN_(NULL);
264 }
259 265
260 /* now that the config system has doe the loading. we need to init the */ 266 /* now that the config system has doe the loading. we need to init the */
261 /* object and set up ref counts and free method */ 267 /* object and set up ref counts and free method */
@@ -283,11 +289,13 @@ e_iconbar_new(E_View * v)
283 289
284 /* now we need to load up a bits file that tells us where in the view the */ 290 /* now we need to load up a bits file that tells us where in the view the */
285 /* iconbar is meant to go. same place. just a slightly different name */ 291 /* iconbar is meant to go. same place. just a slightly different name */
286 snprintf(buf, PATH_MAX, "%s/.e_iconbar.bits.db", v->model->dir); 292 snprintf(buf, PATH_MAX, "%s/.e_layout/iconbar.bits.db", v->model->dir);
287 ib->bit = ebits_load(buf); 293 ib->bit = ebits_load(buf);
294
288 /* we didn't find one? */ 295 /* we didn't find one? */
289 if (!ib->bit) 296 if (!ib->bit)
290 { 297 {
298 D("bits not loaded, cleanup and return null\n");
291 /* unref the iconbar (and thus it will get freed and all icons in it */ 299 /* unref the iconbar (and thus it will get freed and all icons in it */
292 e_object_unref(E_OBJECT(ib)); 300 e_object_unref(E_OBJECT(ib));
293 /* return NULL - no iconbar worth doing here if we don't know where */ 301 /* return NULL - no iconbar worth doing here if we don't know where */
@@ -308,6 +316,7 @@ e_iconbar_new(E_View * v)
308 316
309 /* aaah. our nicely constructed iconbar data struct with all the goodies */ 317 /* aaah. our nicely constructed iconbar data struct with all the goodies */
310 /* we need. return it. she's ready for use. */ 318 /* we need. return it. she's ready for use. */
319 D("iconbar created!\n");
311 D_RETURN_(ib); 320 D_RETURN_(ib);
312} 321}
313 322
@@ -373,9 +382,10 @@ void
373e_iconbar_realize(E_Iconbar * ib) 382e_iconbar_realize(E_Iconbar * ib)
374{ 383{
375 Evas_List l; 384 Evas_List l;
385 double x, y, w, h;
376 386
377 D_ENTER; 387 D_ENTER;
378 388 D("realize iconbar\n");
379 /* create clip object */ 389 /* create clip object */
380 ib->clip = evas_add_rectangle(ib->view->evas); 390 ib->clip = evas_add_rectangle(ib->view->evas);
381 evas_set_color(ib->view->evas, ib->clip, 255, 255, 255, 255); 391 evas_set_color(ib->view->evas, ib->clip, 255, 255, 255, 255);
@@ -390,8 +400,8 @@ e_iconbar_realize(E_Iconbar * ib)
390 /* the path of the key to the image memebr - that is actually */ 400 /* the path of the key to the image memebr - that is actually */
391 /* a lump of image data inlined in the iconbar db - so the icons */ 401 /* a lump of image data inlined in the iconbar db - so the icons */
392 /* themselves follow the iconbar wherever it goes */ 402 /* themselves follow the iconbar wherever it goes */
393 snprintf(buf, PATH_MAX, "%s/.e_iconbar.db:%s", ib->view->model->dir, 403 snprintf(buf, PATH_MAX, "%s/.e_layout/iconbar.db:%s",
394 ic->image_path); 404 ib->view->model->dir, ic->image_path);
395 /* add the icon image object */ 405 /* add the icon image object */
396 ic->image = evas_add_image_from_file(ib->view->evas, buf); 406 ic->image = evas_add_image_from_file(ib->view->evas, buf);
397 /* add an imlib image so we can save it later */ 407 /* add an imlib image so we can save it later */
@@ -439,7 +449,7 @@ e_iconbar_realize(E_Iconbar * ib)
439 /* but fixes the iconbar so its the size of the view, in the right */ 449 /* but fixes the iconbar so its the size of the view, in the right */
440 /* place and arranges the icons in their right spots */ 450 /* place and arranges the icons in their right spots */
441 e_iconbar_fix(ib); 451 e_iconbar_fix(ib);
442 452 D("realized!\n");
443 D_RETURN; 453 D_RETURN;
444} 454}
445 455
@@ -501,16 +511,24 @@ void
501e_iconbar_fix(E_Iconbar * ib) 511e_iconbar_fix(E_Iconbar * ib)
502{ 512{
503 Evas_List l; 513 Evas_List l;
514 double x, y, w, h;
504 double ix, iy, aw, ah; 515 double ix, iy, aw, ah;
505 516
506 D_ENTER; 517 D_ENTER;
507 518
508 /* move the ebit to 0,0 */ 519 /* get geometry from layout */
509 ebits_move(ib->bit, 0, 0); 520 if (!e_view_layout_get_element_geometry(ib->view->layout, "Iconbar",
510 /* resize it to fill the whole view. the internal geometry of the */ 521 &x, &y, &w, &h))
511 /* ebit itself will determine where things woudl go. we just tell */ 522 {
512 /* the ebit where in the canvas its allowed to exist */ 523 D("Error: no geometry for iconbar, must not exist, clean it up.\n");
513 ebits_resize(ib->bit, ib->view->size.w, ib->view->size.h); 524 e_object_unref(ib);
525 D_RETURN;
526 }
527
528 D("iconbar fix: %f, %f, %f, %f\n", x, y, w, h);
529 /* move and resize iconbar to geometry specified in layout */
530 ebits_move(ib->bit, x, y);
531 ebits_resize(ib->bit, w, h);
514 /* show it. harmless to do this all the time */ 532 /* show it. harmless to do this all the time */
515 ebits_show(ib->bit); 533 ebits_show(ib->bit);
516 /* tell the view we belong to something may have changed so it can draw */ 534 /* tell the view we belong to something may have changed so it can draw */
@@ -664,8 +682,7 @@ e_iconbar_file_delete(E_View * v, char *file)
664 D_ENTER; 682 D_ENTER;
665 683
666 /* is the file of interest */ 684 /* is the file of interest */
667 if ((!strcmp(".e_iconbar.db", file)) || 685 if ((!strcmp("iconbar.db", file)) || (!strcmp("iconbar.bits.db", file)))
668 (!strcmp(".e_iconbar.bits.db", file)))
669 { 686 {
670 /* if we have an iconbar.. delete it - because its files have been */ 687 /* if we have an iconbar.. delete it - because its files have been */
671 /* nuked. no need to keep it around. */ 688 /* nuked. no need to keep it around. */
@@ -1705,6 +1722,21 @@ ib_child_handle(Ecore_Event * ev)
1705 D_RETURN; 1722 D_RETURN;
1706} 1723}
1707 1724
1725void
1726e_iconbar_update_geometry(E_Iconbar * ib)
1727{
1728 double x, y, w, h;
1729
1730 D_ENTER;
1731 if (e_view_layout_get_element_geometry(ib->view->layout, "Iconbar",
1732 &x, &y, &w, &h))
1733 {
1734 ebits_move(ib->bit, x, y);
1735 ebits_resize(ib->bit, w, h);
1736 }
1737
1738}
1739
1708E_Rect * 1740E_Rect *
1709e_iconbar_get_resist_rect(E_Iconbar * ib) 1741e_iconbar_get_resist_rect(E_Iconbar * ib)
1710{ 1742{
diff --git a/src/scrollbar.c b/src/scrollbar.c
index 7301cbbf1..78e9ce1b8 100644
--- a/src/scrollbar.c
+++ b/src/scrollbar.c
@@ -2,6 +2,7 @@
2#include "scrollbar.h" 2#include "scrollbar.h"
3#include "config.h" 3#include "config.h"
4#include "util.h" 4#include "util.h"
5#include "view.h"
5 6
6static void e_scrollbar_recalc(E_Scrollbar * sb); 7static void e_scrollbar_recalc(E_Scrollbar * sb);
7static void e_scrollbar_setup_bits(E_Scrollbar * sb); 8static void e_scrollbar_setup_bits(E_Scrollbar * sb);
@@ -79,21 +80,55 @@ e_scrollbar_setup_bits(E_Scrollbar * sb)
79 80
80 if (sb->direction == 1) 81 if (sb->direction == 1)
81 { 82 {
82 snprintf(buf, PATH_MAX, "%s/scroll_base_v.bits.db", 83 /* load from the current dir's layout */
83 e_config_get("scrollbars")); 84 snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_v.bits.db", sb->dir);
84 sb->base = ebits_load(buf); 85 sb->base = ebits_load(buf);
85 snprintf(buf, PATH_MAX, "%s/scroll_bar_v.bits.db", 86
86 e_config_get("scrollbars")); 87 /* if not loaded, load defaults */
88 if (!sb->base)
89 {
90 snprintf(buf, PATH_MAX, "%s/scroll_base_v.bits.db",
91 e_config_get("scrollbars"));
92 sb->base = ebits_load(buf);
93 }
94
95 /* load from current dir's layout */
96 snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_v.bits.db", sb->dir);
87 sb->bar = ebits_load(buf); 97 sb->bar = ebits_load(buf);
98
99 /* if not loaded, load defaults */
100 if (!sb->bar)
101 {
102 snprintf(buf, PATH_MAX, "%s/scroll_bar_v.bits.db",
103 e_config_get("scrollbars"));
104 sb->bar = ebits_load(buf);
105 }
88 } 106 }
89 else 107 else
90 { 108 {
91 snprintf(buf, PATH_MAX, "%s/scroll_base_h.bits.db", 109 /* load from the current dir's layout */
92 e_config_get("scrollbars")); 110 snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_h.bits.db", sb->dir);
93 sb->base = ebits_load(buf); 111 sb->base = ebits_load(buf);
94 snprintf(buf, PATH_MAX, "%s/scroll_bar_h.bits.db", 112
95 e_config_get("scrollbars")); 113 /* if not loaded, load defaults */
114 if (!sb->base)
115 {
116 snprintf(buf, PATH_MAX, "%s/scroll_base_h.bits.db",
117 e_config_get("scrollbars"));
118 sb->base = ebits_load(buf);
119 }
120
121 /* load from current dir's layout */
122 snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_h.bits.db", sb->dir);
96 sb->bar = ebits_load(buf); 123 sb->bar = ebits_load(buf);
124
125 /* if not loaded, load defaults */
126 if (!sb->bar)
127 {
128 snprintf(buf, PATH_MAX, "%s/scroll_bar_h.bits.db",
129 e_config_get("scrollbars"));
130 sb->bar = ebits_load(buf);
131 }
97 } 132 }
98 if (sb->base) 133 if (sb->base)
99 { 134 {
@@ -335,6 +370,7 @@ e_sb_bar_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
335 sb->down_y = y; 370 sb->down_y = y;
336 sb->mouse_x = x; 371 sb->mouse_x = x;
337 sb->mouse_y = y; 372 sb->mouse_y = y;
373 sb->view->changed = 1;
338 374
339 D_RETURN; 375 D_RETURN;
340 UN(o); 376 UN(o);
@@ -360,6 +396,8 @@ e_sb_bar_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
360 sb->mouse_down = 0; 396 sb->mouse_down = 0;
361 else 397 else
362 D_RETURN; 398 D_RETURN;
399
400 sb->view->changed = 1;
363 401
364 D_RETURN; 402 D_RETURN;
365 UN(o); 403 UN(o);
@@ -473,7 +511,7 @@ e_sb_scroll_timer(int val, void *data)
473} 511}
474 512
475E_Scrollbar * 513E_Scrollbar *
476e_scrollbar_new(void) 514e_scrollbar_new(E_View * v)
477{ 515{
478 E_Scrollbar *sb; 516 E_Scrollbar *sb;
479 517
@@ -484,6 +522,9 @@ e_scrollbar_new(void)
484 522
485 e_object_init(E_OBJECT(sb), (E_Cleanup_Func) e_scrollbar_cleanup); 523 e_object_init(E_OBJECT(sb), (E_Cleanup_Func) e_scrollbar_cleanup);
486 524
525 sb->view = v;
526 e_strdup(sb->dir, v->model->dir);
527
487 sb->range = 1.0; 528 sb->range = 1.0;
488 sb->max = 1.0; 529 sb->max = 1.0;
489 sb->w = 12; 530 sb->w = 12;
diff --git a/src/scrollbar.h b/src/scrollbar.h
index 0c181c7e8..cb4dae9c5 100644
--- a/src/scrollbar.h
+++ b/src/scrollbar.h
@@ -1,7 +1,19 @@
1#ifndef E_SCROLLBAR_H
2#define E_SCROLLBAR_H
3
1#include "e.h" 4#include "e.h"
2#include "object.h" 5#include "object.h"
6#include "view.h"
3 7
8#ifndef E_SCROLLBAR_TYPEDEF
9#define E_SCROLLBAR_TYPEDEF
4typedef struct _E_Scrollbar E_Scrollbar; 10typedef struct _E_Scrollbar E_Scrollbar;
11#endif
12
13#ifndef E_VIEW_TYPEDEF
14#define E_VIEW_TYPEDEF
15typedef struct _E_View E_View;
16#endif
5 17
6struct _E_Scrollbar 18struct _E_Scrollbar
7{ 19{
@@ -12,8 +24,8 @@ struct _E_Scrollbar
12 double max; 24 double max;
13 double range; 25 double range;
14 26
27 E_View *view;
15 char *dir; 28 char *dir;
16
17 Evas evas; 29 Evas evas;
18 30
19 Ebits_Object bar; 31 Ebits_Object bar;
@@ -47,7 +59,7 @@ struct _E_Scrollbar
47 void *func_data; 59 void *func_data;
48}; 60};
49 61
50E_Scrollbar *e_scrollbar_new(void); 62E_Scrollbar *e_scrollbar_new(E_View * v);
51void e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas evas); 63void e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas evas);
52void e_scrollbar_show(E_Scrollbar * sb); 64void e_scrollbar_show(E_Scrollbar * sb);
53void e_scrollbar_hide(E_Scrollbar * sb); 65void e_scrollbar_hide(E_Scrollbar * sb);
@@ -73,3 +85,5 @@ double e_scrollbar_get_range(E_Scrollbar * sb);
73double e_scrollbar_get_max(E_Scrollbar * sb); 85double e_scrollbar_get_max(E_Scrollbar * sb);
74void e_scrollbar_get_geometry(E_Scrollbar * sb, double *x, 86void e_scrollbar_get_geometry(E_Scrollbar * sb, double *x,
75 double *y, double *w, double *h); 87 double *y, double *w, double *h);
88
89#endif
diff --git a/src/view.c b/src/view.c
index 973b9581e..263583100 100644
--- a/src/view.c
+++ b/src/view.c
@@ -333,7 +333,7 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
333 if (!(ev->mods & (multi_select_mod | range_select_mod))) 333 if (!(ev->mods & (multi_select_mod | range_select_mod)))
334 { 334 {
335 v->select.last_count = v->select.count; 335 v->select.last_count = v->select.count;
336 e_view_deselect_all(v); 336 e_view_deselect_all();
337 } 337 }
338 338
339 if (_b == 1) 339 if (_b == 1)
@@ -554,35 +554,53 @@ e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
554} 554}
555 555
556void 556void
557e_view_deselect_all(E_View * v) 557e_view_deselect_all(void)
558{ 558{
559 Evas_List l; 559 Evas_List ll;
560 560
561 D_ENTER; 561 D_ENTER;
562 for (l = v->icons; l; l = l->next) 562
563 for (ll = VM->views; ll; ll = ll->next)
563 { 564 {
564 E_Icon *ic; 565 Evas_List l;
566 E_View *v;
565 567
566 ic = l->data; 568 v = ll->data;
567 e_icon_deselect(ic); 569 for (l = v->icons; l; l = l->next)
570 {
571 E_Icon *ic;
572
573 ic = l->data;
574 e_icon_deselect(ic);
575 }
568 } 576 }
577
569 D_RETURN; 578 D_RETURN;
570} 579}
571 580
572void 581void
573e_view_deselect_all_except(E_Icon * not_ic) 582e_view_deselect_all_except(E_Icon * not_ic)
574{ 583{
575 Evas_List l; 584 Evas_List ll;
576 585
577 D_ENTER; 586 D_ENTER;
578 for (l = not_ic->view->icons; l; l = l->next) 587
588 for (ll = VM->views; ll; ll = ll->next)
579 { 589 {
580 E_Icon *ic; 590 Evas_List l;
591 E_View *v;
581 592
582 ic = l->data; 593 v = ll->data;
583 if (ic != not_ic) 594 for (l = v->icons; l; l = l->next)
584 e_icon_deselect(ic); 595 {
596 E_Icon *ic;
597
598 ic = l->data;
599 if (ic != not_ic)
600 e_icon_deselect(ic);
601 }
585 } 602 }
603
586 D_RETURN; 604 D_RETURN;
587} 605}
588 606
@@ -667,7 +685,6 @@ e_view_icons_apply_xy(E_View * v)
667 ic = l->data; 685 ic = l->data;
668 e_icon_apply_xy(ic); 686 e_icon_apply_xy(ic);
669 } 687 }
670 v->changed = 1;
671 688
672 D_RETURN; 689 D_RETURN;
673} 690}
@@ -697,6 +714,7 @@ e_view_scroll_to(E_View * v, int sx, int sy)
697 e_view_icons_apply_xy(v); 714 e_view_icons_apply_xy(v);
698 if (v->bg) 715 if (v->bg)
699 e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y); 716 e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y);
717 v->changed = 1;
700 718
701 D_RETURN; 719 D_RETURN;
702} 720}
@@ -902,14 +920,17 @@ static void
902e_configure(Ecore_Event * ev) 920e_configure(Ecore_Event * ev)
903{ 921{
904 Ecore_Event_Window_Configure *e; 922 Ecore_Event_Window_Configure *e;
905 E_View *v; 923 Evas_List l;
906 924
907 D_ENTER; 925 D_ENTER;
908 926
909 e = ev->event; 927 e = ev->event;
910 if (e && e->win) 928 for (l = VM->views; l; l = l->next)
911 { 929 {
912 if ((v = e_view_machine_get_view_by_base_window(e->win))) 930 E_View *v;
931
932 v = l->data;
933 if (e->win == v->win.base)
913 { 934 {
914 /* win, root, x, y, w, h, wm_generated */ 935 /* win, root, x, y, w, h, wm_generated */
915 D("Configure for view: %s\n", v->name); 936 D("Configure for view: %s\n", v->name);
@@ -954,8 +975,30 @@ e_configure(Ecore_Event * ev)
954 evas_set_output_size(v->evas, v->size.w, v->size.h); 975 evas_set_output_size(v->evas, v->size.w, v->size.h);
955 e_view_scroll_to(v, v->scroll.x, v->scroll.y); 976 e_view_scroll_to(v, v->scroll.x, v->scroll.y);
956 e_view_arrange(v); 977 e_view_arrange(v);
978 if (v->layout)
979 e_view_layout_update(v->layout);
957 /* FIXME */ 980 /* FIXME */
958 //e_view_queue_geometry_record(v); 981 //e_view_queue_geometry_record(v);
982
983 {
984 double x, y, w, h;
985
986 if (e_view_layout_get_element_geometry(v->layout,
987 "Scrollbar_H",
988 &x, &y, &w, &h));
989 {
990 e_scrollbar_move(v->scrollbar.h, x, y);
991 e_scrollbar_resize(v->scrollbar.h, w, h);
992 }
993 if (e_view_layout_get_element_geometry(v->layout,
994 "Scrollbar_V",
995 &x, &y, &w, &h));
996 {
997 e_scrollbar_move(v->scrollbar.v, x, y);
998 e_scrollbar_resize(v->scrollbar.v, w, h);
999 }
1000 }
1001
959 e_scrollbar_move(v->scrollbar.v, 1002 e_scrollbar_move(v->scrollbar.v,
960 v->size.w - v->scrollbar.v->w, 0); 1003 v->size.w - v->scrollbar.v->w, 0);
961 e_scrollbar_resize(v->scrollbar.v, v->scrollbar.v->w, 1004 e_scrollbar_resize(v->scrollbar.v, v->scrollbar.v->w,
@@ -968,6 +1011,7 @@ e_configure(Ecore_Event * ev)
968 } 1011 }
969 } 1012 }
970 } 1013 }
1014
971 D_RETURN; 1015 D_RETURN;
972} 1016}
973 1017
@@ -975,16 +1019,21 @@ static void
975e_property(Ecore_Event * ev) 1019e_property(Ecore_Event * ev)
976{ 1020{
977 Ecore_Event_Window_Configure *e; 1021 Ecore_Event_Window_Configure *e;
978 E_View *v; 1022 Evas_List l;
979 1023
980 D_ENTER; 1024 D_ENTER;
1025
981 e = ev->event; 1026 e = ev->event;
982 if (e && e->win) 1027 for (l = VM->views; l; l = l->next)
983 { 1028 {
984 if ((v = e_view_machine_get_view_by_base_window(e->win))) 1029 E_View *v;
1030
1031 v = l->data;
1032 if (e->win == v->win.base)
985 { 1033 {
986 } 1034 }
987 } 1035 }
1036
988 D_RETURN; 1037 D_RETURN;
989} 1038}
990 1039
@@ -992,16 +1041,21 @@ static void
992e_unmap(Ecore_Event * ev) 1041e_unmap(Ecore_Event * ev)
993{ 1042{
994 Ecore_Event_Window_Unmap *e; 1043 Ecore_Event_Window_Unmap *e;
995 E_View *v; 1044 Evas_List l;
996 1045
997 D_ENTER; 1046 D_ENTER;
1047
998 e = ev->event; 1048 e = ev->event;
999 if (e && e->win) 1049 for (l = VM->views; l; l = l->next)
1000 { 1050 {
1001 if ((v = e_view_machine_get_view_by_base_window(e->win))) 1051 E_View *v;
1052
1053 v = l->data;
1054 if (e->win == v->win.base)
1002 { 1055 {
1003 } 1056 }
1004 } 1057 }
1058
1005 D_RETURN; 1059 D_RETURN;
1006} 1060}
1007 1061
@@ -1009,16 +1063,21 @@ static void
1009e_visibility(Ecore_Event * ev) 1063e_visibility(Ecore_Event * ev)
1010{ 1064{
1011 Ecore_Event_Window_Unmap *e; 1065 Ecore_Event_Window_Unmap *e;
1012 E_View *v; 1066 Evas_List l;
1013 1067
1014 D_ENTER; 1068 D_ENTER;
1069
1015 e = ev->event; 1070 e = ev->event;
1016 if (e && e->win) 1071 for (l = VM->views; l; l = l->next)
1017 { 1072 {
1018 if ((v = e_view_machine_get_view_by_base_window(e->win))) 1073 E_View *v;
1074
1075 v = l->data;
1076 if (e->win == v->win.base)
1019 { 1077 {
1020 } 1078 }
1021 } 1079 }
1080
1022 D_RETURN; 1081 D_RETURN;
1023} 1082}
1024 1083
@@ -1026,16 +1085,21 @@ static void
1026e_focus_in(Ecore_Event * ev) 1085e_focus_in(Ecore_Event * ev)
1027{ 1086{
1028 Ecore_Event_Window_Focus_In *e; 1087 Ecore_Event_Window_Focus_In *e;
1029 E_View *v; 1088 Evas_List l;
1030 1089
1031 D_ENTER; 1090 D_ENTER;
1091
1032 e = ev->event; 1092 e = ev->event;
1033 if (e && e->win) 1093 for (l = VM->views; l; l = l->next)
1034 { 1094 {
1035 if ((v = e_view_machine_get_view_by_base_window(e->win))) 1095 E_View *v;
1096
1097 v = l->data;
1098 if (e->win == v->win.base)
1036 { 1099 {
1037 } 1100 }
1038 } 1101 }
1102
1039 D_RETURN; 1103 D_RETURN;
1040} 1104}
1041 1105
@@ -1043,16 +1107,21 @@ static void
1043e_focus_out(Ecore_Event * ev) 1107e_focus_out(Ecore_Event * ev)
1044{ 1108{
1045 Ecore_Event_Window_Focus_Out *e; 1109 Ecore_Event_Window_Focus_Out *e;
1046 E_View *v; 1110 Evas_List l;
1047 1111
1048 D_ENTER; 1112 D_ENTER;
1113
1049 e = ev->event; 1114 e = ev->event;
1050 if (e && e->win) 1115 for (l = VM->views; l; l = l->next)
1051 { 1116 {
1052 if ((v = e_view_machine_get_view_by_base_window(e->win))) 1117 E_View *v;
1118
1119 v = l->data;
1120 if (e->win == v->win.base)
1053 { 1121 {
1054 } 1122 }
1055 } 1123 }
1124
1056 D_RETURN; 1125 D_RETURN;
1057} 1126}
1058 1127
@@ -1060,17 +1129,23 @@ static void
1060e_delete(Ecore_Event * ev) 1129e_delete(Ecore_Event * ev)
1061{ 1130{
1062 Ecore_Event_Window_Delete *e; 1131 Ecore_Event_Window_Delete *e;
1063 E_View *v; 1132 Evas_List l;
1064 1133
1065 D_ENTER; 1134 D_ENTER;
1135
1066 e = ev->event; 1136 e = ev->event;
1067 if (e && e->win) 1137 for (l = VM->views; l; l = l->next)
1068 { 1138 {
1069 if ((v = e_view_machine_get_view_by_base_window(e->win))) 1139 E_View *v;
1140
1141 v = l->data;
1142 if (e->win == v->win.base)
1070 { 1143 {
1071 e_object_unref(E_OBJECT(v)); 1144 e_object_unref(E_OBJECT(v));
1145 D_RETURN;
1072 } 1146 }
1073 } 1147 }
1148
1074 D_RETURN; 1149 D_RETURN;
1075} 1150}
1076 1151
@@ -1084,23 +1159,28 @@ e_dnd_status(Ecore_Event * ev)
1084 Ecore_Event_Dnd_Drop_Status *e; 1159 Ecore_Event_Dnd_Drop_Status *e;
1085 1160
1086 /* 1161 /*
1087 * * typedef struct _ecore_event_dnd_drop_status 1162 * typedef struct _ecore_event_dnd_drop_status
1088 * * { 1163 * {
1089 * * Window win, root, source_win; 1164 * Window win, root, source_win;
1090 * * int x, y, w, h; 1165 * int x, y, w, h;
1091 * * int copy, link, move, private; 1166 * int copy, link, move, private;
1092 * * int all_position_msgs; 1167 * int all_position_msgs;
1093 * * int ok; 1168 * int ok;
1094 * * } Ecore_Event_Dnd_Drop_Status; 1169 * } Ecore_Event_Dnd_Drop_Status;
1095 */ 1170 */
1096 E_View *v; 1171 Evas_List l;
1097 1172
1098 D_ENTER; 1173 D_ENTER;
1174
1099 e = ev->event; 1175 e = ev->event;
1100 if (e && e->win) 1176 for (l = VM->views; l; l = l->next)
1101 { 1177 {
1102 if ((v = e_view_machine_get_view_by_base_window(e->win))) 1178 E_View *v;
1179
1180 v = l->data;
1181 if (e->win == v->win.base)
1103 { 1182 {
1183
1104 if (dnd_pending_mode != E_DND_DELETED && 1184 if (dnd_pending_mode != E_DND_DELETED &&
1105 dnd_pending_mode != E_DND_COPIED) 1185 dnd_pending_mode != E_DND_COPIED)
1106 { 1186 {
@@ -1113,11 +1193,14 @@ e_dnd_status(Ecore_Event * ev)
1113 else 1193 else
1114 dnd_pending_mode = E_DND_ASK; 1194 dnd_pending_mode = E_DND_ASK;
1115 } 1195 }
1196
1116 ecore_window_dnd_ok(e->ok); 1197 ecore_window_dnd_ok(e->ok);
1198
1117 v->changed = 1; 1199 v->changed = 1;
1118 v->drag.icon_hide = 1; 1200 v->drag.icon_hide = 1;
1119 } 1201 }
1120 } 1202 }
1203
1121 D_RETURN; 1204 D_RETURN;
1122} 1205}
1123 1206
@@ -1125,16 +1208,21 @@ static void
1125e_wheel(Ecore_Event * ev) 1208e_wheel(Ecore_Event * ev)
1126{ 1209{
1127 Ecore_Event_Wheel *e; 1210 Ecore_Event_Wheel *e;
1128 E_View *v; 1211 Evas_List l;
1129 1212
1130 D_ENTER; 1213 D_ENTER;
1214
1131 e = ev->event; 1215 e = ev->event;
1132 if (e && e->win) 1216 for (l = VM->views; l; l = l->next)
1133 { 1217 {
1134 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1218 E_View *v;
1219
1220 v = l->data;
1221 if (e->win == v->win.main)
1135 { 1222 {
1136 } 1223 }
1137 } 1224 }
1225
1138 D_RETURN; 1226 D_RETURN;
1139} 1227}
1140 1228
@@ -1142,14 +1230,17 @@ static void
1142e_key_down(Ecore_Event * ev) 1230e_key_down(Ecore_Event * ev)
1143{ 1231{
1144 Ecore_Event_Key_Down *e; 1232 Ecore_Event_Key_Down *e;
1145 E_View *v; 1233 Evas_List l;
1146 1234
1147 D_ENTER; 1235 D_ENTER;
1236
1148 e = ev->event; 1237 e = ev->event;
1149 if (e && e->win) 1238 for (l = VM->views; l; l = l->next)
1150 { 1239 {
1151 if ((v = e_view_machine_get_view_by_main_window(e->win)) 1240 E_View *v;
1152 || (v = e_view_machine_get_view_by_base_window(e->win))) 1241
1242 v = l->data;
1243 if ((e->win == v->win.base) || (e->win == v->win.main))
1153 { 1244 {
1154 if (!strcmp(e->key, "Up")) 1245 if (!strcmp(e->key, "Up"))
1155 { 1246 {
@@ -1183,8 +1274,10 @@ e_key_down(Ecore_Event * ev)
1183 { 1274 {
1184 } 1275 }
1185 } 1276 }
1277 D_RETURN;
1186 } 1278 }
1187 } 1279 }
1280
1188 D_RETURN; 1281 D_RETURN;
1189} 1282}
1190 1283
@@ -1192,16 +1285,19 @@ static void
1192e_key_up(Ecore_Event * ev) 1285e_key_up(Ecore_Event * ev)
1193{ 1286{
1194 Ecore_Event_Key_Up *e; 1287 Ecore_Event_Key_Up *e;
1195 E_View *v; 1288 Evas_List l;
1196 1289
1197 D_ENTER; 1290 D_ENTER;
1291
1198 e = ev->event; 1292 e = ev->event;
1199 if (e && e->win) 1293 D_RETURN;
1294 for (l = VM->views; l; l = l->next)
1200 { 1295 {
1201 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1296 E_View *v;
1202 { 1297
1203 } 1298 v = l->data;
1204 } 1299 }
1300
1205 D_RETURN; 1301 D_RETURN;
1206} 1302}
1207 1303
@@ -1209,14 +1305,18 @@ static void
1209e_mouse_down(Ecore_Event * ev) 1305e_mouse_down(Ecore_Event * ev)
1210{ 1306{
1211 Ecore_Event_Mouse_Down *e; 1307 Ecore_Event_Mouse_Down *e;
1212 E_View *v; 1308 Evas_List l;
1213 1309
1214 D_ENTER; 1310 D_ENTER;
1311
1215 e = ev->event; 1312 e = ev->event;
1216 current_ev = ev; 1313 current_ev = ev;
1217 if (e && e->win) 1314 for (l = VM->views; l; l = l->next)
1218 { 1315 {
1219 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1316 E_View *v;
1317
1318 v = l->data;
1319 if (e->win == v->win.main)
1220 { 1320 {
1221 int focus_mode; 1321 int focus_mode;
1222 1322
@@ -1231,6 +1331,7 @@ e_mouse_down(Ecore_Event * ev)
1231 } 1331 }
1232 } 1332 }
1233 current_ev = NULL; 1333 current_ev = NULL;
1334
1234 D_RETURN; 1335 D_RETURN;
1235} 1336}
1236 1337
@@ -1238,19 +1339,26 @@ static void
1238e_mouse_up(Ecore_Event * ev) 1339e_mouse_up(Ecore_Event * ev)
1239{ 1340{
1240 Ecore_Event_Mouse_Up *e; 1341 Ecore_Event_Mouse_Up *e;
1241 E_View *v; 1342 Evas_List l;
1242 1343
1243 D_ENTER; 1344 D_ENTER;
1345
1244 e = ev->event; 1346 e = ev->event;
1245 current_ev = ev; 1347 current_ev = ev;
1246 if (e && e->win) 1348 for (l = VM->views; l; l = l->next)
1247 { 1349 {
1248 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1350 E_View *v;
1351
1352 v = l->data;
1353 if (e->win == v->win.main)
1249 { 1354 {
1250 evas_event_button_up(v->evas, e->x, e->y, e->button); 1355 evas_event_button_up(v->evas, e->x, e->y, e->button);
1356 current_ev = NULL;
1357 D_RETURN;
1251 } 1358 }
1252 } 1359 }
1253 current_ev = NULL; 1360 current_ev = NULL;
1361
1254 D_RETURN; 1362 D_RETURN;
1255} 1363}
1256 1364
@@ -1258,19 +1366,26 @@ static void
1258e_mouse_move(Ecore_Event * ev) 1366e_mouse_move(Ecore_Event * ev)
1259{ 1367{
1260 Ecore_Event_Mouse_Move *e; 1368 Ecore_Event_Mouse_Move *e;
1261 E_View *v; 1369 Evas_List l;
1262 1370
1263 D_ENTER; 1371 D_ENTER;
1372
1264 e = ev->event; 1373 e = ev->event;
1265 current_ev = ev; 1374 current_ev = ev;
1266 if (e && e->win) 1375 for (l = VM->views; l; l = l->next)
1267 { 1376 {
1268 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1377 E_View *v;
1378
1379 v = l->data;
1380 if (e->win == v->win.main)
1269 { 1381 {
1270 evas_event_move(v->evas, e->x, e->y); 1382 evas_event_move(v->evas, e->x, e->y);
1383 current_ev = NULL;
1384 D_RETURN;
1271 } 1385 }
1272 } 1386 }
1273 current_ev = NULL; 1387 current_ev = NULL;
1388
1274 D_RETURN; 1389 D_RETURN;
1275} 1390}
1276 1391
@@ -1278,19 +1393,25 @@ static void
1278e_mouse_in(Ecore_Event * ev) 1393e_mouse_in(Ecore_Event * ev)
1279{ 1394{
1280 Ecore_Event_Window_Enter *e; 1395 Ecore_Event_Window_Enter *e;
1281 E_View *v; 1396 Evas_List l;
1282 1397
1283 D_ENTER; 1398 D_ENTER;
1399
1284 e = ev->event; 1400 e = ev->event;
1285 current_ev = ev; 1401 current_ev = ev;
1286 if (e && e->win) 1402 for (l = VM->views; l; l = l->next)
1287 { 1403 {
1288 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1404 E_View *v;
1405
1406 v = l->data;
1407 if (e->win == v->win.main)
1289 { 1408 {
1290 if (v->model->is_desktop) 1409 if (v->model->is_desktop)
1291 { 1410 {
1292 evas_event_enter(v->evas); 1411 evas_event_enter(v->evas);
1293 } 1412 }
1413 current_ev = NULL;
1414 D_RETURN;
1294 } 1415 }
1295 } 1416 }
1296 current_ev = NULL; 1417 current_ev = NULL;
@@ -1302,16 +1423,22 @@ static void
1302e_mouse_out(Ecore_Event * ev) 1423e_mouse_out(Ecore_Event * ev)
1303{ 1424{
1304 Ecore_Event_Window_Leave *e; 1425 Ecore_Event_Window_Leave *e;
1305 E_View *v; 1426 Evas_List l;
1306 1427
1307 D_ENTER; 1428 D_ENTER;
1429
1308 e = ev->event; 1430 e = ev->event;
1309 current_ev = ev; 1431 current_ev = ev;
1310 if (e && e->win) 1432 for (l = VM->views; l; l = l->next)
1311 { 1433 {
1312 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1434 E_View *v;
1435
1436 v = l->data;
1437 if (e->win == v->win.main)
1313 { 1438 {
1314 evas_event_leave(v->evas); 1439 evas_event_leave(v->evas);
1440 current_ev = NULL;
1441 D_RETURN;
1315 } 1442 }
1316 } 1443 }
1317 current_ev = NULL; 1444 current_ev = NULL;
@@ -1323,20 +1450,25 @@ static void
1323e_window_expose(Ecore_Event * ev) 1450e_window_expose(Ecore_Event * ev)
1324{ 1451{
1325 Ecore_Event_Window_Expose *e; 1452 Ecore_Event_Window_Expose *e;
1326 E_View *v; 1453 Evas_List l;
1327 1454
1328 D_ENTER; 1455 D_ENTER;
1456
1329 e = ev->event; 1457 e = ev->event;
1330 current_ev = ev; 1458 for (l = VM->views; l; l = l->next)
1331 if (e && e->win)
1332 { 1459 {
1333 if ((v = e_view_machine_get_view_by_main_window(e->win))) 1460 E_View *v;
1461
1462 v = l->data;
1463 if (e->win == v->win.main)
1334 { 1464 {
1335 if (!(v->pmap)) 1465 if (!(v->pmap))
1336 evas_update_rect(v->evas, e->x, e->y, e->w, e->h); 1466 evas_update_rect(v->evas, e->x, e->y, e->w, e->h);
1337 v->changed = 1; 1467 v->changed = 1;
1468 D_RETURN;
1338 } 1469 }
1339 } 1470 }
1471
1340 D_RETURN; 1472 D_RETURN;
1341} 1473}
1342 1474
@@ -1507,6 +1639,41 @@ e_view_queue_resort(E_View * v)
1507 D_RETURN; 1639 D_RETURN;
1508} 1640}
1509 1641
1642E_View *
1643e_view_find_by_window(Window win)
1644{
1645 Evas_List l;
1646
1647 D_ENTER;
1648
1649 for (l = VM->views; l; l = l->next)
1650 {
1651 E_View *v;
1652
1653 v = l->data;
1654 if (v->win.base == win)
1655 D_RETURN_(v);
1656 }
1657
1658 D_RETURN_(NULL);
1659}
1660
1661void
1662e_view_close_all(void)
1663{
1664 D_ENTER;
1665
1666 while (VM->views)
1667 {
1668 E_View *v;
1669
1670 v = VM->views->data;
1671 e_object_unref(E_OBJECT(v));
1672 }
1673
1674 D_RETURN;
1675}
1676
1510static void 1677static void
1511e_view_cleanup(E_View * v) 1678e_view_cleanup(E_View * v)
1512{ 1679{
@@ -1517,13 +1684,13 @@ e_view_cleanup(E_View * v)
1517 * not via a timeout, because we will destroy the object after this.*/ 1684 * not via a timeout, because we will destroy the object after this.*/
1518 e_view_geometry_record(v); 1685 e_view_geometry_record(v);
1519 1686
1687 e_view_machine_unregister_view(v);
1688
1520 if (v->iconbar) 1689 if (v->iconbar)
1521 { 1690 {
1522 e_iconbar_save_out_final(v->iconbar); 1691 /*e_iconbar_save_out_final(v->iconbar); */
1523 e_object_unref(E_OBJECT(v->iconbar)); 1692 e_object_unref(E_OBJECT(v->iconbar));
1524 } 1693 }
1525 if (v->bg)
1526 e_bg_free(v->bg);
1527 if (v->scrollbar.h) 1694 if (v->scrollbar.h)
1528 e_object_unref(E_OBJECT(v->scrollbar.h)); 1695 e_object_unref(E_OBJECT(v->scrollbar.h));
1529 if (v->scrollbar.v) 1696 if (v->scrollbar.v)
@@ -1533,9 +1700,8 @@ e_view_cleanup(E_View * v)
1533 snprintf(name, PATH_MAX, "resort_timer.%s", v->name); 1700 snprintf(name, PATH_MAX, "resort_timer.%s", v->name);
1534 ecore_del_event_timer(name); 1701 ecore_del_event_timer(name);
1535 1702
1536 /* unregister with the underlying model and the global list of views */ 1703 if (v->layout)
1537 e_view_model_unregister_view(v); 1704 e_object_unref(v->layout);
1538 e_view_machine_unregister_view(v);
1539 /* FIXME: clean up the rest!!! this leaks ... */ 1705 /* FIXME: clean up the rest!!! this leaks ... */
1540 1706
1541 /* Call the destructor of the base class */ 1707 /* Call the destructor of the base class */
@@ -1572,6 +1738,7 @@ e_view_new(void)
1572 v->options.back_pixmap = 0; 1738 v->options.back_pixmap = 0;
1573#endif 1739#endif
1574#endif 1740#endif
1741 v->select.lock = 0;
1575 v->select.config.grad_size.l = 8; 1742 v->select.config.grad_size.l = 8;
1576 v->select.config.grad_size.r = 8; 1743 v->select.config.grad_size.r = 8;
1577 v->select.config.grad_size.t = 8; 1744 v->select.config.grad_size.t = 8;
@@ -1615,7 +1782,9 @@ e_view_set_dir(E_View * v, char *path, int is_desktop)
1615 if (!(m = e_view_machine_model_lookup(path))) 1782 if (!(m = e_view_machine_model_lookup(path)))
1616 { 1783 {
1617 D("Model for this dir doesn't exist, make a new one\n"); 1784 D("Model for this dir doesn't exist, make a new one\n");
1785
1618 m = e_view_model_new(); 1786 m = e_view_model_new();
1787 VM->models = evas_list_append(VM->models, m);
1619 e_view_model_set_dir(m, path); 1788 e_view_model_set_dir(m, path);
1620 1789
1621 snprintf(buf, PATH_MAX, "%s/.e_background.bg.db", m->dir); 1790 snprintf(buf, PATH_MAX, "%s/.e_background.bg.db", m->dir);
@@ -1638,7 +1807,8 @@ e_view_set_dir(E_View * v, char *path, int is_desktop)
1638 1807
1639 if (m) 1808 if (m)
1640 { 1809 {
1641 e_view_model_register_view(m, v); 1810 v->model = m;
1811 v->model->views = evas_list_append(v->model->views, v);
1642 /* FIXME do a real naming scheme here */ 1812 /* FIXME do a real naming scheme here */
1643 snprintf(buf, PATH_MAX, "%s:%d", v->model->dir, 1813 snprintf(buf, PATH_MAX, "%s:%d", v->model->dir,
1644 e_object_get_usecount(E_OBJECT(v->model))); 1814 e_object_get_usecount(E_OBJECT(v->model)));
@@ -1705,7 +1875,6 @@ e_view_realize(E_View * v)
1705 evas_get_visual(v->evas), evas_get_colormap(v->evas)); 1875 evas_get_visual(v->evas), evas_get_colormap(v->evas));
1706 ecore_window_set_background_pixmap(v->win.main, v->pmap); 1876 ecore_window_set_background_pixmap(v->win.main, v->pmap);
1707 } 1877 }
1708
1709 if (v->bg) 1878 if (v->bg)
1710 { 1879 {
1711 e_bg_add_to_evas(v->bg, v->evas); 1880 e_bg_add_to_evas(v->bg, v->evas);
@@ -1720,7 +1889,25 @@ e_view_realize(E_View * v)
1720 e_bg_show(v->bg); 1889 e_bg_show(v->bg);
1721 } 1890 }
1722 1891
1723 v->scrollbar.v = e_scrollbar_new(); 1892 /* load the layout */
1893 v->layout = e_view_layout_new(v);
1894 if (v->layout)
1895 e_view_layout_realize(v->layout);
1896
1897 /* set the file area spacing, if in layout */
1898 /* FIXME: the icon layout should probably be totally redone */
1899 {
1900 double x, y, w, h;
1901
1902 if (e_view_layout_get_element_geometry(v->layout, "Icons",
1903 &x, &y, &w, &h));
1904 v->spacing.window.l = x;
1905 v->spacing.window.r = v->size.w - (x + w);
1906 v->spacing.window.t = y;
1907 v->spacing.window.b = v->size.h - (y + h);
1908 }
1909
1910 v->scrollbar.v = e_scrollbar_new(v);
1724 e_scrollbar_set_change_func(v->scrollbar.v, e_view_scrollbar_v_change_cb, v); 1911 e_scrollbar_set_change_func(v->scrollbar.v, e_view_scrollbar_v_change_cb, v);
1725 e_scrollbar_set_direction(v->scrollbar.v, 1); 1912 e_scrollbar_set_direction(v->scrollbar.v, 1);
1726 e_scrollbar_add_to_evas(v->scrollbar.v, v->evas); 1913 e_scrollbar_add_to_evas(v->scrollbar.v, v->evas);
@@ -1729,7 +1916,7 @@ e_view_realize(E_View * v)
1729 e_scrollbar_set_range(v->scrollbar.v, 1.0); 1916 e_scrollbar_set_range(v->scrollbar.v, 1.0);
1730 e_scrollbar_set_max(v->scrollbar.v, 1.0); 1917 e_scrollbar_set_max(v->scrollbar.v, 1.0);
1731 1918
1732 v->scrollbar.h = e_scrollbar_new(); 1919 v->scrollbar.h = e_scrollbar_new(v);
1733 e_scrollbar_set_change_func(v->scrollbar.h, e_view_scrollbar_h_change_cb, v); 1920 e_scrollbar_set_change_func(v->scrollbar.h, e_view_scrollbar_h_change_cb, v);
1734 e_scrollbar_set_direction(v->scrollbar.h, 0); 1921 e_scrollbar_set_direction(v->scrollbar.h, 0);
1735 e_scrollbar_add_to_evas(v->scrollbar.h, v->evas); 1922 e_scrollbar_add_to_evas(v->scrollbar.h, v->evas);
@@ -1738,12 +1925,23 @@ e_view_realize(E_View * v)
1738 e_scrollbar_set_range(v->scrollbar.h, 1.0); 1925 e_scrollbar_set_range(v->scrollbar.h, 1.0);
1739 e_scrollbar_set_max(v->scrollbar.h, 1.0); 1926 e_scrollbar_set_max(v->scrollbar.h, 1.0);
1740 1927
1741 e_scrollbar_move(v->scrollbar.v, v->size.w - v->scrollbar.v->w, 0); 1928 {
1742 e_scrollbar_resize(v->scrollbar.v, v->scrollbar.v->w, 1929 double x, y, w, h;
1743 v->size.h - v->scrollbar.h->h); 1930
1744 e_scrollbar_move(v->scrollbar.h, 0, v->size.h - v->scrollbar.h->h); 1931 if (e_view_layout_get_element_geometry(v->layout, "Scrollbar_H",
1745 e_scrollbar_resize(v->scrollbar.h, v->size.w - v->scrollbar.v->w, 1932 &x, &y, &w, &h));
1746 v->scrollbar.h->h); 1933 {
1934 e_scrollbar_move(v->scrollbar.h, x, y);
1935 e_scrollbar_resize(v->scrollbar.h, w, h);
1936 }
1937
1938 if (e_view_layout_get_element_geometry(v->layout, "Scrollbar_V",
1939 &x, &y, &w, &h));
1940 {
1941 e_scrollbar_move(v->scrollbar.v, x, y);
1942 e_scrollbar_resize(v->scrollbar.v, w, h);
1943 }
1944 }
1747 1945
1748 /* I support dnd */ 1946 /* I support dnd */
1749 ecore_window_dnd_advertise(v->win.base); 1947 ecore_window_dnd_advertise(v->win.base);
@@ -1755,7 +1953,7 @@ e_view_realize(E_View * v)
1755 if (v->iconbar) 1953 if (v->iconbar)
1756 { 1954 {
1757 e_iconbar_realize(v->iconbar); 1955 e_iconbar_realize(v->iconbar);
1758 e_iconbar_set_view_window_spacing(v->iconbar); 1956 /*e_iconbar_set_view_window_spacing(v->iconbar); */
1759 } 1957 }
1760 1958
1761 e_view_bg_reload(v); 1959 e_view_bg_reload(v);
@@ -1854,6 +2052,7 @@ e_view_update(E_View * v)
1854 evas_render(v->evas); 2052 evas_render(v->evas);
1855 2053
1856 v->changed = 0; 2054 v->changed = 0;
2055
1857 D_RETURN; 2056 D_RETURN;
1858} 2057}
1859 2058
@@ -2056,6 +2255,7 @@ e_dnd_data_request(Ecore_Event * ev)
2056 * Atom destination_atom; 2255 * Atom destination_atom;
2057 * } Ecore_Event_Dnd_Data_Request; 2256 * } Ecore_Event_Dnd_Data_Request;
2058 */ 2257 */
2258 Evas_List l;
2059 E_View *v; 2259 E_View *v;
2060 Evas_List ll; 2260 Evas_List ll;
2061 char *data = NULL; 2261 char *data = NULL;
@@ -2084,8 +2284,12 @@ e_dnd_data_request(Ecore_Event * ev)
2084 * } 2284 * }
2085 */ 2285 */
2086 e = ev->event; 2286 e = ev->event;
2087 if (!(v = e_view_machine_get_view_by_base_window(e->win))) 2287 for (l = VM->views; l; l = l->next)
2088 D_RETURN; 2288 {
2289 v = l->data;
2290 if (e->win == v->win.base)
2291 break;
2292 }
2089 2293
2090 if (e->uri_list) 2294 if (e->uri_list)
2091 { 2295 {
@@ -2196,14 +2400,17 @@ e_dnd_drop_end(Ecore_Event * ev)
2196 * * Window win, root, source_win; 2400 * * Window win, root, source_win;
2197 * * } Ecore_Event_Dnd_Drop_End; 2401 * * } Ecore_Event_Dnd_Drop_End;
2198 */ 2402 */
2199 E_View *v; 2403 Evas_List l;
2200 2404
2201 D_ENTER; 2405 D_ENTER;
2202 2406
2203 e = ev->event; 2407 e = ev->event;
2204 if (e && e->win) 2408 for (l = VM->views; l; l = l->next)
2205 { 2409 {
2206 if ((v = e_view_machine_get_view_by_base_window(e->win))) 2410 E_View *v;
2411
2412 v = l->data;
2413 if (e->win == v->win.base)
2207 { 2414 {
2208 if (v_dnd_source) 2415 if (v_dnd_source)
2209 { 2416 {
@@ -2220,9 +2427,12 @@ e_dnd_drop_end(Ecore_Event * ev)
2220 v_dnd_source->changed = 1; 2427 v_dnd_source->changed = 1;
2221 v_dnd_source->drag.icon_show = 1; 2428 v_dnd_source->drag.icon_show = 1;
2222 } 2429 }
2430
2223 e_dnd_drop_request_free(); 2431 e_dnd_drop_request_free();
2432 D_RETURN;
2224 } 2433 }
2225 } 2434 }
2435
2226 D_RETURN; 2436 D_RETURN;
2227} 2437}
2228 2438
@@ -2232,19 +2442,23 @@ e_dnd_drop_position(Ecore_Event * ev)
2232 Ecore_Event_Dnd_Drop_Position *e; 2442 Ecore_Event_Dnd_Drop_Position *e;
2233 2443
2234 /* 2444 /*
2235 * * typedef struct _ecore_event_dnd_drop_position 2445 * typedef struct _ecore_event_dnd_drop_position
2236 * * { 2446 * {
2237 * * Window win, root, source_win; 2447 * Window win, root, source_win;
2238 * * int x, y; 2448 * int x, y;
2239 * * } Ecore_Event_Dnd_Drop_Position; 2449 * } Ecore_Event_Dnd_Drop_Position;
2240 */ 2450 */
2241 E_View *v; 2451 Evas_List l;
2242 2452
2243 D_ENTER; 2453 D_ENTER;
2454
2244 e = ev->event; 2455 e = ev->event;
2245 if (e && e->win) 2456 for (l = VM->views; l; l = l->next)
2246 { 2457 {
2247 if ((v = e_view_machine_get_view_by_base_window(e->win))) 2458 E_View *v;
2459
2460 v = l->data;
2461 if (e->win == v->win.base)
2248 { 2462 {
2249 if (v->iconbar) 2463 if (v->iconbar)
2250 { 2464 {
@@ -2270,8 +2484,10 @@ e_dnd_drop_position(Ecore_Event * ev)
2270 v->size.w, v->size.h); 2484 v->size.w, v->size.h);
2271 2485
2272 /* todo - cache window extents, don't send again within these extents. */ 2486 /* todo - cache window extents, don't send again within these extents. */
2487 D_RETURN;
2273 } 2488 }
2274 } 2489 }
2490
2275 D_RETURN; 2491 D_RETURN;
2276} 2492}
2277 2493
@@ -2286,25 +2502,32 @@ e_dnd_drop(Ecore_Event * ev)
2286 * Window win, root, source_win; 2502 * Window win, root, source_win;
2287 * } Ecore_Event_Dnd_Drop; 2503 * } Ecore_Event_Dnd_Drop;
2288 */ 2504 */
2289 E_View *v; 2505 Evas_List l;
2290 2506
2291 D_ENTER; 2507 D_ENTER;
2508
2292 e = ev->event; 2509 e = ev->event;
2293 if (e && e->win) 2510 for (l = VM->views; l; l = l->next)
2294 { 2511 {
2295 if ((v = e_view_machine_get_view_by_base_window(e->win))) 2512 E_View *v;
2513
2514 v = l->data;
2515 if (e->win == v->win.base)
2296 { 2516 {
2297 /* Dropped! Handle data */ 2517 /* Dropped! Handle data */
2298 /* Same view or same underlying dir? Mark to skip action */ 2518 /* Same view or same underlying dir? Mark to skip action */
2299 if (e->win == e->source_win || v->model == v_dnd_source->model) 2519 if (e->win == e->source_win || v->model == v_dnd_source->model)
2300 v_dnd_source->drag.matching_drop_attempt = 1; 2520 v->drag.matching_drop_attempt = 1;
2301 /* Perform the action... */ 2521 /* Perform the action... */
2302 e_dnd_handle_drop(v); 2522 e_dnd_handle_drop(v);
2303 2523
2304 ecore_window_dnd_send_finished(v->win.base, e->source_win); 2524 ecore_window_dnd_send_finished(v->win.base, e->source_win);
2305 e_dnd_drop_request_free(); 2525 e_dnd_drop_request_free();
2526
2527 D_RETURN;
2306 } 2528 }
2307 } 2529 }
2530
2308 D_RETURN; 2531 D_RETURN;
2309} 2532}
2310 2533
@@ -2322,13 +2545,17 @@ e_dnd_drop_request(Ecore_Event * ev)
2322 * int copy, link, move; 2545 * int copy, link, move;
2323 * } Ecore_Event_Dnd_Drop_Request; 2546 * } Ecore_Event_Dnd_Drop_Request;
2324 */ 2547 */
2325 E_View *v; 2548 Evas_List l;
2326 2549
2327 D_ENTER; 2550 D_ENTER;
2551
2328 e = ev->event; 2552 e = ev->event;
2329 if (e && e->win) 2553 for (l = VM->views; l; l = l->next)
2330 { 2554 {
2331 if ((v = e_view_machine_get_view_by_base_window(e->win))) 2555 E_View *v;
2556
2557 v = l->data;
2558 if (e->win == v->win.base)
2332 { 2559 {
2333 /* if it exists, we already have the data... */ 2560 /* if it exists, we already have the data... */
2334 if ((!dnd_files) && (e->num_files > 0)) 2561 if ((!dnd_files) && (e->num_files > 0))
@@ -2344,9 +2571,9 @@ e_dnd_drop_request(Ecore_Event * ev)
2344 dnd_num_files = e->num_files; 2571 dnd_num_files = e->num_files;
2345 2572
2346 /* if the dnd source is e itself then dont use the event mode */ 2573 /* if the dnd source is e itself then dont use the event mode */
2347 if ((v == 2574 if (e_view_find_by_window(e->source_win))
2348 e_view_machine_get_view_by_base_window(e->source_win)))
2349 { 2575 {
2576 v = e_view_find_by_window(e->source_win);
2350 dnd_pending_mode = v->drag.drop_mode; 2577 dnd_pending_mode = v->drag.drop_mode;
2351 } 2578 }
2352 else 2579 else
@@ -2361,8 +2588,10 @@ e_dnd_drop_request(Ecore_Event * ev)
2361 dnd_pending_mode = E_DND_ASK; 2588 dnd_pending_mode = E_DND_ASK;
2362 } 2589 }
2363 } 2590 }
2591 D_RETURN;
2364 } 2592 }
2365 } 2593 }
2594
2366 D_RETURN; 2595 D_RETURN;
2367} 2596}
2368 2597
diff --git a/src/view.h b/src/view.h
index b83dd721f..d3228076d 100644
--- a/src/view.h
+++ b/src/view.h
@@ -9,6 +9,7 @@
9#include "object.h" 9#include "object.h"
10#include "e_view_model.h" 10#include "e_view_model.h"
11#include "e_file.h" 11#include "e_file.h"
12#include "view_layout.h"
12 13
13#ifndef E_VIEW_TYPEDEF 14#ifndef E_VIEW_TYPEDEF
14#define E_VIEW_TYPEDEF 15#define E_VIEW_TYPEDEF
@@ -30,6 +31,17 @@ typedef struct _E_Iconbar E_Iconbar;
30typedef struct _E_View_Model E_View_Model; 31typedef struct _E_View_Model E_View_Model;
31#endif 32#endif
32 33
34#ifndef E_VIEW_LAYOUT_TYPEDEF
35#define E_VIEW_LAYOUT_TYPEDEF
36typedef struct _E_View_Layout E_View_Layout;
37typedef struct _E_View_Layout_Element E_View_Layout_Element;
38#endif
39
40#ifndef E_SCROLLBAR_TYPEDEF
41#define E_SCROLLBAR_TYPEDEF
42typedef struct _E_Scrollbar E_Scrollbar;
43#endif
44
33typedef enum 45typedef enum
34{ 46{
35 E_DND_NONE, 47 E_DND_NONE,
@@ -112,6 +124,9 @@ struct _E_View
112 struct 124 struct
113 { 125 {
114 int on; 126 int on;
127 /* we set this in all other views of our view_model
128 * when the first icon in a view is selected. */
129 int lock;
115 /* The number of selected icons. */ 130 /* The number of selected icons. */
116 int count; 131 int count;
117 /* The number of icons we selected the last time. 132 /* The number of icons we selected the last time.
@@ -124,7 +139,6 @@ struct _E_View
124 int x, y; 139 int x, y;
125 } 140 }
126 down; 141 down;
127
128 struct 142 struct
129 { 143 {
130 struct 144 struct
@@ -156,7 +170,6 @@ struct _E_View
156 obj; 170 obj;
157 } 171 }
158 select; 172 select;
159
160 struct 173 struct
161 { 174 {
162 int started; 175 int started;
@@ -182,6 +195,7 @@ struct _E_View
182 extents; 195 extents;
183 196
184 E_Background bg; 197 E_Background bg;
198 E_View_Layout *layout;
185 199
186 struct 200 struct
187 { 201 {
@@ -222,7 +236,7 @@ struct _E_View
222void e_view_init(void); 236void e_view_init(void);
223 237
224void e_view_selection_update(E_View * v); 238void e_view_selection_update(E_View * v);
225void e_view_deselect_all(E_View * v); 239void e_view_deselect_all(void);
226void e_view_deselect_all_except(E_Icon * not_ic); 240void e_view_deselect_all_except(E_Icon * not_ic);
227Ecore_Event *e_view_get_current_event(void); 241Ecore_Event *e_view_get_current_event(void);
228int e_view_filter_file(E_View * v, char *file); 242int e_view_filter_file(E_View * v, char *file);
@@ -244,6 +258,7 @@ void e_view_resort(E_View * v);
244void e_view_queue_geometry_record(E_View * v); 258void e_view_queue_geometry_record(E_View * v);
245void e_view_queue_icon_xy_record(E_View * v); 259void e_view_queue_icon_xy_record(E_View * v);
246void e_view_queue_resort(E_View * v); 260void e_view_queue_resort(E_View * v);
261E_View *e_view_find_by_window(Window win);
247 262
248/** 263/**
249 * e_view_new - Creates a new view object 264 * e_view_new - Creates a new view object