enlightenment/src/bin/e_fileman.c

260 lines
6.5 KiB
C
Raw Normal View History

2005-10-10 09:33:13 -07:00
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
#include "e.h"
/****
* TODO:
* - reset scrollbar positions on dir changes
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
* - dont allow for menus on ".."
* - xdnd
* - proper mime system
* - create x, y, w, h in canvas struct and make them auto update
****/
#ifdef EFM_DEBUG
# define D(x) do {printf(__FILE__ ":%d: ", __LINE__); printf x; fflush(stdout);} while (0)
#else
# define D(x) ((void) 0)
#endif
2005-10-10 09:33:13 -07:00
static void _e_fileman_vscrollbar_drag_cb(Evas_Object *object, double value, void *data);
static void _e_fileman_reconf_cb(void *data, int type, void *event);
static void _e_fileman_dir_change_cb(void *data, int type, void *event);
static void _e_fileman_resize_cb(E_Win *win);
static void _e_fileman_delete_cb(E_Win *win);
static void _e_fileman_vscrollbar_show_cb(void *data, Evas_Object *obj, void *ev);
static void _e_fileman_vscrollbar_hide_cb(void *data, Evas_Object *obj, void *ev);
2005-10-10 09:33:13 -07:00
static void _e_fileman_free(E_Fileman *fileman);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
E_Fileman *
2005-10-10 09:33:13 -07:00
e_fileman_new(E_Container *con)
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
{
E_Fileman *fileman;
2005-10-10 09:33:13 -07:00
E_Manager *man;
char dir[PATH_MAX];
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
if (!con)
2005-10-10 09:33:13 -07:00
{
man = e_manager_current_get();
if (!man) return NULL;
con = e_container_current_get(man);
if (!con) con = e_container_number_get(man, 0);
if (!con) return NULL;
}
if (!getcwd(dir, sizeof(dir)))
return NULL;
fileman = E_OBJECT_ALLOC(E_Fileman, E_FILEMAN_TYPE, _e_fileman_free);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
if (!fileman) return NULL;
fileman->con = con;
2005-10-10 09:33:13 -07:00
e_object_ref(E_OBJECT(fileman->con));
fileman->win = e_win_new(con);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
if (!fileman->win)
2005-10-10 09:33:13 -07:00
{
free(fileman);
return NULL;
}
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
fileman->xpos = 0;
2005-10-10 09:33:13 -07:00
fileman->ypos = 0;
e_win_delete_callback_set(fileman->win, _e_fileman_delete_cb);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
fileman->win->data = fileman;
2005-10-10 09:33:13 -07:00
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
fileman->evas = e_win_evas_get(fileman->win);
2005-10-10 09:33:13 -07:00
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
e_win_name_class_set(fileman->win, "Efm ", "_fileman");
2005-10-10 09:33:13 -07:00
e_win_title_set(fileman->win, dir);
fileman->main = edje_object_add(fileman->evas);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
e_theme_edje_object_set(fileman->main, "base/theme/fileman/main",
2005-10-10 09:33:13 -07:00
"fileman/main");
fileman->vscrollbar = e_scrollbar_add(fileman->evas);
e_scrollbar_direction_set(fileman->vscrollbar, E_SCROLLBAR_VERTICAL);
e_scrollbar_callback_drag_add(fileman->vscrollbar, _e_fileman_vscrollbar_drag_cb, fileman);
evas_object_event_callback_add(fileman->vscrollbar, EVAS_CALLBACK_SHOW, _e_fileman_vscrollbar_show_cb,fileman);
evas_object_event_callback_add(fileman->vscrollbar, EVAS_CALLBACK_HIDE, _e_fileman_vscrollbar_show_cb,fileman);
2005-10-10 09:33:13 -07:00
e_win_resize_callback_set(fileman->win, _e_fileman_resize_cb);
2005-10-10 09:33:13 -07:00
e_win_resize(fileman->win, 640, 480);
evas_event_freeze(fileman->evas);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
fileman->smart = e_fm_add(fileman->evas);
2005-10-10 09:33:13 -07:00
e_fm_e_win_set(fileman->smart, fileman->win);
edje_object_part_swallow(fileman->main, "icon_area", fileman->smart);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
ecore_x_dnd_aware_set(fileman->win->evas_win, 1);
2005-10-10 09:33:13 -07:00
fileman->event_handlers = evas_list_append(fileman->event_handlers,
ecore_event_handler_add(E_EVENT_FM_RECONFIGURE,
_e_fileman_reconf_cb,
fileman));
fileman->event_handlers = evas_list_append(fileman->event_handlers,
ecore_event_handler_add(E_EVENT_FM_DIRECTORY_CHANGE,
_e_fileman_dir_change_cb,
fileman));
evas_event_thaw(fileman->evas);
D(("e_fileman_new: ok\n"));
2005-10-10 09:33:13 -07:00
return fileman;
}
void
e_fileman_show(E_Fileman *fileman)
{
if (!fileman) return;
D(("e_fileman_show: (%p)\n", fileman));
2005-10-10 09:33:13 -07:00
e_win_show(fileman->win);
evas_object_show(fileman->main);
}
void
e_fileman_hide(E_Fileman *fileman)
{
if (!fileman) return;
D(("e_fileman_hide: (%p)\n", fileman));
2005-10-10 09:33:13 -07:00
e_win_hide(fileman->win);
evas_object_hide(fileman->main);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
}
static void
_e_fileman_free(E_Fileman *fileman)
2005-10-10 09:33:13 -07:00
{
D(("e_fileman_free: (%p)\n", fileman));
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
evas_object_del(fileman->vscrollbar);
evas_object_del(fileman->smart);
2005-10-10 09:33:13 -07:00
evas_object_del(fileman->main);
e_object_del(E_OBJECT(fileman->win));
free(fileman);
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
}
2005-10-10 09:33:13 -07:00
static void
_e_fileman_resize_cb(E_Win *win)
2005-10-10 09:33:13 -07:00
{
E_Fileman *fileman;
Evas_Coord w, h;
int frozen;
2005-10-10 09:33:13 -07:00
fileman = win->data;
evas_object_resize(fileman->main, win->w, win->h);
e_fm_geometry_virtual_get(fileman->smart, &w, &h);
D(("_e_fileman_resize_cb: e_fm_freeze\n"));
frozen = e_fm_freeze(fileman->smart);
if(frozen > 1)
e_fm_thaw(fileman->smart);
if (h > win->h)
{
D(("e_fileman_resize_cb: show (%p)\n", fileman));
edje_object_part_swallow(fileman->main, "vscrollbar", fileman->vscrollbar);
}
else
{
D(("e_fileman_resize_cb: hide (%p)\n", fileman));
edje_object_part_unswallow(fileman->main, fileman->vscrollbar);
evas_object_hide(fileman->vscrollbar);
}
2005-10-10 09:33:13 -07:00
}
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
2005-10-10 09:33:13 -07:00
static void
_e_fileman_delete_cb(E_Win *win)
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
{
2005-10-10 09:33:13 -07:00
E_Fileman *fileman;
fileman = win->data;
D(("e_fileman_delete_cb: (%p)\n", fileman));
2005-10-10 09:33:13 -07:00
e_object_del(E_OBJECT(fileman));
EFM - The E17 file manager and file browser smart object. *** BEFORE YOU USE *** This is alpha software and may cause E17 to crash, lockup, use 99% of your cpu, or even delete your files! I would advise using it in Xnest if you want to test or develop it. *** BEFORE YOU USE *** EFM can: - browse files and directories - generate thumbnails - launch executables - do some xdnd - monitor files and directories - delete and rename files EFM cant: - scroll - associate applications with files - purge its thumbnails (do it manually: ~/.e/e/fileman/thumbnails) - do a lot of things you'd expect it to do because its still in alpha stage Current TODO: - scrolling - we need a redraw function that will just re-arrange and not do the whole thing. for example, when we resize, we should just check the file offset and fill the empty space with icons - is the offset code working properly? i have a feeling we're displayin more icons that the visible space can take and they are being hidden. - emit all sorts of signals on double click, right click, single click... - aspect ratio on thumbnails. - add typebuffer like in evidence. - keyboard shortcuts for directory and file navigation. - multi select - allow for icon movement inside the canvas - add metadata system which allows us to save icon positions and will eventually allow us to have custom icon sizes, custom bgs per dir... - double check dir monitoring. note: when we are in a dir that is constantly changing, we cant keep calling redraw_new as it will kill us. - we need to fix the icon edc to allow us to have icon labels what will wrap on wrap=char - fix bugs SVN revision: 17370
2005-10-09 17:55:07 -07:00
}
2005-10-10 09:33:13 -07:00
static void
_e_fileman_vscrollbar_drag_cb(Evas_Object *object, double value, void *data)
{
E_Fileman *fileman;
fileman = data;
D(("e_fileman_vscrollbar_drag_cb: %f (%p)\n", value, fileman));
2005-10-10 09:33:13 -07:00
e_fm_scroll_vertical(fileman->smart, value);
}
static void
_e_fileman_reconf_cb(void *data, int type, void *event)
{
E_Event_Fm_Reconfigure *ev;
E_Fileman *fileman;
int frozen;
if(!data || !event)
return;
fileman = data;
ev = event;
D(("_e_fileman_reconf_cb: e_fm_freeze\n"));
frozen = e_fm_freeze(fileman->smart);
if(frozen > 1)
e_fm_thaw(fileman->smart);
if (ev->h > fileman->win->h)
{
D(("e_fileman_reconf_cb: show (%p)\n", fileman));
edje_object_part_swallow(fileman->main, "vscrollbar", fileman->vscrollbar);
}
else
{
D(("e_fileman_reconf_cb: hide (%p)\n", fileman));
edje_object_part_unswallow(fileman->main, fileman->vscrollbar);
evas_object_hide(fileman->vscrollbar);
}
}
static void
_e_fileman_dir_change_cb(void *data, int type, void *event)
{
E_Event_Fm_Directory_Change *ev;
E_Fileman *fileman;
if(!data || !event)
return;
fileman = data;
ev = event;
D(("_e_fileman_dir_change_cb:\n"));
e_scrollbar_value_set(fileman->vscrollbar, 0.0);
}
static void
_e_fileman_vscrollbar_show_cb(void *data, Evas_Object *obj, void *ev)
{
E_Fileman *fileman;
fileman = data;
D(("_e_fileman_vscrollbar_show_cb: thaw (%p)\n", fileman));
e_fm_thaw(fileman->smart);
}
static void
_e_fileman_vscrollbar_hide_cb(void *data, Evas_Object *obj, void *ev)
{
E_Fileman *fileman;
fileman = data;
D(("_e_fileman_vscrollbar_hide_cb: thaw (%p)\n", fileman));
e_fm_thaw(fileman->smart);
}