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
This commit is contained in:
codewarrior 2005-10-10 00:55:07 +00:00 committed by codewarrior
parent 20e29bf350
commit 8128695e77
32 changed files with 3314 additions and 3 deletions

View File

@ -46,7 +46,8 @@ collections {
#include "default_pointer.edc"
#include "default_about.edc"
#include "default_theme_about.edc"
#include "default_entry.edc"
#include "default_entry.edc"
#include "default_fileman.edc"
#include "default_scrollbar.edc"
}

View File

@ -0,0 +1,506 @@
#define FULL_SIZE_FILEMAN_BUTTON(TYPE) \
group { \
name: "fileman/button/"TYPE; \
parts { \
part { \
name: "whole"; \
type: RECT; \
description { \
state: "default" 0.0; \
visible: 0; \
rel1 { \
relative: 0.0 0.0; \
offset: 0 0; \
} \
rel2 { \
relative: 1.0 1.0; \
offset: -1 -1; \
} \
} \
} \
BORDER_BUTTON("button",TYPE,0.0,0.0,-3,-3,"whole",1.0,1.0,2,2,"whole") \
} \
}
#define FILEMAN_ICON(TYPE) \
group { \
name: "fileman/icons/"TYPE; \
max: 64 64; \
parts { \
part { \
name: "icon"; \
mouse_events: 0; \
description { \
state: "default" 0.0; \
aspect: 1.0 1.0; \
max: 64 64; \
image { \
normal: "e17_icon_fileman_"TYPE".png"; \
} \
} \
} \
} \
} \
images
{
image: "e17_fileman_bg.png" COMP;
image: "e17_icon_fileman_folder.png" COMP;
image: "e17_icon_fileman_file.png" COMP;
image: "e17_icon_fileman_pdf.png" COMP;
image: "e17_icon_fileman_c.png" COMP;
image: "e17_icon_fileman_h.png" COMP;
image: "e17_icon_fileman_png.png" COMP;
image: "e17_icon_fileman_jpg.png" COMP;
image: "e17_button_detail_open.png" COMP;
image: "e17_button_detail_paste.png" COMP;
image: "e17_button_detail_copy.png" COMP;
image: "e17_button_detail_cut.png" COMP;
image: "e17_button_detail_rename.png" COMP;
image: "e17_button_detail_delete.png" COMP;
image: "e17_button_detail_properties.png" COMP;
image: "e17_button_detail_arrange_name.png" COMP;
image: "e17_button_detail_arrange.png" COMP;
image: "e17_button_detail_arrange_time.png" COMP;
image: "e17_button_detail_properties.png" COMP;
image: "e17_button_detail_refresh.png" COMP;
image: "e17_button_detail_view_details.png" COMP;
image: "e17_button_detail_view_name.png" COMP;
image: "e17_button_detail_view.png" COMP;
image: "e17_menu_bg_border.png" COMP;
image: "e17_button2.png" COMP;
image: "e17_button.png" COMP;
image: "e17_dialog_watermark.png" COMP;
image: "e17_ibar_bg_v.png" COMP;
image: "e17_about_over_v.png" COMP;
image: "e17_logo.png" COMP;
image: "e17_menu_bg.png" COMP;
image: "e17_ibar_over_v.png" COMP;
}
styles
{
style {
name: "fileman_icon_style";
base: "font=Edje-Vera color=#000 font_size=10 align=center wrap=char";
//style=soft_shadow shadow_color=#cccccc
tag: "br" "\n";
tag: "hilight" "+ font=Edje-Vera-Bold";
tag: "invisible" "+ font=Edje-Vera font_size=7 style=none color=#0002";
}
}
group {
name: "fileman/main";
parts {
part {
name: "background_clip";
mouse_events: 1;
type: RECT;
description {
state: "default" 0.0;
rel1 {
relative: 0 0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -16 -16;
}
}
}
part {
name: "background";
mouse_events: 1;
description {
state: "default" 0.0;
rel1 {
relative: 0 0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: 0 0;
}
image {
normal: "e17_fileman_bg.png";
}
fill {
smooth: 0;
}
}
}
part {
name: "logo_bg";
clip_to: "background_clip";
mouse_events: 1;
description
{
state: "default" 0.0;
color: 255 255 255 64;
rel1 {
relative: 0 0;
offset: -30 -80;
}
rel2 {
relative: 0 0;
offset: 90 80;
}
image {
normal: "e17_logo.png";
}
}
}
part {
name: "icon_area";
type: SWALLOW;
mouse_events: 1;
description {
state: "default" 0.0;
rel1 {
relative: 0 0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: 0 0;
}
}
}
part {
name: "hscrollbar";
type: "SWALLOW";
mouse_events: 1;
description {
min: 40 16;
state: "default" 0.0;
rel1 {
relative: 0.0 1.0;
offset: 0 -16;
}
rel2 {
relative: 1.0 1.0;
offset: -16 -1;
}
color: 0 0 0 255;
}
}
part {
name: "vscrollbar";
type: "SWALLOW";
mouse_events: 1;
description {
min: 16 40;
state: "default" 0.0;
rel1 {
relative: 1.0 0.0;
offset: -16 0;
}
rel2 {
relative: 1.0 1.0;
offset: 0 -16;
}
color: 0 0 0 255;
}
}
}
programs {
}
}
group {
name: "fileman/icon";
min: 48 48;
max: 128 128;
parts {
part {
name: "icon_swallow";
type: SWALLOW;
mouse_events: 1;
dragable {
x: 1 1 0;
y: 1 1 0;
}
description {
min: 48 48;
max: 128 128;
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 5 5;
}
rel2 {
relative: 1.0 1.0;
offset: -6 -20;
}
color: 0 0 0 255;
}
}
part {
name: "icon_title";
type: TEXT;
effect: NONE;
description {
rel1 {
relative: 0.0 1.0;
offset: 5 -6;
}
rel2 {
relative: 1.0 1.0;
offset: -6 -6;
}
color: 0 0 0 255;
text {
text: "No Title";
align: 0.0 0.0;
font: "Edje-Vera";
size: 10;
// min: 1 1;
}
}
}
/*
part {
name: "icon_title";
type: TEXTBLOCK;
effect: NONE;
description {
rel1 {
relative: 0.0 1.0;
offset: 5 -20;
}
rel2 {
relative: 1.0 1.0;
offset: -6 1000;
}
color: 0 0 0 255;
//color3: 0 0 0 32;
text {
text: "No Title";
style: "fileman_icon_style";
min: 1 1;
}
}
}
*/
part {
name: "icon_title_edit_swallow";
type: SWALLOW;
effect: NONE;
description {
rel1 {
relative: 0.0 1.0;
offset: 5 -20;
}
rel2 {
relative: 1.0 1.0;
offset: -6 -6;
}
}
}
}
programs {
program {
name: "button_click";
signal: "mouse,down,1";
source: "icon_event";
action: SIGNAL_EMIT "clicked" "";
}
}
}
group {
name: "fileman/properties";
parts {
part {
name: "base";
mouse_events: 0;
type: RECT;
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 1 1;
}
rel2 {
relative: 1.0 1.0;
offset: -2 -2;
}
color: 221 221 221 255;
}
}
part {
name: "conf_bg";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "conf";
offset: -7 -7;
}
rel2 {
to: "conf";
offset: 6 6;
}
image {
normal: "e17_ibar_bg_v.png";
border: 7 7 7 7;
}
}
}
part {
name: "base3";
mouse_events: 0;
description {
state: "default" 0.0;
image {
normal: "e17_menu_bg_border.png";
border: 1 1 1 1;
middle: 0;
}
fill {
smooth: 0;
}
}
}
part {
name: "conf";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
// max: 1000 1000;
min: 200 100;
rel1 {
to_y: "title";
relative: 0.0 1.0;
offset: 8 8;
}
rel2 {
relative: 1.0 1.0;
offset: -9 -9;
}
}
}
part {
name: "watermark";
mouse_events: 0;
description {
state: "default" 0.0;
min: 200 138;
max: 200 138;
align: 1.0 1.0;
fixed: 1 1;
rel1 {
relative: 1.0 1.0;
offset: 29 9;
}
rel2 {
relative: 1.0 1.0;
offset: 29 9;
}
image {
normal: "e17_dialog_watermark.png";
}
}
}
part {
name: "conf_over";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "conf_bg";
}
rel2 {
to: "conf_bg";
}
image {
normal: "e17_ibar_over_v.png";
border: 13 13 13 13;
}
}
}
part {
name: "title";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description {
state: "default" 0.0;
fixed: 0 1;
align: 0.5 0.0;
rel1 {
//to_y: "logo";
relative: 0.0 0.0;
offset: 6 6;
}
rel2 {
//to_y: "logo";
relative: 1.0 0.0;
offset: -7 6;
}
color: 255 255 255 255;
color3: 0 0 0 32;
text {
text: "Title Text";
font: "Edje-Vera-Bold";
size: 14;
min: 0 1;
align: 0.5 0.5;
}
}
}
part {
name: "content_swallow";
type: SWALLOW;
description {
state: "default" 0.0;
align: 0.0 0.5;
color: 0 0 0 0;
rel1 {
to_y: "title";
relative: 0.0 0.0;
offset: 11 11;
to: "conf_bg";
}
rel2 {
relative: 1.0 1.0;
offset: -12 -12;
to: "conf_bg";
}
}
}
}
programs {
}
}
FILEMAN_ICON("folder");
FILEMAN_ICON("file");
FILEMAN_ICON("pdf");
FILEMAN_ICON("c");
FILEMAN_ICON("h");
FILEMAN_ICON("png");
FILEMAN_ICON("jpg");
FULL_SIZE_FILEMAN_BUTTON("open");
FULL_SIZE_FILEMAN_BUTTON("copy");
FULL_SIZE_FILEMAN_BUTTON("cut");
FULL_SIZE_FILEMAN_BUTTON("paste");
FULL_SIZE_FILEMAN_BUTTON("delete");
FULL_SIZE_FILEMAN_BUTTON("rename");
FULL_SIZE_FILEMAN_BUTTON("properties");
FULL_SIZE_FILEMAN_BUTTON("arrange_name");
FULL_SIZE_FILEMAN_BUTTON("arrange");
FULL_SIZE_FILEMAN_BUTTON("arrange_time");
FULL_SIZE_FILEMAN_BUTTON("refresh");
FULL_SIZE_FILEMAN_BUTTON("view_details");
FULL_SIZE_FILEMAN_BUTTON("view_name");
FULL_SIZE_FILEMAN_BUTTON("view");

