summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViktor Kojouharov <vkojouharov@gmail.com>2009-04-28 17:38:09 +0000
committerViktor Kojouharov <vkojouharov@gmail.com>2009-04-28 17:38:09 +0000
commitd9f453e443c57d055be1fae994e7d7924ded014c (patch)
treeb0993738612c548279bae5bd7fd5a1de6e4b4f6d /src
parent5f4f968653bf5792b361c233de8ef2c8298bd3fa (diff)
improvements to the tabbed e_fwin. changing tabs will not cause a reload, since each tab holds its own fm object.
ctrl+w will close the current tab. if there are no more tabs, the window will be closed SVN revision: 40447
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_toolbar.c9
-rw-r--r--src/bin/e_toolbar.h1
-rw-r--r--src/bin/e_widget_toolbar.c17
-rw-r--r--src/bin/e_widget_toolbar.h1
-rw-r--r--src/modules/fileman/e_fwin.c779
5 files changed, 452 insertions, 355 deletions
diff --git a/src/bin/e_toolbar.c b/src/bin/e_toolbar.c
index f369360..0355ceb 100644
--- a/src/bin/e_toolbar.c
+++ b/src/bin/e_toolbar.c
@@ -148,6 +148,15 @@ e_toolbar_show(E_Toolbar *tbar)
148} 148}
149 149
150EAPI void 150EAPI void
151e_toolbar_hide(E_Toolbar *tbar)
152{
153 E_OBJECT_CHECK(tbar);
154 E_OBJECT_TYPE_CHECK(tbar, E_TOOLBAR_TYPE);
155 evas_object_hide(tbar->o_event);
156 evas_object_hide(tbar->o_base);
157}
158
159EAPI void
151e_toolbar_move(E_Toolbar *tbar, int x, int y) 160e_toolbar_move(E_Toolbar *tbar, int x, int y)
152{ 161{
153 E_OBJECT_CHECK(tbar); 162 E_OBJECT_CHECK(tbar);
diff --git a/src/bin/e_toolbar.h b/src/bin/e_toolbar.h
index ac09c71..055d1e5 100644
--- a/src/bin/e_toolbar.h
+++ b/src/bin/e_toolbar.h
@@ -34,6 +34,7 @@ EAPI E_Win *e_toolbar_fwin_get (E_Toolbar *tbar);
34EAPI void e_toolbar_fm2_set (E_Toolbar *tbar, Evas_Object *fm2); 34EAPI void e_toolbar_fm2_set (E_Toolbar *tbar, Evas_Object *fm2);
35EAPI Evas_Object *e_toolbar_fm2_get (E_Toolbar *tbar); 35EAPI Evas_Object *e_toolbar_fm2_get (E_Toolbar *tbar);
36EAPI void e_toolbar_show (E_Toolbar *tbar); 36EAPI void e_toolbar_show (E_Toolbar *tbar);
37EAPI void e_toolbar_hide (E_Toolbar *tbar);
37EAPI void e_toolbar_move (E_Toolbar *tbar, int x, int y); 38EAPI void e_toolbar_move (E_Toolbar *tbar, int x, int y);
38EAPI void e_toolbar_resize (E_Toolbar *tbar, int w, int h); 39EAPI void e_toolbar_resize (E_Toolbar *tbar, int w, int h);
39EAPI void e_toolbar_move_resize (E_Toolbar *tbar, int x, int y, int w, int h); 40EAPI void e_toolbar_move_resize (E_Toolbar *tbar, int x, int y, int w, int h);
diff --git a/src/bin/e_widget_toolbar.c b/src/bin/e_widget_toolbar.c
index f46896a..ac322e6 100644
--- a/src/bin/e_widget_toolbar.c
+++ b/src/bin/e_widget_toolbar.c
@@ -135,6 +135,23 @@ e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *la
135} 135}
136 136
137EAPI void 137EAPI void
138e_widget_toolbar_item_remove(Evas_Object *obj, int num)
139{
140 E_Widget_Data *wd;
141 Item *it;
142
143 wd = e_widget_data_get(obj);
144 it = eina_list_nth(wd->items, num);
145 if (it)
146 {
147 evas_object_del(it->o_base);
148 evas_object_del(it->o_icon);
149 wd->items = eina_list_remove(wd->items, it);
150 free(it);
151 }
152}
153
154EAPI void
138e_widget_toolbar_item_select(Evas_Object *obj, int num) 155e_widget_toolbar_item_select(Evas_Object *obj, int num)
139{ 156{
140 E_Widget_Data *wd; 157 E_Widget_Data *wd;
diff --git a/src/bin/e_widget_toolbar.h b/src/bin/e_widget_toolbar.h
index 0455625..1dfc13d 100644
--- a/src/bin/e_widget_toolbar.h
+++ b/src/bin/e_widget_toolbar.h
@@ -8,6 +8,7 @@
8 8
9EAPI Evas_Object *e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h); 9EAPI Evas_Object *e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h);
10EAPI void e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data1, void *data2), const void *data1, const void *data2); 10EAPI void e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data1, void *data2), const void *data1, const void *data2);
11EAPI void e_widget_toolbar_item_remove(Evas_Object *obj, int num);
11EAPI void e_widget_toolbar_item_select(Evas_Object *obj, int num); 12EAPI void e_widget_toolbar_item_select(Evas_Object *obj, int num);
12EAPI void e_widget_toolbar_item_label_set(Evas_Object *obj, int num, const char *label); 13EAPI void e_widget_toolbar_item_label_set(Evas_Object *obj, int num, const char *label);
13EAPI void e_widget_toolbar_scrollable_set(Evas_Object *obj, Evas_Bool scrollable); 14EAPI void e_widget_toolbar_scrollable_set(Evas_Object *obj, Evas_Bool scrollable);
diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c
index 2e768f1..03f72d6 100644
--- a/src/modules/fileman/e_fwin.c
+++ b/src/modules/fileman/e_fwin.c
@@ -15,7 +15,7 @@
15 */ 15 */
16 16
17typedef struct _E_Fwin E_Fwin; 17typedef struct _E_Fwin E_Fwin;
18typedef struct _E_Fwin_Page_Info E_Fwin_Page_Info; 18typedef struct _E_Fwin_Page E_Fwin_Page;
19typedef struct _E_Fwin_Apps_Dialog E_Fwin_Apps_Dialog; 19typedef struct _E_Fwin_Apps_Dialog E_Fwin_Apps_Dialog;
20 20
21#define E_FWIN_TYPE 0xE0b0101f 21#define E_FWIN_TYPE 0xE0b0101f
@@ -26,42 +26,40 @@ struct _E_Fwin
26 26
27 E_Win *win; 27 E_Win *win;
28 E_Zone *zone; 28 E_Zone *zone;
29 Evas_Object *scrollframe_obj;
30 Evas_Object *tb_obj; 29 Evas_Object *tb_obj;
31 Evas_Object *fm_obj;
32 Evas_Object *bg_obj; 30 Evas_Object *bg_obj;
33 E_Fwin_Apps_Dialog *fad; 31 E_Fwin_Apps_Dialog *fad;
34 32
35 Eina_List *page_info; 33 Eina_List *pages;
36 int page_index; 34 E_Fwin_Page *cur_page;
35 int page_index;
37 36
38 Evas_Object *under_obj; 37 Evas_Object *under_obj;
39 Evas_Object *over_obj; 38 Evas_Object *over_obj;
40 struct {
41 Evas_Coord x, y, max_x, max_y, w, h;
42 } fm_pan, fm_pan_last;
43 39
44 const char *wallpaper_file; 40 const char *wallpaper_file;
45 const char *overlay_file; 41 const char *overlay_file;
46 const char *scrollframe_file; 42 const char *scrollframe_file;
47 const char *theme_file; 43 const char *theme_file;
48 44
49 E_Toolbar *tbar;
50 Ecore_Event_Handler *zone_handler; 45 Ecore_Event_Handler *zone_handler;
51 Ecore_Event_Handler *zone_del_handler; 46 Ecore_Event_Handler *zone_del_handler;
52 Ecore_Event_Handler *fm_op_entry_add_handler;
53 47
54 unsigned char geom_save_ready : 1; 48 unsigned char geom_save_ready : 1;
55}; 49};
56 50
57struct _E_Fwin_Page_Info 51struct _E_Fwin_Page
58{ 52{
59 const char *dev; 53 E_Fwin *fwin;
60 const char *path; 54 Ecore_Event_Handler *fm_op_entry_add_handler;
55
56 Evas_Object *scrollframe_obj;
57 Evas_Object *fm_obj;
58 E_Toolbar *tbar;
61 59
62 struct { 60 struct {
63 Evas_Coord x, y; 61 Evas_Coord x, y, max_x, max_y, w, h;
64 } scroll; 62 } fm_pan, fm_pan_last;
65 63
66 int index; 64 int index;
67}; 65};
@@ -89,15 +87,16 @@ typedef enum
89/* local subsystem prototypes */ 87/* local subsystem prototypes */
90static E_Fwin *_e_fwin_new(E_Container *con, const char *dev, const char *path); 88static E_Fwin *_e_fwin_new(E_Container *con, const char *dev, const char *path);
91static void _e_fwin_free(E_Fwin *fwin); 89static void _e_fwin_free(E_Fwin *fwin);
90static E_Fwin_Page *_e_fwin_page_create(E_Fwin *fwin);
91static void _e_fwin_page_free(E_Fwin_Page *page);
92static void _e_fwin_page_new(E_Fwin *fwin); 92static void _e_fwin_page_new(E_Fwin *fwin);
93static E_Fwin_Page_Info *_e_fwin_page_info_new(E_Fwin *fwin);
94static void _e_fwin_cb_page_change(void *data1, void *data2); 93static void _e_fwin_cb_page_change(void *data1, void *data2);
95static void _e_fwin_cb_delete(E_Win *win); 94static void _e_fwin_cb_delete(E_Win *win);
96static void _e_fwin_cb_move(E_Win *win); 95static void _e_fwin_cb_move(E_Win *win);
97static void _e_fwin_cb_resize(E_Win *win); 96static void _e_fwin_cb_resize(E_Win *win);
98static void _e_fwin_deleted(void *data, Evas_Object *obj, void *event_info); 97static void _e_fwin_deleted(void *data, Evas_Object *obj, void *event_info);
99static const char *_e_fwin_custom_file_path_eval(E_Fwin *fwin, Efreet_Desktop *ef, const char *prev_path, const char *key); 98static const char *_e_fwin_custom_file_path_eval(E_Fwin *fwin, Efreet_Desktop *ef, const char *prev_path, const char *key);
100static void _e_fwin_desktop_run(Efreet_Desktop *desktop, E_Fwin *fwin); 99static void _e_fwin_desktop_run(Efreet_Desktop *desktop, E_Fwin_Page *page);
101static Eina_List *_e_fwin_suggested_apps_list_get(Eina_List *files, Eina_List **mime_list); 100static Eina_List *_e_fwin_suggested_apps_list_get(Eina_List *files, Eina_List **mime_list);
102static void _e_fwin_changed(void *data, Evas_Object *obj, void *event_info); 101static void _e_fwin_changed(void *data, Evas_Object *obj, void *event_info);
103static void _e_fwin_selected(void *data, Evas_Object *obj, void *event_info); 102static void _e_fwin_selected(void *data, Evas_Object *obj, void *event_info);
@@ -117,27 +116,28 @@ static void _e_fwin_cb_close(void *data, E_Dialog *dia);
117static void _e_fwin_cb_dialog_free(void *obj); 116static void _e_fwin_cb_dialog_free(void *obj);
118static Eina_Bool _e_fwin_cb_hash_foreach(const Eina_Hash *hash __UNUSED__, const void *key, void *data __UNUSED__, void *fdata); 117static Eina_Bool _e_fwin_cb_hash_foreach(const Eina_Hash *hash __UNUSED__, const void *key, void *data __UNUSED__, void *fdata);
119static E_Fwin_Exec_Type _e_fwin_file_is_exec(E_Fm2_Icon_Info *ici); 118static E_Fwin_Exec_Type _e_fwin_file_is_exec(E_Fm2_Icon_Info *ici);
120static void _e_fwin_file_exec(E_Fwin *fwin, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext); 119static void _e_fwin_file_exec(E_Fwin_Page *page, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext);
121static void _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always); 120static void _e_fwin_file_open_dialog(E_Fwin_Page *page, Eina_List *files, int always);
122 121
123static void _e_fwin_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y); 122static void _e_fwin_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
124static void _e_fwin_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); 123static void _e_fwin_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
125static void _e_fwin_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); 124static void _e_fwin_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
126static void _e_fwin_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); 125static void _e_fwin_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
127static void _e_fwin_pan_scroll_update(E_Fwin *fwin); 126static void _e_fwin_pan_scroll_update(E_Fwin_Page *page);
128 127
129static void _e_fwin_zone_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); 128static void _e_fwin_zone_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
130static int _e_fwin_zone_move_resize(void *data, int type, void *event); 129static int _e_fwin_zone_move_resize(void *data, int type, void *event);
131static int _e_fwin_zone_del(void *data, int type, void *event); 130static int _e_fwin_zone_del(void *data, int type, void *event);
132static void _e_fwin_config_set(E_Fwin *fwin); 131static void _e_fwin_config_set(E_Fwin_Page *page);
133static void _e_fwin_window_title_set(E_Fwin *fwin); 132static void _e_fwin_window_title_set(E_Fwin_Page *page);
134static void _e_fwin_toolbar_resize(E_Fwin *fwin); 133static void _e_fwin_page_resize(E_Fwin_Page *page);
134static void _e_fwin_toolbar_resize(E_Fwin_Page *page);
135static int _e_fwin_dlg_cb_desk_sort(const void *p1, const void *p2); 135static int _e_fwin_dlg_cb_desk_sort(const void *p1, const void *p2);
136static int _e_fwin_dlg_cb_desk_list_sort(const void *data1, const void *data2); 136static int _e_fwin_dlg_cb_desk_list_sort(const void *data1, const void *data2);
137 137
138static void _e_fwin_op_registry_listener_cb(void *data, const E_Fm2_Op_Registry_Entry *ere); 138static void _e_fwin_op_registry_listener_cb(void *data, const E_Fm2_Op_Registry_Entry *ere);
139static int _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event); 139static int _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event);
140static void _e_fwin_op_registry_entry_iter(E_Fwin *fwin); 140static void _e_fwin_op_registry_entry_iter(E_Fwin_Page *page);
141 141
142/* local subsystem globals */ 142/* local subsystem globals */
143static Eina_List *fwins = NULL; 143static Eina_List *fwins = NULL;
@@ -179,7 +179,7 @@ e_fwin_new(E_Container *con, const char *dev, const char *path)
179 179
180 if (!fwin) return; 180 if (!fwin) return;
181 181
182 snprintf(buf, sizeof(buf), "dir::%s", e_fm2_real_path_get(fwin->fm_obj)); 182 snprintf(buf, sizeof(buf), "dir::%s", e_fm2_real_path_get(fwin->cur_page->fm_obj));
183 cf = e_fm2_custom_file_get(buf); 183 cf = e_fm2_custom_file_get(buf);
184 if ((cf) && (cf->geom.valid)) 184 if ((cf) && (cf->geom.valid))
185 { 185 {
@@ -225,12 +225,16 @@ EAPI void
225e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path) 225e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
226{ 226{
227 E_Fwin *fwin; 227 E_Fwin *fwin;
228 E_Fwin_Page *page;
228 Evas_Object *o; 229 Evas_Object *o;
229 230
230 fwin = E_OBJECT_ALLOC(E_Fwin, E_FWIN_TYPE, _e_fwin_free); 231 fwin = E_OBJECT_ALLOC(E_Fwin, E_FWIN_TYPE, _e_fwin_free);
231 if (!fwin) return; 232 if (!fwin) return;
232 fwin->zone = zone; 233 fwin->zone = zone;
233 234
235 page = E_NEW(E_Fwin_Page, 1);
236 page->fwin = fwin;
237
234 /* Add Event Handler for zone move/resize & del */ 238 /* Add Event Handler for zone move/resize & del */
235 fwin->zone_handler = 239 fwin->zone_handler =
236 ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE, 240 ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,
@@ -247,21 +251,21 @@ e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
247 fwins = eina_list_append(fwins, fwin); 251 fwins = eina_list_append(fwins, fwin);
248 252
249 o = e_fm2_add(zone->container->bg_evas); 253 o = e_fm2_add(zone->container->bg_evas);
250 fwin->fm_obj = o; 254 page->fm_obj = o;
251 _e_fwin_config_set(fwin); 255 _e_fwin_config_set(page);
252 256
253 e_fm2_custom_theme_content_set(o, "desktop"); 257 e_fm2_custom_theme_content_set(o, "desktop");
254 258
255 evas_object_smart_callback_add(o, "dir_changed", 259 evas_object_smart_callback_add(o, "dir_changed",
256 _e_fwin_changed, fwin); 260 _e_fwin_changed, page);
257 evas_object_smart_callback_add(o, "dir_deleted", 261 evas_object_smart_callback_add(o, "dir_deleted",
258 _e_fwin_deleted, fwin); 262 _e_fwin_deleted, page);
259 evas_object_smart_callback_add(o, "selected", 263 evas_object_smart_callback_add(o, "selected",
260 _e_fwin_selected, fwin); 264 _e_fwin_selected, page);
261 evas_object_smart_callback_add(o, "selection_change", 265 evas_object_smart_callback_add(o, "selection_change",
262 _e_fwin_selection_change, fwin); 266 _e_fwin_selection_change, page);
263 e_fm2_icon_menu_start_extend_callback_set(o, _e_fwin_cb_menu_extend_start, fwin); 267 e_fm2_icon_menu_start_extend_callback_set(o, _e_fwin_cb_menu_extend_start, page);
264 e_fm2_icon_menu_end_extend_callback_set(o, _e_fwin_menu_extend, fwin); 268 e_fm2_icon_menu_end_extend_callback_set(o, _e_fwin_menu_extend, page);
265 e_fm2_underlay_hide(o); 269 e_fm2_underlay_hide(o);
266 evas_object_show(o); 270 evas_object_show(o);
267 271
@@ -285,23 +289,26 @@ e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
285 * same as currently done for bg & overlay. also add to fm2 the ability 289 * same as currently done for bg & overlay. also add to fm2 the ability
286 * to specify the .edj files to get the list and icon theme stuff from 290 * to specify the .edj files to get the list and icon theme stuff from
287 */ 291 */
288 evas_object_data_set(fwin->fm_obj, "fwin", fwin); 292 evas_object_data_set(page->fm_obj, "fm_page", page);
289 e_scrollframe_extern_pan_set(o, fwin->fm_obj, 293 e_scrollframe_extern_pan_set(o, page->fm_obj,
290 _e_fwin_pan_set, 294 _e_fwin_pan_set,
291 _e_fwin_pan_get, 295 _e_fwin_pan_get,
292 _e_fwin_pan_max_get, 296 _e_fwin_pan_max_get,
293 _e_fwin_pan_child_size_get); 297 _e_fwin_pan_child_size_get);
294 evas_object_propagate_events_set(fwin->fm_obj, 0); 298 evas_object_propagate_events_set(page->fm_obj, 0);
295 fwin->scrollframe_obj = o; 299 page->scrollframe_obj = o;
296 evas_object_move(o, fwin->zone->x, fwin->zone->y); 300 evas_object_move(o, fwin->zone->x, fwin->zone->y);
297 evas_object_resize(o, fwin->zone->w, fwin->zone->h); 301 evas_object_resize(o, fwin->zone->w, fwin->zone->h);
298 evas_object_show(o); 302 evas_object_show(o);
299 303
300 e_fm2_window_object_set(fwin->fm_obj, E_OBJECT(fwin->zone)); 304 e_fm2_window_object_set(page->fm_obj, E_OBJECT(fwin->zone));
305
306 evas_object_focus_set(page->fm_obj, 1);
301 307
302 evas_object_focus_set(fwin->fm_obj, 1); 308 e_fm2_path_set(page->fm_obj, dev, path);
303 309
304 e_fm2_path_set(fwin->fm_obj, dev, path); 310 fwin->pages = eina_list_append(fwin->pages, page);
311 fwin->cur_page = fwin->pages->data;
305} 312}
306 313
307EAPI void 314EAPI void
@@ -312,7 +319,7 @@ e_fwin_all_unsel(void *data)
312 fwin = data; 319 fwin = data;
313 E_OBJECT_CHECK(fwin); 320 E_OBJECT_CHECK(fwin);
314 E_OBJECT_TYPE_CHECK(fwin, E_FWIN_TYPE); 321 E_OBJECT_TYPE_CHECK(fwin, E_FWIN_TYPE);
315 e_fm2_all_unsel(fwin->fm_obj); 322 e_fm2_all_unsel(fwin->cur_page->fm_obj);
316} 323}
317 324
318EAPI void 325EAPI void
@@ -346,9 +353,15 @@ e_fwin_reload_all(void)
346 e_fwin_zone_shutdown(fwin->zone); 353 e_fwin_zone_shutdown(fwin->zone);
347 else 354 else
348 { 355 {
349 _e_fwin_config_set(fwin); 356 Eina_List *l2;
350 e_fm2_refresh(fwin->fm_obj); 357 E_Fwin_Page *page;
351 _e_fwin_window_title_set(fwin); 358
359 EINA_LIST_FOREACH(fwin->pages, l2, page)
360 {
361 _e_fwin_config_set(page);
362 e_fm2_refresh(page->fm_obj);
363 _e_fwin_window_title_set(page);
364 }
352 } 365 }
353 } 366 }
354 367
@@ -392,6 +405,7 @@ static E_Fwin *
392_e_fwin_new(E_Container *con, const char *dev, const char *path) 405_e_fwin_new(E_Container *con, const char *dev, const char *path)
393{ 406{
394 E_Fwin *fwin; 407 E_Fwin *fwin;
408 E_Fwin_Page *page;
395 Evas_Object *o; 409 Evas_Object *o;
396 410
397 fwin = E_OBJECT_ALLOC(E_Fwin, E_FWIN_TYPE, _e_fwin_free); 411 fwin = E_OBJECT_ALLOC(E_Fwin, E_FWIN_TYPE, _e_fwin_free);
@@ -414,59 +428,9 @@ _e_fwin_new(E_Container *con, const char *dev, const char *path)
414 evas_object_show(o); 428 evas_object_show(o);
415 fwin->bg_obj = o; 429 fwin->bg_obj = o;
416 430
417 o = e_fm2_add(e_win_evas_get(fwin->win)); 431 page = _e_fwin_page_create(fwin);
418 fwin->fm_obj = o; 432 fwin->pages = eina_list_append(fwin->pages, page);
419 _e_fwin_config_set(fwin); 433 fwin->cur_page = page;
420 e_fm2_view_flags_set(o, E_FM2_VIEW_DIR_CUSTOM);
421 evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_fwin_cb_key_down, fwin);
422
423 evas_object_smart_callback_add(o, "dir_changed",
424 _e_fwin_changed, fwin);
425 evas_object_smart_callback_add(o, "dir_deleted",
426 _e_fwin_deleted, fwin);
427 evas_object_smart_callback_add(o, "selected",
428 _e_fwin_selected, fwin);
429 evas_object_smart_callback_add(o, "selection_change",
430 _e_fwin_selection_change, fwin);
431 e_fm2_icon_menu_start_extend_callback_set(o, _e_fwin_cb_menu_extend_start, fwin);
432 e_fm2_icon_menu_end_extend_callback_set(o, _e_fwin_menu_extend, fwin);
433 evas_object_show(o);
434
435 o = e_scrollframe_add(e_win_evas_get(fwin->win));
436 /* FIXME: this theme object will have more versions and options later
437 * for things like swallowing widgets/buttons ot providing them - a
438 * gadcon for starters for fm widgets. need to register the owning
439 * e_object of the gadcon so gadcon clients can get it and thus do
440 * things like find out what dirs/path the fwin is for etc. this will
441 * probably be how you add optional gadgets to fwin views like empty/full
442 * meters for disk usage, and other dir info/stats or controls. also it
443 * might be possible that we can have custom frames per dir later so need
444 * a way to set an edje file directly
445 */
446 /* FIXME: allow specialised scrollframe obj per dir - get from e config,
447 * then look in the dir itself for a magic dot-file, if not - use theme.
448 * same as currently done for bg & overlay. also add to fm2 the ability
449 * to specify the .edj files to get the list and icon theme stuff from
450 */
451 e_scrollframe_custom_theme_set(o, "base/theme/fileman",
452 "e/fileman/default/scrollframe");
453 evas_object_data_set(fwin->fm_obj, "fwin", fwin);
454 e_scrollframe_extern_pan_set(o, fwin->fm_obj,
455 _e_fwin_pan_set,
456 _e_fwin_pan_get,
457 _e_fwin_pan_max_get,
458 _e_fwin_pan_child_size_get);
459 evas_object_propagate_events_set(fwin->fm_obj, 0);
460 fwin->scrollframe_obj = o;
461 evas_object_move(o, 0, 0);
462 evas_object_show(o);
463
464 if (fileman_config->view.show_toolbar)
465 {
466 fwin->tbar = e_toolbar_new(e_win_evas_get(fwin->win), "toolbar",
467 fwin->win, fwin->fm_obj);
468 e_toolbar_show(fwin->tbar);
469 }
470 434
471 o = edje_object_add(e_win_evas_get(fwin->win)); 435 o = edje_object_add(e_win_evas_get(fwin->win));
472 edje_object_part_swallow(fwin->bg_obj, "e.swallow.bg", o); 436 edje_object_part_swallow(fwin->bg_obj, "e.swallow.bg", o);
@@ -474,19 +438,14 @@ _e_fwin_new(E_Container *con, const char *dev, const char *path)
474 fwin->under_obj = o; 438 fwin->under_obj = o;
475 439
476 o = edje_object_add(e_win_evas_get(fwin->win)); 440 o = edje_object_add(e_win_evas_get(fwin->win));
477 edje_object_part_swallow(e_scrollframe_edje_object_get(fwin->scrollframe_obj), "e.swallow.overlay", o); 441 edje_object_part_swallow(e_scrollframe_edje_object_get(page->scrollframe_obj), "e.swallow.overlay", o);
478 evas_object_pass_events_set(o, 1); 442 evas_object_pass_events_set(o, 1);
479 fwin->over_obj = o; 443 fwin->over_obj = o;
480 444
481 e_fm2_window_object_set(fwin->fm_obj, E_OBJECT(fwin->win));
482
483 evas_object_focus_set(fwin->fm_obj, 1);
484
485 e_fm2_path_set(fwin->fm_obj, dev, path);
486
487 e_win_name_class_set(fwin->win, "E", "e_fwin"); 445 e_win_name_class_set(fwin->win, "E", "e_fwin");
488 446
489 _e_fwin_window_title_set(fwin); 447 e_fm2_path_set(page->fm_obj, dev, path);
448 _e_fwin_window_title_set(page);
490 449
491 e_win_size_min_set(fwin->win, 24, 24); 450 e_win_size_min_set(fwin->win, 24, 24);
492 e_win_resize(fwin->win, 280 * e_scale, 200 * e_scale); 451 e_win_resize(fwin->win, 280 * e_scale, 200 * e_scale);
@@ -501,24 +460,20 @@ _e_fwin_new(E_Container *con, const char *dev, const char *path)
501 eina_stringshare_add("system-file-manager"); 460 eina_stringshare_add("system-file-manager");
502 } 461 }
503 462
504 fwin->fm_op_entry_add_handler =
505 ecore_event_handler_add(E_EVENT_FM_OP_REGISTRY_ADD,
506 _e_fwin_op_registry_entry_add_cb, fwin);
507 _e_fwin_op_registry_entry_iter(fwin);
508
509 return fwin; 463 return fwin;
510} 464}
511 465
512static void 466static void
513_e_fwin_free(E_Fwin *fwin) 467_e_fwin_free(E_Fwin *fwin)
514{ 468{
515 E_Fwin_Page_Info *info; 469 E_Fwin_Page *page;
470
516 471
517 if (!fwin) return; //safety 472 if (!fwin) return; //safety
518 473
519 if (fwin->fm_obj) evas_object_del(fwin->fm_obj); 474 EINA_LIST_FREE(fwin->pages, page)
520 if (fwin->tbar) e_object_del(E_OBJECT(fwin->tbar)); 475 _e_fwin_page_free(page);
521 if (fwin->scrollframe_obj) evas_object_del(fwin->scrollframe_obj); 476
522 if (fwin->zone) 477 if (fwin->zone)
523 { 478 {
524 evas_object_event_callback_del(fwin->zone->bg_event_object, 479 evas_object_event_callback_del(fwin->zone->bg_event_object,
@@ -527,20 +482,11 @@ _e_fwin_free(E_Fwin *fwin)
527 } 482 }
528 483
529 484
530 EINA_LIST_FREE(fwin->page_info, info)
531 {
532 eina_stringshare_del(info->dev);
533 eina_stringshare_del(info->path);
534 E_FREE(info);
535 }
536 if (fwin->zone_handler) 485 if (fwin->zone_handler)
537 ecore_event_handler_del(fwin->zone_handler); 486 ecore_event_handler_del(fwin->zone_handler);
538 if (fwin->zone_del_handler) 487 if (fwin->zone_del_handler)
539 ecore_event_handler_del(fwin->zone_del_handler); 488 ecore_event_handler_del(fwin->zone_del_handler);
540 489
541 if (fwin->fm_op_entry_add_handler)
542 ecore_event_handler_del(fwin->fm_op_entry_add_handler);
543
544 fwins = eina_list_remove(fwins, fwin); 490 fwins = eina_list_remove(fwins, fwin);
545 if (fwin->wallpaper_file) eina_stringshare_del(fwin->wallpaper_file); 491 if (fwin->wallpaper_file) eina_stringshare_del(fwin->wallpaper_file);
546 if (fwin->overlay_file) eina_stringshare_del(fwin->overlay_file); 492 if (fwin->overlay_file) eina_stringshare_del(fwin->overlay_file);
@@ -555,6 +501,154 @@ _e_fwin_free(E_Fwin *fwin)
555 free(fwin); 501 free(fwin);
556} 502}
557 503
504static E_Fwin_Page *
505_e_fwin_page_create(E_Fwin *fwin)
506{
507 Evas_Object *o;
508 E_Fwin_Page *page;
509
510 page = E_NEW(E_Fwin_Page, 1);
511 page->fwin = fwin;
512
513 o = e_fm2_add(e_win_evas_get(fwin->win));
514 page->fm_obj = o;
515 e_fm2_view_flags_set(o, E_FM2_VIEW_DIR_CUSTOM);
516 evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_fwin_cb_key_down, page);
517
518 evas_object_smart_callback_add(o, "dir_changed",
519 _e_fwin_changed, page);
520 evas_object_smart_callback_add(o, "dir_deleted",
521 _e_fwin_deleted, page);
522 evas_object_smart_callback_add(o, "selected",
523 _e_fwin_selected, page);
524 evas_object_smart_callback_add(o, "selection_change",
525 _e_fwin_selection_change, page);
526 e_fm2_icon_menu_start_extend_callback_set(o, _e_fwin_cb_menu_extend_start, page);
527 e_fm2_icon_menu_end_extend_callback_set(o, _e_fwin_menu_extend, page);
528 e_fm2_window_object_set(o, E_OBJECT(fwin->win));
529 evas_object_focus_set(o, 1);
530
531 evas_object_show(o);
532
533 o = e_scrollframe_add(e_win_evas_get(fwin->win));
534 /* FIXME: this theme object will have more versions and options later
535 * for things like swallowing widgets/buttons ot providing them - a
536 * gadcon for starters for fm widgets. need to register the owning
537 * e_object of the gadcon so gadcon clients can get it and thus do
538 * things like find out what dirs/path the fwin is for etc. this will
539 * probably be how you add optional gadgets to fwin views like empty/full
540 * meters for disk usage, and other dir info/stats or controls. also it
541 * might be possible that we can have custom frames per dir later so need
542 * a way to set an edje file directly
543 */
544 /* FIXME: allow specialised scrollframe obj per dir - get from e config,
545 * then look in the dir itself for a magic dot-file, if not - use theme.
546 * same as currently done for bg & overlay. also add to fm2 the ability
547 * to specify the .edj files to get the list and icon theme stuff from
548 */
549 e_scrollframe_custom_theme_set(o, "base/theme/fileman",
550 "e/fileman/default/scrollframe");
551 evas_object_data_set(page->fm_obj, "fm_page", page);
552 e_scrollframe_extern_pan_set(o, page->fm_obj,
553 _e_fwin_pan_set,
554 _e_fwin_pan_get,
555 _e_fwin_pan_max_get,
556 _e_fwin_pan_child_size_get);
557 evas_object_propagate_events_set(page->fm_obj, 0);
558 page->scrollframe_obj = o;
559 evas_object_move(o, 0, 0);
560 evas_object_show(o);
561
562 if (fileman_config->view.show_toolbar)
563 {
564 page->tbar = e_toolbar_new(e_win_evas_get(fwin->win), "toolbar",
565 fwin->win, page->fm_obj);
566 e_toolbar_show(page->tbar);
567 }
568
569 page->index = eina_list_count(fwin->pages);
570
571 _e_fwin_config_set(page);
572
573 page->fm_op_entry_add_handler =
574 ecore_event_handler_add(E_EVENT_FM_OP_REGISTRY_ADD,
575 _e_fwin_op_registry_entry_add_cb, page);
576 _e_fwin_op_registry_entry_iter(page);
577 return page;
578}
579
580static void
581_e_fwin_page_free(E_Fwin_Page *page)
582{
583 if (page->fm_obj) evas_object_del(page->fm_obj);
584 if (page->tbar) e_object_del(E_OBJECT(page->tbar));
585 if (page->scrollframe_obj) evas_object_del(page->scrollframe_obj);
586
587 if (page->fm_op_entry_add_handler)
588 ecore_event_handler_del(page->fm_op_entry_add_handler);
589
590 E_FREE(page);
591}
592
593static void
594_e_fwin_page_new(E_Fwin *fwin)
595{
596 E_Fwin_Page *page;
597 const char *real;
598 const char *dev, *path;
599
600 if (!fwin->tb_obj)
601 {
602 page = fwin->pages->data;
603
604 /* There is no toolbar yet */
605 fwin->tb_obj = e_widget_toolbar_add(evas_object_evas_get(page->fm_obj),
606 48 * e_scale, 48 * e_scale);
607
608 e_widget_toolbar_focus_steal_set(fwin->tb_obj, 0);
609 real = ecore_file_file_get(e_fm2_real_path_get(page->fm_obj));
610 e_widget_toolbar_item_append(fwin->tb_obj, NULL, real,
611 _e_fwin_cb_page_change, fwin, page);
612
613 evas_object_move(fwin->tb_obj, 0, 0);
614 evas_object_show(fwin->tb_obj);
615 }
616
617 page = _e_fwin_page_create(fwin);
618 fwin->pages = eina_list_append(fwin->pages, page);
619 real = ecore_file_file_get(e_fm2_real_path_get(fwin->cur_page->fm_obj));
620 e_widget_toolbar_item_append(fwin->tb_obj, NULL, real,
621 _e_fwin_cb_page_change, fwin, page);
622 e_fm2_path_get(fwin->cur_page->fm_obj, &dev, &path);
623 e_fm2_path_set(page->fm_obj, dev, path);
624
625 e_widget_toolbar_item_select(fwin->tb_obj, page->index);
626 _e_fwin_cb_resize(fwin->win);
627}
628
629static void
630_e_fwin_cb_page_change(void *data1, void *data2)
631{
632 E_Fwin *fwin = data1;
633 E_Fwin_Page *page = data2, *prev;
634
635 if (!fwin || !page) return;
636 prev = eina_list_nth(fwin->pages, fwin->page_index);
637 fwin->page_index = page->index;
638
639 if (prev)
640 {
641 evas_object_hide(prev->scrollframe_obj);
642 e_toolbar_hide(prev->tbar);
643 }
644
645 evas_object_show(page->scrollframe_obj);
646 e_toolbar_show(page->tbar);
647
648 fwin->cur_page = page;
649 evas_object_focus_set(page->fm_obj, 1);
650}
651
558static const char * 652static const char *
559_e_fwin_custom_file_path_eval(E_Fwin *fwin, Efreet_Desktop *ef, const char *prev_path, const char *key) 653_e_fwin_custom_file_path_eval(E_Fwin *fwin, Efreet_Desktop *ef, const char *prev_path, const char *key)
560{ 654{
@@ -574,7 +668,7 @@ _e_fwin_custom_file_path_eval(E_Fwin *fwin, Efreet_Desktop *ef, const char *prev
574 /* relative path to the dir */ 668 /* relative path to the dir */
575 else 669 else
576 { 670 {
577 snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->fm_obj), res); 671 snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->cur_page->fm_obj), res);
578 ret = eina_stringshare_add(buf); 672 ret = eina_stringshare_add(buf);
579 } 673 }
580 return ret; 674 return ret;
@@ -631,18 +725,19 @@ _e_fwin_suggested_apps_list_get(Eina_List *files, Eina_List **mime_list)
631 725
632 726
633static void 727static void
634_e_fwin_desktop_run(Efreet_Desktop *desktop, E_Fwin *fwin) 728_e_fwin_desktop_run(Efreet_Desktop *desktop, E_Fwin_Page *page)
635{ 729{
636 char pcwd[4096], buf[4096]; 730 char pcwd[4096], buf[4096];
637 Eina_List *selected, *l, *files = NULL; 731 Eina_List *selected, *l, *files = NULL;
732 E_Fwin *fwin = page->fwin;
638 E_Fm2_Icon_Info *ici; 733 E_Fm2_Icon_Info *ici;
639 char *file; 734 char *file;
640 735
641 selected = e_fm2_selected_list_get(fwin->fm_obj); 736 selected = e_fm2_selected_list_get(page->fm_obj);
642 if (!selected) return; 737 if (!selected) return;
643 738
644 getcwd(pcwd, sizeof(pcwd)); 739 getcwd(pcwd, sizeof(pcwd));
645 chdir(e_fm2_real_path_get(fwin->fm_obj)); 740 chdir(e_fm2_real_path_get(page->fm_obj));
646 741
647 EINA_LIST_FOREACH(selected, l, ici) 742 EINA_LIST_FOREACH(selected, l, ici)
648 { 743 {
@@ -660,7 +755,7 @@ _e_fwin_desktop_run(Efreet_Desktop *desktop, E_Fwin *fwin)
660 ecore_strlcpy(buf, ici->file, sizeof(buf)); 755 ecore_strlcpy(buf, ici->file, sizeof(buf));
661 } 756 }
662 else 757 else
663 _e_fwin_file_exec(fwin, ici, ext); 758 _e_fwin_file_exec(page, ici, ext);
664 if (buf[0] != 0) 759 if (buf[0] != 0)
665 { 760 {
666 if (ici->mime && desktop) 761 if (ici->mime && desktop)
@@ -759,8 +854,9 @@ _e_fwin_file_is_exec(E_Fm2_Icon_Info *ici)
759} 854}
760 855
761static void 856static void
762_e_fwin_file_exec(E_Fwin *fwin, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext) 857_e_fwin_file_exec(E_Fwin_Page *page, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext)
763{ 858{
859 E_Fwin *fwin = page->fwin;
764 char buf[4096]; 860 char buf[4096];
765 Efreet_Desktop *desktop; 861 Efreet_Desktop *desktop;
766 862
@@ -798,7 +894,7 @@ _e_fwin_file_exec(E_Fwin *fwin, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext)
798 e_exec(fwin->zone, NULL, buf, NULL, NULL); 894 e_exec(fwin->zone, NULL, buf, NULL, NULL);
799 break; 895 break;
800 case E_FWIN_EXEC_DESKTOP: 896 case E_FWIN_EXEC_DESKTOP:
801 snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->fm_obj), ici->file); 897 snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(page->fm_obj), ici->file);
802 desktop = efreet_desktop_new(buf); 898 desktop = efreet_desktop_new(buf);
803 if (desktop) 899 if (desktop)
804 { 900 {
@@ -815,12 +911,12 @@ _e_fwin_file_exec(E_Fwin *fwin, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext)
815} 911}
816 912
817static void 913static void
818_e_fwin_config_set(E_Fwin *fwin) 914_e_fwin_config_set(E_Fwin_Page *page)
819{ 915{
820 E_Fm2_Config fmc; 916 E_Fm2_Config fmc;
821 917
822 memset(&fmc, 0, sizeof(E_Fm2_Config)); 918 memset(&fmc, 0, sizeof(E_Fm2_Config));
823 if (!fwin->zone) 919 if (!page->fwin->zone)
824 { 920 {
825#if 0 921#if 0
826 fmc.view.mode = E_FM2_VIEW_MODE_LIST; 922 fmc.view.mode = E_FM2_VIEW_MODE_LIST;
@@ -866,41 +962,57 @@ _e_fwin_config_set(E_Fwin *fwin)
866 fmc.list.sort.dirs.last = fileman_config->list.sort.dirs.last; 962 fmc.list.sort.dirs.last = fileman_config->list.sort.dirs.last;
867 fmc.selection.single = fileman_config->selection.single; 963 fmc.selection.single = fileman_config->selection.single;
868 fmc.selection.windows_modifiers = fileman_config->selection.windows_modifiers; 964 fmc.selection.windows_modifiers = fileman_config->selection.windows_modifiers;
869 e_fm2_config_set(fwin->fm_obj, &fmc); 965 e_fm2_config_set(page->fm_obj, &fmc);
870} 966}
871 967
872static void 968static void
873_e_fwin_window_title_set(E_Fwin *fwin) 969_e_fwin_window_title_set(E_Fwin_Page *page)
874{ 970{
875 char buf[4096]; 971 char buf[4096];
876 const char *file; 972 const char *file;
877 973
878 if (!fwin) return; 974 if (!page) return;
879 if (fwin->zone) return; //safety 975 if (page->fwin->zone) return; //safety
880 976
881 if (fileman_config->view.show_full_path) 977 if (fileman_config->view.show_full_path)
882 file = e_fm2_real_path_get(fwin->fm_obj); 978 file = e_fm2_real_path_get(page->fm_obj);
883 else 979 else
884 file = ecore_file_file_get(e_fm2_real_path_get(fwin->fm_obj)); 980 file = ecore_file_file_get(e_fm2_real_path_get(page->fm_obj));
885 981
886 if (file) 982 if (file)
887 { 983 {
888 ecore_strlcpy(buf, file, sizeof(buf)); 984 ecore_strlcpy(buf, file, sizeof(buf));
889 e_win_title_set(fwin->win, buf); 985 e_win_title_set(page->fwin->win, buf);
986 }
987}
988
989static void
990_e_fwin_page_resize(E_Fwin_Page *page)
991{
992 if (page->tbar)
993 _e_fwin_toolbar_resize(page);
994 else
995 {
996 int offset = 0;
997
998 if (page->fwin->tb_obj)
999 evas_object_geometry_get(page->fwin->tb_obj, NULL, NULL, NULL, &offset);
1000 evas_object_move(page->scrollframe_obj, 0, offset);
1001 evas_object_resize(page->scrollframe_obj, page->fwin->win->w, page->fwin->win->h - offset);
890 } 1002 }
891} 1003}
892 1004
893static void 1005static void
894_e_fwin_toolbar_resize(E_Fwin *fwin) 1006_e_fwin_toolbar_resize(E_Fwin_Page *page)
895{ 1007{
896 int tx, ty, tw, th, offset = 0; 1008 int tx, ty, tw, th, offset = 0;
897 int x, y, w, h; 1009 int x, y, w, h;
898 1010
899 if (fwin->tb_obj) 1011 if (page->fwin->tb_obj)
900 evas_object_geometry_get(fwin->tb_obj, NULL, NULL, NULL, &offset); 1012 evas_object_geometry_get(page->fwin->tb_obj, NULL, NULL, NULL, &offset);
901 w = fwin->win->w; 1013 w = page->fwin->win->w;
902 h = fwin->win->h; 1014 h = page->fwin->win->h;
903 switch (fwin->tbar->gadcon->orient) 1015 switch (page->tbar->gadcon->orient)
904 { 1016 {
905 case E_GADCON_ORIENT_HORIZ: 1017 case E_GADCON_ORIENT_HORIZ:
906 case E_GADCON_ORIENT_TOP: 1018 case E_GADCON_ORIENT_TOP:
@@ -947,79 +1059,14 @@ _e_fwin_toolbar_resize(E_Fwin *fwin)
947 default: 1059 default:
948 return; 1060 return;
949 } 1061 }
950 e_toolbar_move_resize(fwin->tbar, tx, ty, tw, th); 1062 e_toolbar_move_resize(page->tbar, tx, ty, tw, th);
951 evas_object_move(fwin->scrollframe_obj, x, y); 1063 evas_object_move(page->scrollframe_obj, x, y);
952 evas_object_resize(fwin->scrollframe_obj, w, h); 1064 evas_object_resize(page->scrollframe_obj, w, h);
953} 1065}
954 1066
955 1067
956/* fwin callbacks */ 1068/* fwin callbacks */
957static void 1069static void
958_e_fwin_page_new(E_Fwin *fwin)
959{
960 E_Fwin_Page_Info *info;
961 const char *real;
962
963 if (!fwin->tb_obj)
964 {
965 /* There is no toolbar yet */
966 fwin->tb_obj = e_widget_toolbar_add(evas_object_evas_get(fwin->fm_obj),
967 48 * e_scale, 48 * e_scale);
968
969 e_widget_toolbar_focus_steal_set(fwin->tb_obj, 0);
970 info = _e_fwin_page_info_new(fwin);
971 real = ecore_file_file_get(e_fm2_real_path_get(fwin->fm_obj));
972 e_widget_toolbar_item_append(fwin->tb_obj, NULL, real,
973 _e_fwin_cb_page_change, fwin, info);
974
975 evas_object_move(fwin->tb_obj, 0, 0);
976 evas_object_show(fwin->tb_obj);
977 }
978
979 info = _e_fwin_page_info_new(fwin);
980 real = ecore_file_file_get(e_fm2_real_path_get(fwin->fm_obj));
981 e_widget_toolbar_item_append(fwin->tb_obj, NULL, real,
982 _e_fwin_cb_page_change, fwin, info);
983 e_widget_toolbar_item_select(fwin->tb_obj, info->index);
984
985 _e_fwin_cb_resize(fwin->win);
986}
987
988static E_Fwin_Page_Info *
989_e_fwin_page_info_new(E_Fwin *fwin)
990{
991 E_Fwin_Page_Info *info;
992 const char *dev, *path;
993
994 e_fm2_path_get(fwin->fm_obj, &dev, &path);
995 info = E_NEW(E_Fwin_Page_Info, 1);
996 info->dev = eina_stringshare_add(dev);
997 info->path = eina_stringshare_add(path);
998 info->index = eina_list_count(fwin->page_info);
999
1000 fwin->page_info = eina_list_append(fwin->page_info, info);
1001
1002 return info;
1003}
1004
1005static void
1006_e_fwin_cb_page_change(void *data1, void *data2)
1007{
1008 E_Fwin *fwin = data1;
1009 E_Fwin_Page_Info *info = data2, *prev;
1010 Evas_Coord x, y;
1011
1012 if (!fwin || !info) return;
1013 prev = eina_list_nth(fwin->page_info, fwin->page_index);
1014 e_scrollframe_child_pos_get(fwin->scrollframe_obj, &x, &y);
1015 prev->scroll.x = x;
1016 prev->scroll.y = y;
1017 fwin->page_index = info->index;
1018 e_fm2_path_set(fwin->fm_obj, info->dev, info->path);
1019 e_scrollframe_child_pos_set(fwin->scrollframe_obj, x, y);
1020}
1021
1022static void
1023_e_fwin_cb_delete(E_Win *win) 1070_e_fwin_cb_delete(E_Win *win)
1024{ 1071{
1025 E_Fwin *fwin; 1072 E_Fwin *fwin;
@@ -1036,7 +1083,7 @@ _e_fwin_geom_save(E_Fwin *fwin)
1036 E_Fm2_Custom_File *cf; 1083 E_Fm2_Custom_File *cf;
1037 1084
1038 if (!fwin->geom_save_ready) return; 1085 if (!fwin->geom_save_ready) return;
1039 snprintf(buf, sizeof(buf), "dir::%s", e_fm2_real_path_get(fwin->fm_obj)); 1086 snprintf(buf, sizeof(buf), "dir::%s", e_fm2_real_path_get(fwin->cur_page->fm_obj));
1040 cf = e_fm2_custom_file_get(buf); 1087 cf = e_fm2_custom_file_get(buf);
1041 if (!cf) 1088 if (!cf)
1042 { 1089 {
@@ -1077,6 +1124,9 @@ _e_fwin_cb_resize(E_Win *win)
1077 } 1124 }
1078 if (fwin->win) 1125 if (fwin->win)
1079 { 1126 {
1127 E_Fwin_Page *page;
1128 Eina_List *l;
1129
1080 if (fwin->tb_obj) 1130 if (fwin->tb_obj)
1081 { 1131 {
1082 int height; 1132 int height;
@@ -1084,46 +1134,39 @@ _e_fwin_cb_resize(E_Win *win)
1084 e_widget_min_size_get(fwin->tb_obj, NULL, &height); 1134 e_widget_min_size_get(fwin->tb_obj, NULL, &height);
1085 evas_object_resize(fwin->tb_obj, fwin->win->w, height); 1135 evas_object_resize(fwin->tb_obj, fwin->win->w, height);
1086 } 1136 }
1087 if (fwin->tbar) 1137 EINA_LIST_FOREACH(fwin->pages, l, page)
1088 _e_fwin_toolbar_resize(fwin); 1138 _e_fwin_page_resize(page);
1089 else
1090 {
1091 int offset = 0;
1092
1093 if (fwin->tb_obj)
1094 evas_object_geometry_get(fwin->tb_obj, NULL, NULL, NULL, &offset);
1095 evas_object_move(fwin->scrollframe_obj, 0, offset);
1096 evas_object_resize(fwin->scrollframe_obj, fwin->win->w, fwin->win->h - offset);
1097 }
1098 } 1139 }
1099 else if (fwin->zone) 1140 else if (fwin->zone)
1100 evas_object_resize(fwin->scrollframe_obj, fwin->zone->w, fwin->zone->h); 1141 evas_object_resize(fwin->cur_page->scrollframe_obj, fwin->zone->w, fwin->zone->h);
1101 _e_fwin_geom_save(fwin); 1142 _e_fwin_geom_save(fwin);
1102} 1143}
1103 1144
1104static void 1145static void
1105_e_fwin_deleted(void *data, Evas_Object *obj, void *event_info) 1146_e_fwin_deleted(void *data, Evas_Object *obj, void *event_info)
1106{ 1147{
1107 E_Fwin *fwin; 1148 E_Fwin_Page *page;
1108 1149
1109 fwin = data; 1150 page = data;
1110 e_object_del(E_OBJECT(fwin)); 1151 e_object_del(E_OBJECT(page->fwin));
1111} 1152}
1112 1153
1113static void 1154static void
1114_e_fwin_changed(void *data, Evas_Object *obj, void *event_info) 1155_e_fwin_changed(void *data, Evas_Object *obj, void *event_info)
1115{ 1156{
1116 E_Fwin *fwin; 1157 E_Fwin *fwin;
1158 E_Fwin_Page *page;
1117 Efreet_Desktop *ef; 1159 Efreet_Desktop *ef;
1118 char buf[PATH_MAX]; 1160 char buf[PATH_MAX];
1119 1161
1120 fwin = data; 1162 page = data;
1163 fwin = page->fwin;
1121 if (!fwin) return; //safety 1164 if (!fwin) return; //safety
1122 1165
1123 /* FIXME: first look in E config for a special override for this dir's bg 1166 /* FIXME: first look in E config for a special override for this dir's bg
1124 * or overlay 1167 * or overlay
1125 */ 1168 */
1126 snprintf(buf, sizeof(buf), "%s/.directory.desktop", e_fm2_real_path_get(fwin->fm_obj)); 1169 snprintf(buf, sizeof(buf), "%s/.directory.desktop", e_fm2_real_path_get(page->fm_obj));
1127 ef = efreet_desktop_new(buf); 1170 ef = efreet_desktop_new(buf);
1128 if (ef) 1171 if (ef)
1129 { 1172 {
@@ -1151,39 +1194,31 @@ _e_fwin_changed(void *data, Evas_Object *obj, void *event_info)
1151 edje_object_file_set(fwin->over_obj, fwin->overlay_file, "e/desktop/background"); 1194 edje_object_file_set(fwin->over_obj, fwin->overlay_file, "e/desktop/background");
1152 evas_object_show(fwin->over_obj); 1195 evas_object_show(fwin->over_obj);
1153 } 1196 }
1154 if (fwin->scrollframe_obj) 1197 if (page->scrollframe_obj)
1155 { 1198 {
1156 if ((fwin->scrollframe_file) && 1199 if ((fwin->scrollframe_file) &&
1157 (e_util_edje_collection_exists(fwin->scrollframe_file, "e/fileman/default/scrollframe"))) 1200 (e_util_edje_collection_exists(fwin->scrollframe_file, "e/fileman/default/scrollframe")))
1158 e_scrollframe_custom_edje_file_set(fwin->scrollframe_obj, 1201 e_scrollframe_custom_edje_file_set(page->scrollframe_obj,
1159 (char *)fwin->scrollframe_file, 1202 (char *)fwin->scrollframe_file,
1160 "e/fileman/default/scrollframe"); 1203 "e/fileman/default/scrollframe");
1161 else 1204 else
1162 { 1205 {
1163 if (fwin->zone) 1206 if (fwin->zone)
1164 e_scrollframe_custom_theme_set(fwin->scrollframe_obj, 1207 e_scrollframe_custom_theme_set(page->scrollframe_obj,
1165 "base/theme/fileman", 1208 "base/theme/fileman",
1166 "e/fileman/desktop/scrollframe"); 1209 "e/fileman/desktop/scrollframe");
1167 else 1210 else
1168 e_scrollframe_custom_theme_set(fwin->scrollframe_obj, 1211 e_scrollframe_custom_theme_set(page->scrollframe_obj,
1169 "base/theme/fileman", 1212 "base/theme/fileman",
1170 "e/fileman/default/scrollframe"); 1213 "e/fileman/default/scrollframe");
1171 } 1214 }
1172 e_scrollframe_child_pos_set(fwin->scrollframe_obj, 0, 0); 1215 e_scrollframe_child_pos_set(page->scrollframe_obj, 0, 0);
1173 } 1216 }
1174 if (fwin->tb_obj) 1217 if (fwin->tb_obj)
1175 { 1218 {
1176 E_Fwin_Page_Info *info; 1219 const char *file;
1177 const char *file, *dev, *path;
1178
1179 e_fm2_path_get(fwin->fm_obj, &dev, &path);
1180 info = eina_list_nth(fwin->page_info, fwin->page_index);
1181 eina_stringshare_del(info->dev);
1182 eina_stringshare_del(info->path);
1183 info->dev = eina_stringshare_add(dev);
1184 info->path = eina_stringshare_add(path);
1185 1220
1186 file = ecore_file_file_get(e_fm2_real_path_get(fwin->fm_obj)); 1221 file = ecore_file_file_get(e_fm2_real_path_get(page->fm_obj));
1187 e_widget_toolbar_item_label_set(fwin->tb_obj, fwin->page_index, file); 1222 e_widget_toolbar_item_label_set(fwin->tb_obj, fwin->page_index, file);
1188 } 1223 }
1189 if ((fwin->theme_file) && (ecore_file_exists(fwin->theme_file))) 1224 if ((fwin->theme_file) && (ecore_file_exists(fwin->theme_file)))
@@ -1192,19 +1227,19 @@ _e_fwin_changed(void *data, Evas_Object *obj, void *event_info)
1192 e_fm2_custom_theme_set(obj, NULL); 1227 e_fm2_custom_theme_set(obj, NULL);
1193 1228
1194 if (fwin->zone) return; 1229 if (fwin->zone) return;
1195 _e_fwin_window_title_set(fwin); 1230 _e_fwin_window_title_set(page);
1196} 1231}
1197 1232
1198static void 1233static void
1199_e_fwin_selected(void *data, Evas_Object *obj, void *event_info) 1234_e_fwin_selected(void *data, Evas_Object *obj, void *event_info)
1200{ 1235{
1201 E_Fwin *fwin; 1236 E_Fwin_Page *page;
1202 Eina_List *selected; 1237 Eina_List *selected;
1203 1238
1204 fwin = data; 1239 page = data;
1205 selected = e_fm2_selected_list_get(fwin->fm_obj); 1240 selected = e_fm2_selected_list_get(page->fm_obj);
1206 if (!selected) return; 1241 if (!selected) return;
1207 _e_fwin_file_open_dialog(fwin, selected, 0); 1242 _e_fwin_file_open_dialog(page, selected, 0);
1208 eina_list_free(selected); 1243 eina_list_free(selected);
1209} 1244}
1210 1245
@@ -1212,12 +1247,12 @@ static void
1212_e_fwin_selection_change(void *data, Evas_Object *obj, void *event_info) 1247_e_fwin_selection_change(void *data, Evas_Object *obj, void *event_info)
1213{ 1248{
1214 Eina_List *l; 1249 Eina_List *l;
1215 E_Fwin *fwin; 1250 E_Fwin_Page *page;
1216 1251
1217 fwin = data; 1252 page = data;
1218 for (l = fwins; l; l = l->next) 1253 for (l = fwins; l; l = l->next)
1219 { 1254 {
1220 if (l->data != fwin) 1255 if (l->data != page->fwin)
1221 e_fwin_all_unsel(l->data); 1256 e_fwin_all_unsel(l->data);
1222 } 1257 }
1223} 1258}
@@ -1239,8 +1274,10 @@ _e_fwin_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
1239{ 1274{
1240 Evas_Event_Key_Down *ev; 1275 Evas_Event_Key_Down *ev;
1241 E_Fwin *fwin; 1276 E_Fwin *fwin;
1277 E_Fwin_Page *page;
1242 1278
1243 fwin = data; 1279 page = data;
1280 fwin = page->fwin;
1244 ev = event_info; 1281 ev = event_info;
1245 1282
1246 if (evas_key_modifier_is_set(ev->modifiers, "Control")) 1283 if (evas_key_modifier_is_set(ev->modifiers, "Control"))
@@ -1251,18 +1288,50 @@ _e_fwin_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
1251 const char *dev, *path; 1288 const char *dev, *path;
1252 1289
1253 con = e_container_current_get(e_manager_current_get()); 1290 con = e_container_current_get(e_manager_current_get());
1254 e_fm2_path_get(fwin->fm_obj, &dev, &path); 1291 e_fm2_path_get(page->fm_obj, &dev, &path);
1255 e_fwin_new(con, dev, path); 1292 e_fwin_new(con, dev, path);
1256 return; 1293 return;
1257 } 1294 }
1258 if (!strcmp(ev->key, "w")) 1295 if (!strcmp(ev->key, "w"))
1259 { 1296 {
1260 e_object_del(E_OBJECT(fwin)); 1297 int count = eina_list_count(fwin->pages);
1298 E_Fwin_Page *page;
1299
1300 if (count > 2)
1301 {
1302 Eina_List *l;
1303 int i = 0;
1304
1305 page = fwin->cur_page;
1306 if (fwin->page_index > 0)
1307 e_widget_toolbar_item_select(fwin->tb_obj, fwin->page_index - 1);
1308 else
1309 e_widget_toolbar_item_select(fwin->tb_obj, 1);
1310 e_widget_toolbar_item_remove(fwin->tb_obj, page->index);
1311 fwin->pages = eina_list_remove(fwin->pages, page);
1312 _e_fwin_page_free(page);
1313 EINA_LIST_FOREACH(fwin->pages, l, page)
1314 page->index = i++;
1315 }
1316 else if (count > 1)
1317 {
1318 evas_object_del(fwin->tb_obj);
1319 fwin->tb_obj = NULL;
1320 fwin->page_index = 0;
1321 fwin->pages = eina_list_remove(fwin->pages, fwin->cur_page);
1322 _e_fwin_page_free(fwin->cur_page);
1323 page = fwin->pages->data;
1324 page->index = 0;
1325 _e_fwin_cb_page_change(fwin, page);
1326 _e_fwin_cb_resize(fwin->win);
1327 }
1328 else
1329 e_object_del(E_OBJECT(fwin));
1261 return; 1330 return;
1262 } 1331 }
1263 if (!strcmp(ev->key, "a")) 1332 if (!strcmp(ev->key, "a"))
1264 { 1333 {
1265 e_fm2_all_sel(fwin->fm_obj); 1334 e_fm2_all_sel(page->fm_obj);
1266 return; 1335 return;
1267 } 1336 }
1268 if (!strcmp(ev->key, "t")) 1337 if (!strcmp(ev->key, "t"))
@@ -1301,10 +1370,10 @@ _e_fwin_zone_move_resize(void *data, int type, void *event)
1301 evas_object_move(fwin->bg_obj, ev->zone->x, ev->zone->y); 1370 evas_object_move(fwin->bg_obj, ev->zone->x, ev->zone->y);
1302 evas_object_resize(fwin->bg_obj, ev->zone->w, ev->zone->h); 1371 evas_object_resize(fwin->bg_obj, ev->zone->w, ev->zone->h);
1303 } 1372 }
1304 if (fwin->scrollframe_obj) 1373 if (fwin->cur_page->scrollframe_obj)
1305 { 1374 {
1306 evas_object_move(fwin->scrollframe_obj, ev->zone->x, ev->zone->y); 1375 evas_object_move(fwin->cur_page->scrollframe_obj, ev->zone->x, ev->zone->y);
1307 evas_object_resize(fwin->scrollframe_obj, ev->zone->w, ev->zone->h); 1376 evas_object_resize(fwin->cur_page->scrollframe_obj, ev->zone->w, ev->zone->h);
1308 } 1377 }
1309 return 1; 1378 return 1;
1310} 1379}
@@ -1329,10 +1398,10 @@ _e_fwin_zone_del(void *data, int type, void *event)
1329static void 1398static void
1330_e_fwin_menu_extend(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info) 1399_e_fwin_menu_extend(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info)
1331{ 1400{
1332 E_Fwin *fwin; 1401 E_Fwin_Page *page;
1333 E_Menu_Item *mi; 1402 E_Menu_Item *mi;
1334 1403
1335 fwin = data; 1404 page = data;
1336 if (e_fm2_has_parent_get(obj)) 1405 if (e_fm2_has_parent_get(obj))
1337 { 1406 {
1338 mi = e_menu_item_new(m); 1407 mi = e_menu_item_new(m);
@@ -1360,14 +1429,14 @@ _e_fwin_parent(void *data, E_Menu *m, E_Menu_Item *mi)
1360static void 1429static void
1361_e_fwin_cb_menu_open_fast(void *data, E_Menu *m, E_Menu_Item *mi) 1430_e_fwin_cb_menu_open_fast(void *data, E_Menu *m, E_Menu_Item *mi)
1362{ 1431{
1363 E_Fwin *fwin; 1432 E_Fwin_Page *page;
1364 Efreet_Desktop *desk; 1433 Efreet_Desktop *desk;
1365 1434
1366 fwin = data; 1435 page = data;
1367 desk = e_object_data_get(E_OBJECT(mi)); 1436 desk = e_object_data_get(E_OBJECT(mi));
1368 1437
1369 if (fwin && desk) 1438 if (page && desk)
1370 _e_fwin_desktop_run(desk, fwin); 1439 _e_fwin_desktop_run(desk, page);
1371} 1440}
1372 1441
1373static void 1442static void
@@ -1375,12 +1444,12 @@ _e_fwin_cb_menu_extend_open_with(void *data, E_Menu *m)
1375{ 1444{
1376 Eina_List *selected = NULL, *apps = NULL, *l; 1445 Eina_List *selected = NULL, *apps = NULL, *l;
1377 E_Menu_Item *mi; 1446 E_Menu_Item *mi;
1378 E_Fwin *fwin; 1447 E_Fwin_Page *page;
1379 Efreet_Desktop *desk = NULL; 1448 Efreet_Desktop *desk = NULL;
1380 1449
1381 fwin = data; 1450 page = data;
1382 1451
1383 selected = e_fm2_selected_list_get(fwin->fm_obj); 1452 selected = e_fm2_selected_list_get(page->fm_obj);
1384 if (!selected) return; 1453 if (!selected) return;
1385 1454
1386 apps = _e_fwin_suggested_apps_list_get(selected, NULL); 1455 apps = _e_fwin_suggested_apps_list_get(selected, NULL);
@@ -1390,7 +1459,7 @@ _e_fwin_cb_menu_extend_open_with(void *data, E_Menu *m)
1390 mi = e_menu_item_new(m); 1459 mi = e_menu_item_new(m);
1391 e_menu_item_label_set(mi, desk->name); 1460 e_menu_item_label_set(mi, desk->name);
1392 e_util_desktop_menu_item_icon_add(desk, 24, mi); 1461 e_util_desktop_menu_item_icon_add(desk, 24, mi);
1393 e_menu_item_callback_set(mi, _e_fwin_cb_menu_open_fast, fwin); 1462 e_menu_item_callback_set(mi, _e_fwin_cb_menu_open_fast, page);
1394 e_object_data_set(E_OBJECT(mi), desk); 1463 e_object_data_set(E_OBJECT(mi), desk);
1395 } 1464 }
1396 1465
@@ -1403,7 +1472,7 @@ _e_fwin_cb_menu_extend_open_with(void *data, E_Menu *m)
1403 mi = e_menu_item_new(m); 1472 mi = e_menu_item_new(m);
1404 e_menu_item_label_set(mi, _("Other application...")); 1473 e_menu_item_label_set(mi, _("Other application..."));
1405 e_util_menu_item_theme_icon_set(mi, "document-open"); 1474 e_util_menu_item_theme_icon_set(mi, "document-open");
1406 e_menu_item_callback_set(mi, _e_fwin_cb_menu_open_with, fwin); 1475 e_menu_item_callback_set(mi, _e_fwin_cb_menu_open_with, page);
1407 1476
1408 e_menu_pre_activate_callback_set(m, NULL, NULL); 1477 e_menu_pre_activate_callback_set(m, NULL, NULL);
1409 1478
@@ -1415,14 +1484,14 @@ static void
1415_e_fwin_cb_menu_extend_start(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info) 1484_e_fwin_cb_menu_extend_start(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info)
1416{ 1485{
1417 E_Menu_Item *mi; 1486 E_Menu_Item *mi;
1418 E_Fwin *fwin; 1487 E_Fwin_Page *page;
1419 E_Menu *subm; 1488 E_Menu *subm;
1420 1489
1421 fwin = data; 1490 page = data;
1422 mi = e_menu_item_new(m); 1491 mi = e_menu_item_new(m);
1423 e_menu_item_label_set(mi, _("Open")); 1492 e_menu_item_label_set(mi, _("Open"));
1424 e_util_menu_item_theme_icon_set(mi, "document-open"); 1493 e_util_menu_item_theme_icon_set(mi, "document-open");
1425 e_menu_item_callback_set(mi, _e_fwin_cb_menu_open, fwin); 1494 e_menu_item_callback_set(mi, _e_fwin_cb_menu_open, page);
1426 1495
1427 mi = e_menu_item_new(m); 1496 mi = e_menu_item_new(m);
1428 e_menu_item_label_set(mi, _("Open with...")); 1497 e_menu_item_label_set(mi, _("Open with..."));
@@ -1430,41 +1499,41 @@ _e_fwin_cb_menu_extend_start(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon
1430 1499
1431 subm = e_menu_new(); 1500 subm = e_menu_new();
1432 e_menu_item_submenu_set(mi, subm); 1501 e_menu_item_submenu_set(mi, subm);
1433 e_menu_pre_activate_callback_set(subm, _e_fwin_cb_menu_extend_open_with, fwin); 1502 e_menu_pre_activate_callback_set(subm, _e_fwin_cb_menu_extend_open_with, page);
1434} 1503}
1435 1504
1436static void 1505static void
1437_e_fwin_cb_menu_open(void *data, E_Menu *m, E_Menu_Item *mi) 1506_e_fwin_cb_menu_open(void *data, E_Menu *m, E_Menu_Item *mi)
1438{ 1507{
1439 E_Fwin *fwin; 1508 E_Fwin_Page *page;
1440 Eina_List *selected; 1509 Eina_List *selected;
1441 1510
1442 fwin = data; 1511 page = data;
1443 selected = e_fm2_selected_list_get(fwin->fm_obj); 1512 selected = e_fm2_selected_list_get(page->fm_obj);
1444 if (!selected) return; 1513 if (!selected) return;
1445 _e_fwin_file_open_dialog(fwin, selected, 0); 1514 _e_fwin_file_open_dialog(page, selected, 0);
1446 eina_list_free(selected); 1515 eina_list_free(selected);
1447} 1516}
1448 1517
1449static void 1518static void
1450_e_fwin_cb_menu_open_with(void *data, E_Menu *m, E_Menu_Item *mi) 1519_e_fwin_cb_menu_open_with(void *data, E_Menu *m, E_Menu_Item *mi)
1451{ 1520{
1452 E_Fwin *fwin; 1521 E_Fwin_Page *page;
1453 Eina_List *selected = NULL; 1522 Eina_List *selected = NULL;
1454 1523
1455 fwin = data; 1524 page = data;
1456 selected = e_fm2_selected_list_get(fwin->fm_obj); 1525 selected = e_fm2_selected_list_get(page->fm_obj);
1457 if (!selected) return; 1526 if (!selected) return;
1458 _e_fwin_file_open_dialog(fwin, selected, 1); 1527 _e_fwin_file_open_dialog(page, selected, 1);
1459 eina_list_free(selected); 1528 eina_list_free(selected);
1460} 1529}
1461 1530
1462 1531
1463/* 'open with' dialog*/ 1532/* 'open with' dialog*/
1464static void 1533static void
1465_e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always) 1534_e_fwin_file_open_dialog(E_Fwin_Page *page, Eina_List *files, int always)
1466{ 1535{
1467 E_Fwin *fwin2 = NULL; 1536 E_Fwin *fwin = page->fwin, *fwin2 = NULL;
1468 E_Dialog *dia; 1537 E_Dialog *dia;
1469 Evas_Coord mw, mh; 1538 Evas_Coord mw, mh;
1470 Evas_Object *o, *of, *ot; 1539 Evas_Object *o, *of, *ot;
@@ -1497,8 +1566,8 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1497 } 1566 }
1498 else 1567 else
1499 { 1568 {
1500 e_fm2_path_set(fwin->fm_obj, ici->link, "/"); 1569 e_fm2_path_set(page->fm_obj, ici->link, "/");
1501 _e_fwin_window_title_set(fwin); 1570 _e_fwin_window_title_set(page);
1502 } 1571 }
1503 } 1572 }
1504 else if ((ici->link) && (ici->removable)) 1573 else if ((ici->link) && (ici->removable))
@@ -1513,8 +1582,8 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1513 } 1582 }
1514 else 1583 else
1515 { 1584 {
1516 e_fm2_path_set(fwin->fm_obj, buf, "/"); 1585 e_fm2_path_set(page->fm_obj, buf, "/");
1517 _e_fwin_window_title_set(fwin); 1586 _e_fwin_window_title_set(page);
1518 } 1587 }
1519 } 1588 }
1520 else if (ici->real_link) 1589 else if (ici->real_link)
@@ -1530,8 +1599,8 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1530 } 1599 }
1531 else 1600 else
1532 { 1601 {
1533 e_fm2_path_set(fwin->fm_obj, NULL, ici->real_link); 1602 e_fm2_path_set(page->fm_obj, NULL, ici->real_link);
1534 _e_fwin_window_title_set(fwin); 1603 _e_fwin_window_title_set(page);
1535 } 1604 }
1536 } 1605 }
1537 else 1606 else
@@ -1540,7 +1609,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1540 else 1609 else
1541 { 1610 {
1542 snprintf(buf, sizeof(buf), "%s/%s", 1611 snprintf(buf, sizeof(buf), "%s/%s",
1543 e_fm2_real_path_get(fwin->fm_obj), ici->file); 1612 e_fm2_real_path_get(page->fm_obj), ici->file);
1544 if (S_ISDIR(ici->statinfo.st_mode)) 1613 if (S_ISDIR(ici->statinfo.st_mode))
1545 { 1614 {
1546 if ((!fileman_config->view.open_dirs_in_place) || (fwin->zone)) 1615 if ((!fileman_config->view.open_dirs_in_place) || (fwin->zone))
@@ -1552,8 +1621,8 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1552 } 1621 }
1553 else 1622 else
1554 { 1623 {
1555 e_fm2_path_set(fwin->fm_obj, NULL, buf); 1624 e_fm2_path_set(page->fm_obj, NULL, buf);
1556 _e_fwin_window_title_set(fwin); 1625 _e_fwin_window_title_set(page);
1557 } 1626 }
1558 } 1627 }
1559 else 1628 else
@@ -1567,7 +1636,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1567 const char *itype = NULL; 1636 const char *itype = NULL;
1568 int ix, iy, iw, ih, nx, ny, nw, nh; 1637 int ix, iy, iw, ih, nx, ny, nw, nh;
1569 1638
1570 oic = e_fm2_icon_get(evas_object_evas_get(fwin->fm_obj), 1639 oic = e_fm2_icon_get(evas_object_evas_get(page->fm_obj),
1571 ici->ic, NULL, NULL, 0, &itype); 1640 ici->ic, NULL, NULL, 0, &itype);
1572 if (oic) 1641 if (oic)
1573 { 1642 {
@@ -1602,7 +1671,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1602 evas_object_del(oic); 1671 evas_object_del(oic);
1603 1672
1604 snprintf(buf, sizeof(buf), "dir::%s", 1673 snprintf(buf, sizeof(buf), "dir::%s",
1605 e_fm2_real_path_get(fwin2->fm_obj)); 1674 e_fm2_real_path_get(fwin2->cur_page->fm_obj));
1606 cf = e_fm2_custom_file_get(buf); 1675 cf = e_fm2_custom_file_get(buf);
1607 if ((cf) && (cf->geom.valid)) 1676 if ((cf) && (cf->geom.valid))
1608 { 1677 {
@@ -1696,7 +1765,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1696 need_dia = 1; 1765 need_dia = 1;
1697 if (mlist) desk = e_exehist_mime_desktop_get(mlist->data); 1766 if (mlist) desk = e_exehist_mime_desktop_get(mlist->data);
1698 getcwd(pcwd, sizeof(pcwd)); 1767 getcwd(pcwd, sizeof(pcwd));
1699 chdir(e_fm2_real_path_get(fwin->fm_obj)); 1768 chdir(e_fm2_real_path_get(page->fm_obj));
1700 1769
1701 files_list = NULL; 1770 files_list = NULL;
1702 EINA_LIST_FOREACH(files, l, ici) 1771 EINA_LIST_FOREACH(files, l, ici)
@@ -1709,7 +1778,7 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Eina_List *files, int always)
1709 ext = _e_fwin_file_is_exec(ici); 1778 ext = _e_fwin_file_is_exec(ici);
1710 if (ext != E_FWIN_EXEC_NONE) 1779 if (ext != E_FWIN_EXEC_NONE)
1711 { 1780 {
1712 _e_fwin_file_exec(fwin, ici, ext); 1781 _e_fwin_file_exec(page, ici, ext);
1713 need_dia = 0; 1782 need_dia = 0;
1714 } 1783 }
1715 } 1784 }
@@ -1904,7 +1973,7 @@ _e_fwin_cb_open(void *data, E_Dialog *dia)
1904 } 1973 }
1905 1974
1906 if ((desktop) || (strcmp(fad->exec_cmd, ""))) 1975 if ((desktop) || (strcmp(fad->exec_cmd, "")))
1907 _e_fwin_desktop_run(desktop,fad->fwin); 1976 _e_fwin_desktop_run(desktop, fad->fwin->cur_page);
1908 1977
1909 // Free fake .desktop 1978 // Free fake .desktop
1910 if (!strcmp(fad->exec_cmd, "")) 1979 if (!strcmp(fad->exec_cmd, ""))
@@ -1941,90 +2010,90 @@ _e_fwin_cb_dialog_free(void *obj)
1941static void 2010static void
1942_e_fwin_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) 2011_e_fwin_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
1943{ 2012{
1944 E_Fwin *fwin; 2013 E_Fwin_Page *page;
1945 2014
1946 fwin = evas_object_data_get(obj, "fwin"); 2015 page = evas_object_data_get(obj, "fm_page");
1947 e_fm2_pan_set(obj, x, y); 2016 e_fm2_pan_set(obj, x, y);
1948 if (x > fwin->fm_pan.max_x) x = fwin->fm_pan.max_x; 2017 if (x > page->fm_pan.max_x) x = page->fm_pan.max_x;
1949 if (y > fwin->fm_pan.max_y) y = fwin->fm_pan.max_y; 2018 if (y > page->fm_pan.max_y) y = page->fm_pan.max_y;
1950 if (x < 0) x = 0; 2019 if (x < 0) x = 0;
1951 if (y < 0) y = 0; 2020 if (y < 0) y = 0;
1952 fwin->fm_pan.x = x; 2021 page->fm_pan.x = x;
1953 fwin->fm_pan.y = y; 2022 page->fm_pan.y = y;
1954 _e_fwin_pan_scroll_update(fwin); 2023 _e_fwin_pan_scroll_update(page);
1955} 2024}
1956 2025
1957static void 2026static void
1958_e_fwin_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) 2027_e_fwin_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
1959{ 2028{
1960 E_Fwin *fwin; 2029 E_Fwin_Page *page;
1961 2030
1962 fwin = evas_object_data_get(obj, "fwin"); 2031 page = evas_object_data_get(obj, "fm_page");
1963 e_fm2_pan_get(obj, x, y); 2032 e_fm2_pan_get(obj, x, y);
1964 fwin->fm_pan.x = *x; 2033 page->fm_pan.x = *x;
1965 fwin->fm_pan.y = *y; 2034 page->fm_pan.y = *y;
1966} 2035}
1967 2036
1968static void 2037static void
1969_e_fwin_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) 2038_e_fwin_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
1970{ 2039{
1971 E_Fwin *fwin; 2040 E_Fwin_Page *page;
1972 2041
1973 fwin = evas_object_data_get(obj, "fwin"); 2042 page = evas_object_data_get(obj, "fm_page");
1974 e_fm2_pan_max_get(obj, x, y); 2043 e_fm2_pan_max_get(obj, x, y);
1975 fwin->fm_pan.max_x = *x; 2044 page->fm_pan.max_x = *x;
1976 fwin->fm_pan.max_y = *y; 2045 page->fm_pan.max_y = *y;
1977 _e_fwin_pan_scroll_update(fwin); 2046 _e_fwin_pan_scroll_update(page);
1978} 2047}
1979 2048
1980static void 2049static void
1981_e_fwin_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) 2050_e_fwin_pan_child_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
1982{ 2051{
1983 E_Fwin *fwin; 2052 E_Fwin_Page *page;
1984 2053
1985 fwin = evas_object_data_get(obj, "fwin"); 2054 page = evas_object_data_get(obj, "fm_page");
1986 e_fm2_pan_child_size_get(obj, w, h); 2055 e_fm2_pan_child_size_get(obj, w, h);
1987 fwin->fm_pan.w = *w; 2056 page->fm_pan.w = *w;
1988 fwin->fm_pan.h = *h; 2057 page->fm_pan.h = *h;
1989 _e_fwin_pan_scroll_update(fwin); 2058 _e_fwin_pan_scroll_update(page);
1990} 2059}
1991 2060
1992static void 2061static void
1993_e_fwin_pan_scroll_update(E_Fwin *fwin) 2062_e_fwin_pan_scroll_update(E_Fwin_Page *page)
1994{ 2063{
1995 Edje_Message_Int_Set *msg; 2064 Edje_Message_Int_Set *msg;
1996 2065
1997 if ((fwin->fm_pan.x == fwin->fm_pan_last.x) && 2066 if ((page->fm_pan.x == page->fm_pan_last.x) &&
1998 (fwin->fm_pan.y == fwin->fm_pan_last.y) && 2067 (page->fm_pan.y == page->fm_pan_last.y) &&
1999 (fwin->fm_pan.max_x == fwin->fm_pan_last.max_x) && 2068 (page->fm_pan.max_x == page->fm_pan_last.max_x) &&
2000 (fwin->fm_pan.max_y == fwin->fm_pan_last.max_y) && 2069 (page->fm_pan.max_y == page->fm_pan_last.max_y) &&
2001 (fwin->fm_pan.w == fwin->fm_pan_last.w) && 2070 (page->fm_pan.w == page->fm_pan_last.w) &&
2002 (fwin->fm_pan.h == fwin->fm_pan_last.h)) return; 2071 (page->fm_pan.h == page->fm_pan_last.h)) return;
2003 msg = alloca(sizeof(Edje_Message_Int_Set) - 2072 msg = alloca(sizeof(Edje_Message_Int_Set) -
2004 sizeof(int) + (6 * sizeof(int))); 2073 sizeof(int) + (6 * sizeof(int)));
2005 msg->count = 6; 2074 msg->count = 6;
2006 msg->val[0] = fwin->fm_pan.x; 2075 msg->val[0] = page->fm_pan.x;
2007 msg->val[1] = fwin->fm_pan.y; 2076 msg->val[1] = page->fm_pan.y;
2008 msg->val[2] = fwin->fm_pan.max_x; 2077 msg->val[2] = page->fm_pan.max_x;
2009 msg->val[3] = fwin->fm_pan.max_y; 2078 msg->val[3] = page->fm_pan.max_y;
2010 msg->val[4] = fwin->fm_pan.w; 2079 msg->val[4] = page->fm_pan.w;
2011 msg->val[5] = fwin->fm_pan.h; 2080 msg->val[5] = page->fm_pan.h;
2012// printf("SEND MSG %i %i | %i %i | %ix%i\n", 2081// printf("SEND MSG %i %i | %i %i | %ix%i\n",
2013// fwin->fm_pan.x, fwin->fm_pan.y, 2082// page->fm_pan.x, page->fm_pan.y,
2014// fwin->fm_pan.max_x, fwin->fm_pan.max_y, 2083// page->fm_pan.max_x, page->fm_pan.max_y,
2015// fwin->fm_pan.w, fwin->fm_pan.h); 2084// page->fm_pan.w, page->fm_pan.h);
2016 if (fwin->under_obj) 2085 if (page->fwin->under_obj)
2017 edje_object_message_send(fwin->under_obj, EDJE_MESSAGE_INT_SET, 1, msg); 2086 edje_object_message_send(page->fwin->under_obj, EDJE_MESSAGE_INT_SET, 1, msg);
2018 if (fwin->over_obj) 2087 if (page->fwin->over_obj)
2019 edje_object_message_send(fwin->over_obj, EDJE_MESSAGE_INT_SET, 1, msg); 2088 edje_object_message_send(page->fwin->over_obj, EDJE_MESSAGE_INT_SET, 1, msg);
2020 if (fwin->scrollframe_obj) 2089 if (page->scrollframe_obj)
2021 edje_object_message_send(e_scrollframe_edje_object_get(fwin->scrollframe_obj), EDJE_MESSAGE_INT_SET, 1, msg); 2090 edje_object_message_send(e_scrollframe_edje_object_get(page->scrollframe_obj), EDJE_MESSAGE_INT_SET, 1, msg);
2022 fwin->fm_pan_last.x = fwin->fm_pan.x; 2091 page->fm_pan_last.x = page->fm_pan.x;
2023 fwin->fm_pan_last.y = fwin->fm_pan.y; 2092 page->fm_pan_last.y = page->fm_pan.y;
2024 fwin->fm_pan_last.max_x = fwin->fm_pan.max_x; 2093 page->fm_pan_last.max_x = page->fm_pan.max_x;
2025 fwin->fm_pan_last.max_y = fwin->fm_pan.max_y; 2094 page->fm_pan_last.max_y = page->fm_pan.max_y;
2026 fwin->fm_pan_last.w = fwin->fm_pan.w; 2095 page->fm_pan_last.w = page->fm_pan.w;
2027 fwin->fm_pan_last.h = fwin->fm_pan.h; 2096 page->fm_pan_last.h = page->fm_pan.h;
2028} 2097}
2029 2098
2030 2099
@@ -2095,7 +2164,7 @@ static int
2095_e_fwin_op_registry_entry_add_cb(void *data, int type, void *event) 2164_e_fwin_op_registry_entry_add_cb(void *data, int type, void *event)
2096{ 2165{
2097 E_Fm2_Op_Registry_Entry *ere = (E_Fm2_Op_Registry_Entry *)event; 2166 E_Fm2_Op_Registry_Entry *ere = (E_Fm2_Op_Registry_Entry *)event;
2098 E_Fwin *fwin = data; 2167 E_Fwin_Page *page = data;
2099 Evas_Object *o; 2168 Evas_Object *o;
2100 int mw, mh; 2169 int mw, mh;
2101 2170
@@ -2103,7 +2172,7 @@ _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event)
2103 ere->op == E_FM_OP_REMOVE)) 2172 ere->op == E_FM_OP_REMOVE))
2104 return ECORE_CALLBACK_RENEW; 2173 return ECORE_CALLBACK_RENEW;
2105 2174
2106 o = edje_object_add(e_win_evas_get(fwin->win)); 2175 o = edje_object_add(evas_object_evas_get(page->scrollframe_obj));
2107 e_theme_edje_object_set(o, "base/theme/fileman", 2176 e_theme_edje_object_set(o, "base/theme/fileman",
2108 "e/fileman/default/progress"); 2177 "e/fileman/default/progress");
2109 edje_object_size_min_get(o, &mw, &mh); 2178 edje_object_size_min_get(o, &mw, &mh);
@@ -2115,7 +2184,7 @@ _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event)
2115 _e_fwin_op_registry_listener_cb(o, ere); 2184 _e_fwin_op_registry_listener_cb(o, ere);
2116 2185
2117 // Append the element to the box 2186 // Append the element to the box
2118 edje_object_part_box_append(e_scrollframe_edje_object_get(fwin->scrollframe_obj), 2187 edje_object_part_box_append(e_scrollframe_edje_object_get(page->scrollframe_obj),
2119 "e.box.operations", o); 2188 "e.box.operations", o);
2120 evas_object_size_hint_align_set(o, 1.0, 1.0); //FIXME this should be theme-configurable 2189 evas_object_size_hint_align_set(o, 1.0, 1.0); //FIXME this should be theme-configurable
2121 evas_object_show(o); 2190 evas_object_show(o);
@@ -2128,13 +2197,13 @@ _e_fwin_op_registry_entry_add_cb(void *data, int type, void *event)
2128} 2197}
2129 2198
2130static void 2199static void
2131_e_fwin_op_registry_entry_iter(E_Fwin *fwin) 2200_e_fwin_op_registry_entry_iter(E_Fwin_Page *page)
2132{ 2201{
2133 Eina_Iterator *itr; 2202 Eina_Iterator *itr;
2134 E_Fm2_Op_Registry_Entry *ere; 2203 E_Fm2_Op_Registry_Entry *ere;
2135 2204
2136 itr = e_fm2_op_registry_iterator_new(); 2205 itr = e_fm2_op_registry_iterator_new();
2137 EINA_ITERATOR_FOREACH(itr, ere) 2206 EINA_ITERATOR_FOREACH(itr, ere)
2138 _e_fwin_op_registry_entry_add_cb(fwin, 0, ere); 2207 _e_fwin_op_registry_entry_add_cb(page, 0, ere);
2139 eina_iterator_free(itr); 2208 eina_iterator_free(itr);
2140} 2209}