View File

@ -411,3 +411,22 @@ images {
}
}
}
group {
name: "icons/enlightenment/fileman";
max: 64 64;
parts {
part {
name: "icon";
mouse_events: 0;
description {
state: "default" 0.0;
aspect: 1.0 1.0;
max: 64 64;
image {
normal: "e17_icon_fileman_folder.png";
}
}
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -80,7 +80,9 @@ e_about.h \
e_theme_about.h \
e_apps_cache.h \
e_entry.h \
e_scrollbar.h
e_fileman.h \
e_scrollbar.h \
e_fileman_smart.h
enlightenment_src = \
e_user.c \
@ -142,7 +144,9 @@ e_about.c \
e_theme_about.c \
e_apps_cache.c \
e_entry.c \
e_fileman.c \
e_scrollbar.c \
e_fileman_smart.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_SOURCES = \

143
src/bin/e_fileman.c Normal file
View File

@ -0,0 +1,143 @@
#include "e.h"
/****
* TODO:
* - dont allow for menus on ".."
* - add scrollers.
* - xdnd
* - thumb fork / cache
* - proper mime system
* - create x, y, w, h in canvas struct and make them auto update
* - get_current_dir_name() will give a memleak
****/
static void _e_fileman_hscrollbar_drag_cb (Evas_Object *object, double value, void *data);
static void _e_fileman_vscrollbar_drag_cb (Evas_Object *object, double value, void *data);
static void _e_fileman_cb_resize (E_Win *win);
static void _e_fileman_cb_delete(E_Win *win);
static void _e_fileman_free (E_Fileman *fileman);
static void
_e_fileman_cb_resize (E_Win *win)
{
E_Fileman *fileman;
fileman = win->data;
evas_object_resize (fileman->main, win->w, win->h);
}
static void
_e_fileman_cb_delete(E_Win *win)
{
E_Fileman *fileman;
fileman = win->data;
e_object_del(E_OBJECT(fileman));
e_object_del(E_OBJECT(win));
}
static void
_e_fileman_hscrollbar_drag_cb (Evas_Object *object, double value, void *data)
{
E_Fileman *fileman;
fileman = data;
}
static void
_e_fileman_vscrollbar_drag_cb (Evas_Object *object, double value, void *data)
{
E_Fileman *fileman;
fileman = data;
e_fm_scroll_vertical (fileman->smart, value);
}
E_Fileman *
e_fileman_new (E_Container *con)
{
E_Fileman *fileman;
E_Manager *man;
char *dir;
if (!con)
{
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;
}
fileman = E_OBJECT_ALLOC (E_Fileman, E_FILEMAN_TYPE, _e_fileman_free);
if (!fileman) return NULL;
fileman->con = con;
fileman->win = e_win_new (con);
if (!fileman->win)
{
free (fileman);
return NULL;
}
fileman->xpos = 0;
fileman->ypos = 0;
e_win_delete_callback_set(fileman->win, _e_fileman_cb_delete);
fileman->win->data = fileman;
fileman->evas = e_win_evas_get(fileman->win);
dir = get_current_dir_name();
e_win_name_class_set(fileman->win, "Efm ", "_fileman");
e_win_title_set (fileman->win, dir);
fileman->main = edje_object_add (fileman->evas);
e_theme_edje_object_set(fileman->main, "base/theme/fileman/main",
"fileman/main");
fileman->hscrollbar = e_scrollbar_add (fileman->evas);
e_scrollbar_callback_drag_add (fileman->hscrollbar, _e_fileman_hscrollbar_drag_cb, fileman);
edje_object_part_swallow (fileman->main, "hscrollbar", fileman->hscrollbar);
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);
edje_object_part_swallow (fileman->main, "vscrollbar", fileman->vscrollbar);
e_win_resize_callback_set (fileman->win, _e_fileman_cb_resize);
e_win_resize (fileman->win, 640, 480);
fileman->smart = e_fm_add(fileman->evas);
e_fm_e_win_set (fileman->smart, fileman->win);
e_fm_dir_set (fileman->smart, dir);
free(dir);
edje_object_part_swallow (fileman->main, "icon_area", fileman->smart);
ecore_x_dnd_aware_set(fileman->win->evas_win, 1);
return fileman;
}
static void
_e_fileman_free(E_Fileman *fileman)
{
evas_object_del(fileman->hscrollbar);
evas_object_del(fileman->vscrollbar);
evas_object_del(fileman->smart);
evas_object_del(fileman->main);
e_object_del(E_OBJECT(fileman->win));
free(fileman);
}
void
e_fileman_show (E_Fileman *fileman)
{
if (fileman) {
e_win_show(fileman->win);
evas_object_show(fileman->main);
}
}

33
src/bin/e_fileman.h Normal file
View File

@ -0,0 +1,33 @@
#ifdef E_TYPEDEFS
typedef struct _E_Fileman E_Fileman;
#else
#ifndef E_FILEMAN_H
#define E_FILEMAN_H
#define E_FILEMAN_TYPE 0xE0b01016
struct _E_Fileman
{
E_Object e_obj_inherit;
E_Container *con;
E_Win *win;
Evas *evas;
Evas_Object *main;
Evas_Object *hscrollbar;
Evas_Object *vscrollbar;
Evas_Object *smart;
double xpos;
double ypos;
};
EAPI E_Fileman *e_fileman_new ();
EAPI void e_fileman_show (E_Fileman *fileman);
#endif
#endif

2568
src/bin/e_fileman_smart.c Normal file

File diff suppressed because it is too large Load Diff

20
src/bin/e_fileman_smart.h Normal file
View File

@ -0,0 +1,20 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_FM_SMART_H
#define E_FM_SMART_H
EAPI Evas_Object *e_fm_add(Evas *evas);
EAPI char *e_fm_dir_get(Evas_Object *object);
EAPI void e_fm_dir_set(Evas_Object *object, const char *dir);
EAPI void e_fm_e_win_set(Evas_Object *object, E_Win *win);
EAPI E_Win *e_fm_e_win_get(Evas_Object *object);
EAPI void e_fm_menu_set(Evas_Object *object, E_Menu *menu);
EAPI E_Menu *e_fm_menu_get(Evas_Object *object);
EAPI void e_fm_scroll_horizontal(Evas_Object *object, double percent);
EAPI void e_fm_scroll_vertical(Evas_Object *object, double percent);
#endif
#endif

View File

@ -62,3 +62,5 @@
#include "e_theme_about.h"
#include "e_apps_cache.h"
#include "e_scrollbar.h"
#include "e_fileman.h"
#include "e_fileman_smart.h"

View File

@ -32,6 +32,7 @@ static void _e_int_menus_apps_start (void *data, E_Menu *m);
static void _e_int_menus_apps_del_hook (void *obj);
static void _e_int_menus_apps_free_hook (void *obj);
static void _e_int_menus_apps_run (void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_int_menus_main_fm(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_int_menus_config_pre_cb (void *data, E_Menu *m);
static void _e_int_menus_config_free_hook (void *obj);
static void _e_int_menus_config_item_cb (void *data, E_Menu *m, E_Menu_Item *mi);
@ -140,9 +141,14 @@ e_int_menus_main_new(void)
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("Run Command"));
e_util_menu_item_edje_icon_set(mi, "enlightenment/run");
e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL);
e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL);
}
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("File Manager"));
e_util_menu_item_edje_icon_set(mi, "enlightenment/fileman");
e_menu_item_callback_set(mi, _e_int_menus_main_fm, NULL);
subm = e_int_menus_config_new();
dat->config = subm;
mi = e_menu_item_new(m);
@ -377,6 +383,15 @@ _e_int_menus_main_run(void *data, E_Menu *m, E_Menu_Item *mi)
if (exe) ecore_exe_free(exe);
}
static void
_e_int_menus_main_fm(void *data, E_Menu *m, E_Menu_Item *mi)
{
E_Fileman *fileman;
fileman = e_fileman_new (m->zone->container);
e_fileman_show (fileman);
}
static void
_e_int_menus_main_restart(void *data, E_Menu *m, E_Menu_Item *mi)
{