work on the fm - no more segv if no Desktop dir - i hope

SVN revision: 30041
This commit is contained in:
Carsten Haitzler 2007-05-20 08:41:36 +00:00
parent 323620e492
commit d4b9eaa1ae
6 changed files with 922 additions and 123 deletions

40
TODO
View File

@ -28,11 +28,6 @@ Some of the things (in very short form) that need to be done to E17...
instead of in a straight line instead of in a straight line
* exebuf on other zones doesn't allow mouse to work properly (only * exebuf on other zones doesn't allow mouse to work properly (only
zone/screen 0 works properly) zone/screen 0 works properly)
* sometimes file monitoring for file changes, adds, deletes on a dir stops
working all of a sudden - unknown what causes it and why right now.
* e_apps wont pick up changes in favorite menu dirs made by the applications
config dialog after a while (i think once u get 1 app in it stops listening).
possibly the same bug as above with e_fm...
* Need global unique identifier for gadcons, so that their config will move * Need global unique identifier for gadcons, so that their config will move
with them from one shelf to another. with them from one shelf to another.
]]] ]]]
@ -43,26 +38,42 @@ Some of the things (in very short form) that need to be done to E17...
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
* fm2 fwin windows need to use icon for that dir on window * fm2 fwin windows need to use icon for that dir on window
* create a good app repository where the user can get applications from to ibar * fm2 needs to use different theme elements for desktop
* fm2 needs its fops to become async (in slave process and ipc to it) * fm2 theme needs to not suck
* fm2 needs its file listing/stat()ing etc. to go into slave proc * fm2 custom icon view mode needs to have cleanup,align etc.
* fm2 needs a right-click file properties dialog * fm2 custom icon view mode initial placement needs tome fixing
* fm2 fwin needs options for view mode
* fm2 needs a way to specify a multiplier, explicit size or "use original icon"
config per icon and per dir
* fm2 needs to fix its custom file info
* fm2 should remember scroll pos per dir
* fwin should have option to display full path
* fm2 thumbnails - should display an icon while generating thumb
* fm2 needs to be able to handle signals from the fm fwin theme wallpaper and
overlay - to exec or do things (eg go to parent)
* fm2 needs option to scale custom pos for icons (eg desktop)
* fm2 on desktop needs option to turn off and select which dir on which zone
* fm2 needs to show icons again if drag was aborted
* fm2 needs to handle dnd of e apps too
* fm2 slave needs to rate limit file changes/adds/dels
* need a default desktop file setup
* fm2 needs to auto-scroll if dnd hovers on edge of fm2 for a while
* fm2 needs spring-loaded folder opens
* fm2 needs to be able to specify dir customisations other than magic dot file
* fm2 needs to move, rename, delete etc. custom info correctly so it mimicks
the fs
* fm2 needs rubber band select in icon mode
* fm2 needs to display symlink info on files somehow * fm2 needs to display symlink info on files somehow
* fm2 needs to display more than 1 file being dragged (if more than 1 is being * fm2 needs to display more than 1 file being dragged (if more than 1 is being
dragged) dragged)
* fm2 needs a way of mapping a internal e actions to do (like add as * fm2 needs a way of mapping a internal e actions to do (like add as
wallpaper etc.) wallpaper etc.)
* fm2 needs a way to use custom icons per dir/file
* fm2 needs a way to bypass thumb gen anim on just a unrealize/realize as well * fm2 needs a way to bypass thumb gen anim on just a unrealize/realize as well
as change state instantly if it already was selected as change state instantly if it already was selected
* fm2 needs to not unrealize then re-realize on resort/arraneg - keep objects * fm2 needs to not unrealize then re-realize on resort/arraneg - keep objects
around. around.
* fm2 needs a mime/extension/glob filter * fm2 needs a mime/extension/glob filter
* fm2 will pop up tonnes of error dialogs if u try delete a lot of files in a
tree you can't delete - fix to make this a dialog with a log etc.
* dnd needs to do xdnd properly. * dnd needs to do xdnd properly.
* fm2 needs icon views (auto-arrange, snap to grid and free placement), for
fwin windows and the desktop
* language packs: need to have a tool to load/setup a language pack (which * language packs: need to have a tool to load/setup a language pack (which
means .mo compiled files from a .po, an optional font and a config file that means .mo compiled files from a .po, an optional font and a config file that
specifies the locale and font) and then install the font(s) either as a user specifies the locale and font) and then install the font(s) either as a user
@ -137,7 +148,6 @@ Some of the things (in very short form) that need to be done to E17...
that overlay the screen that overlay the screen
* pager should be able to be configured to control more than the current zone * pager should be able to be configured to control more than the current zone
(select which zone they control) (select which zone they control)
* icons for all config panel items
* icons for most mime types * icons for most mime types
]]] ]]]

View File

@ -6000,6 +6000,727 @@ group {
} }
} }
group {
name: "e/fileman/scrollframe/desktop";
parts {
/*
part {
name: "bg";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
color: 255 255 255 255;
}
}
*/
part {
name: "clipper";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
// to: "bg";
}
rel2 {
// to: "bg";
}
}
}
part {
name: "e.swallow.content";
clip_to: "clipper";
type: SWALLOW;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel2 {
relative: 0.0 0.0;
offset: -1 -1;
to_x: "sb_vbar";
to_y: "sb_hbar";
}
}
}
part {
name: "conf_over";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
// to: "bg";
offset: -5 -5;
}
rel2 {
// to: "bg";
offset: 4 4;
}
image {
normal: "e17_ibar_over_v.png";
border: 13 13 13 13;
middle: 0;
}
fill {
smooth : 0;
}
}
}
part {
name: "sb_vbar";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
min: 16 16;
align: 1.0 0.0;
rel1 {
// to: "bg";
relative: 1.0 0.0;
offset: -1 0;
}
rel2 {
// to: "bg";
relative: 1.0 0.0;
offset: -1 -1;
to_y: "sb_hbar";
}
}
description {
state: "hidden" 0.0;
visible: 0;
max: 0 99999;
rel1 {
// to: "bg";
relative: 1.0 0.0;
offset: 0 0;
}
rel2 {
// to: "bg";
relative: 1.0 0.0;
offset: 0 -1;
to_y: "sb_hbar";
}
}
}
part {
name: "sb_vbar_base";
type: RECT;
clip_to: "sb_vbar";
mouse_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 0.0 1.0;
offset: 0 0;
to: "sb_vbar_a1";
}
rel2 {
relative: 1.0 0.0;
offset: -1 -1;
to: "sb_vbar_a2";
}
}
}
part {
name: "sb_vbar_runner";
clip_to: "sb_vbar";
mouse_events: 0;
description {
state: "default" 0.0;
max: 2 99999;
rel1 {
to: "sb_vbar_base";
}
rel2 {
to: "sb_vbar_base";
}
image {
normal: "e17_sb_runnerv.png";
border: 0 0 4 4;
}
fill {
smooth: 0;
}
}
}
part {
name: "sb_vbar_p1";
type: RECT;
clip_to: "sb_vbar";
mouse_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 0.0 1.0;
offset: 0 0;
to: "sb_vbar_a1";
}
rel2 {
relative: 1.0 0.0;
offset: -1 -1;
to: "e.dragable.vbar";
}
}
}
part {
name: "sb_vbar_p2";
type: RECT;
clip_to: "sb_vbar";
mouse_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 0.0 1.0;
offset: 0 0;
to: "e.dragable.vbar";
}
rel2 {
relative: 1.0 0.0;
offset: -1 -1;
to: "sb_vbar_a2";
}
}
}
part {
name: "e.dragable.vbar";
clip_to: "sb_vbar";
mouse_events: 1;
dragable {
x: 0 0 0;
y: 1 1 0;
confine: "sb_vbar_base";
}
description {
state: "default" 0.0;
min: 16 16;
rel1 {
relative: 0.5 0.5;
offset: 0 0;
to: "sb_vbar_base";
}
rel2 {
relative: 0.5 0.5;
offset: 0 0;
to: "sb_vbar_base";
}
image {
normal: "e17_sb_barv1.png";
border: 5 5 5 5;
}
}
description {
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_sb_barv2.png";
}
}
}
part {
name: "vbar_bar_thumb";
clip_to: "sb_vbar";
mouse_events: 0;
description {
state: "default" 0.0;
max: 8 8;
min: 8 8;
rel1 {
to: "e.dragable.vbar";
}
rel2 {
to: "e.dragable.vbar";
}
image {
normal: "e17_scrollbar_vdrag_thumb.png";
}
}
}
part {
name: "sb_vbar_a1";
type: IMAGE;
mouse_events: 1;
clip_to: "sb_vbar";
description {
state: "default" 0.0;
align: 0.5 0.0;
aspect: 1.0 1.0;
aspect_preference: HORIZONTAL;
rel1 {
to: "sb_vbar";
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
to: "sb_vbar";
relative: 1.0 0.0;
offset: -1 0;
}
image {
normal: "e17_sb_btu1.png";
}
}
description {
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_sb_btu2.png";
}
}
}
part {
name: "sb_vbar_a2";
type: IMAGE;
mouse_events: 1;
clip_to: "sb_vbar";
description {
state: "default" 0.0;
align: 0.5 1.0;
aspect: 1.0 1.0;
aspect_preference: HORIZONTAL;
rel1 {
to: "sb_vbar";
relative: 0.0 1.0;
offset: 0 -1;
}
rel2 {
to: "sb_vbar";
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "e17_sb_btd1.png";
}
}
description {
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_sb_btd2.png";
}
}
}
part {
name: "sb_hbar";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
min: 16 16;
align: 0.0 1.0;
rel1 {
// to: "bg";
relative: 0.0 1.0;
offset: 0 -1;
}
rel2 {
// to: "bg";
relative: 0.0 1.0;
offset: -1 -1;
to_x: "sb_vbar";
}
}
description {
state: "hidden" 0.0;
visible: 0;
rel1 {
// to: "bg";
relative: 0.0 1.0;
offset: 0 0;
}
rel2 {
// to: "bg";
relative: 0.0 1.0;
offset: -1 0;
to_x: "sb_vbar";
}
}
}
part {
name: "sb_hbar_base";
type: RECT;
clip_to: "sb_hbar";
mouse_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 1.0 0.0;
offset: 0 0;
to: "sb_hbar_a1";
}
rel2 {
relative: 0.0 1.0;
offset: -1 -1;
to: "sb_hbar_a2";
}
}
}
part {
name: "sb_hbar_runner";
clip_to: "sb_hbar";
mouse_events: 0;
description {
state: "default" 0.0;
max: 99999 2;
rel1 {
to: "sb_hbar_base";
}
rel2 {
to: "sb_hbar_base";
}
image {
normal: "e17_sb_runnerh.png";
border: 4 4 0 0;
}
fill {
smooth: 0;
}
}
}
part {
name: "sb_hbar_p1";
type: RECT;
clip_to: "sb_hbar";
mouse_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 1.0 0.0;
offset: 0 0;
to: "sb_hbar_a1";
}
rel2 {
relative: 0.0 1.0;
offset: -1 -1;
to: "e.dragable.hbar";
}
}
}
part {
name: "sb_hbar_p2";
type: RECT;
clip_to: "sb_hbar";
mouse_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
rel1 {
relative: 1.0 0.0;
offset: 0 0;
to: "e.dragable.hbar";
}
rel2 {
relative: 0.0 1.0;
offset: -1 -1;
to: "sb_hbar_a2";
}
}
}
part {
name: "e.dragable.hbar";
clip_to: "sb_hbar";
mouse_events: 1;
dragable {
x: 1 1 0;
y: 0 0 0;
confine: "sb_hbar_base";
}
description {
state: "default" 0.0;
min: 16 16;
rel1 {
relative: 0.5 0.5;
offset: 0 0;
to: "sb_hbar_base";
}
rel2 {
relative: 0.5 0.5;
offset: 0 0;
to: "sb_hbar_base";
}
image {
normal: "e17_sb_barh1.png";
border: 5 5 5 5;
}
}
description {
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_sb_barh2.png";
}
}
}
part {
name: "hbar_bar_thumb";
clip_to: "sb_hbar";
mouse_events: 0;
description {
state: "default" 0.0;
max: 8 8;
min: 8 8;
rel1 {
to: "e.dragable.hbar";
}
rel2 {
to: "e.dragable.hbar";
}
image {
normal: "e17_scrollbar_hdrag_thumb.png";
}
}
}
part {
name: "sb_hbar_a1";
type: IMAGE;
mouse_events: 1;
clip_to: "sb_hbar";
description {
state: "default" 0.0;
align: 0.0 0.5;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
rel1 {
to: "sb_hbar";
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
to: "sb_hbar";
relative: 0.0 1.0;
offset: 0 -1;
}
image {
normal: "e17_sb_btl1.png";
}
}
description {
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_sb_btl2.png";
}
}
}
part {
name: "sb_hbar_a2";
type: IMAGE;
mouse_events: 1;
clip_to: "sb_hbar";
description {
state: "default" 0.0;
align: 1.0 0.5;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
rel1 {
to: "sb_hbar";
relative: 1.0 0.0;
offset: -1 0;
}
rel2 {
to: "sb_hbar";
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "e17_sb_btr1.png";
}
}
description {
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_sb_btr2.png";
}
}
}
part {
name: "e.swallow.overlay";
type: SWALLOW;
mouse_events: 0;
description {
state: "default" 0.0;
}
}
}
programs {
program {
name: "sb_vbar_show";
signal: "e,action,show,vbar";
source: "e";
action: STATE_SET "default" 0.0;
target: "sb_vbar";
}
program {
name: "sb_vbar_hide";
signal: "e,action,hide,vbar";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "sb_vbar";
}
program {
name: "sb_hbar_show";
signal: "e,action,show,hbar";
source: "e";
action: STATE_SET "default" 0.0;
target: "sb_hbar";
}
program {
name: "sb_hbar_hide";
signal: "e,action,hide,hbar";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "sb_hbar";
}
program {
name: "sb_vbar_a1_down";
signal: "mouse,down,1";
source: "sb_vbar_a1";
action: STATE_SET "clicked" 0.0;
target: "sb_vbar_a1";
}
program {
name: "sb_vbar_a1_down2";
signal: "mouse,down,1";
source: "sb_vbar_a1";
action: DRAG_VAL_STEP 0.0 -1.0;
target: "e.dragable.vbar";
}
program {
name: "sb_vbar_a1_up";
signal: "mouse,up,1";
source: "sb_vbar_a1";
action: STATE_SET "default" 0.0;
target: "sb_vbar_a1";
}
program {
name: "sb_vbar_a2_down";
signal: "mouse,down,1";
source: "sb_vbar_a2";
action: STATE_SET "clicked" 0.0;
target: "sb_vbar_a2";
}
program {
name: "sb_vbar_a2_down2";
signal: "mouse,down,1";
source: "sb_vbar_a2";
action: DRAG_VAL_STEP 0.0 1.0;
target: "e.dragable.vbar";
}
program {
name: "sb_vbar_a2_up";
signal: "mouse,up,1";
source: "sb_vbar_a2";
action: STATE_SET "default" 0.0;
target: "sb_vbar_a2";
}
program {
name: "sb_vbar_p1_down";
signal: "mouse,down,1";
source: "sb_vbar_p1";
action: DRAG_VAL_PAGE 0.0 -1.0;
target: "e.dragable.vbar";
}
program {
name: "sb_vbar_p2_down";
signal: "mouse,down,1";
source: "sb_vbar_p2";
action: DRAG_VAL_PAGE 0.0 1.0;
target: "e.dragable.vbar";
}
program {
name: "sb_vbar_down";
signal: "mouse,down,1";
source: "e.dragable.vbar";
action: STATE_SET "clicked" 0.0;
target: "e.dragable.vbar";
}
program {
name: "sb_vbar_up";
signal: "mouse,up,1";
source: "e.dragable.vbar";
action: STATE_SET "default" 0.0;
target: "e.dragable.vbar";
}
program {
name: "sb_hbar_a1_down";
signal: "mouse,down,1";
source: "sb_hbar_a1";
action: STATE_SET "clicked" 0.0;
target: "sb_hbar_a1";
}
program {
name: "sb_hbar_a1_down2";
signal: "mouse,down,1";
source: "sb_hbar_a1";
action: DRAG_VAL_STEP -1.0 0.0;
target: "e.dragable.hbar";
}
program {
name: "sb_hbar_a1_up";
signal: "mouse,up,1";
source: "sb_hbar_a1";
action: STATE_SET "default" 0.0;
target: "sb_hbar_a1";
}
program {
name: "sb_hbar_a2_down";
signal: "mouse,down,1";
source: "sb_hbar_a2";
action: STATE_SET "clicked" 0.0;
target: "sb_hbar_a2";
}
program {
name: "sb_hbar_a2_down2";
signal: "mouse,down,1";
source: "sb_hbar_a2";
action: DRAG_VAL_STEP 1.0 0.0;
target: "e.dragable.hbar";
}
program {
name: "sb_hbar_a2_up";
signal: "mouse,up,1";
source: "sb_hbar_a2";
action: STATE_SET "default" 0.0;
target: "sb_hbar_a2";
}
program {
name: "sb_hbar_p1_down";
signal: "mouse,down,1";
source: "sb_hbar_p1";
action: DRAG_VAL_PAGE -1.0 0.0;
target: "e.dragable.hbar";
}
program {
name: "sb_hbar_p2_down";
signal: "mouse,down,1";
source: "sb_hbar_p2";
action: DRAG_VAL_PAGE 1.0 0.0;
target: "e.dragable.hbar";
}
program {
name: "sb_hbar_down";
signal: "mouse,down,1";
source: "e.dragable.hbar";
action: STATE_SET "clicked" 0.0;
target: "e.dragable.hbar";
}
program {
name: "sb_hbar_up";
signal: "mouse,up,1";
source: "e.dragable.hbar";
action: STATE_SET "default" 0.0;
target: "e.dragable.hbar";
}
}
}

View File

@ -526,6 +526,12 @@ e_fm2_custom_theme_set(Evas_Object *obj, const char *path)
sd->custom_theme = evas_stringshare_add(path); sd->custom_theme = evas_stringshare_add(path);
else else
sd->custom_theme = NULL; sd->custom_theme = NULL;
_e_fm2_theme_edje_object_set(sd, sd->drop, "base/theme/fileman",
"e/fileman/list/drop_between");
_e_fm2_theme_edje_object_set(sd, sd->drop_in, "base/theme/fileman",
"e/fileman/list/drop_in");
_e_fm2_theme_edje_object_set(sd, sd->overlay, "base/theme/fileman",
"e/fileman/overlay");
} }
EAPI void EAPI void
@ -1890,10 +1896,12 @@ _e_fm2_dev_path_map(const char *dev, const char *path)
if (!strcmp(path, "/")) if (!strcmp(path, "/"))
{ {
PRT("%s/Desktop", s); PRT("%s/Desktop", s);
ecore_file_mkpath(buf);
} }
else else
{ {
PRT("%s/Desktop-%s", s, path); PRT("%s/Desktop-%s", s, path);
ecore_file_mkpath(buf);
} }
} }
else if (CMP("dvd") || CMP("dvd-*")) { else if (CMP("dvd") || CMP("dvd-*")) {
@ -6502,7 +6510,6 @@ _e_fm2_theme_edje_object_set(E_Fm2_Smart_Data *sd, Evas_Object *o, const char *c
{ {
if (sd->custom_theme) if (sd->custom_theme)
{ {
/* FIXME: need a way of caching what elements are and are not in the custom theme */
if (edje_object_file_set(o, sd->custom_theme, group)) return 1; if (edje_object_file_set(o, sd->custom_theme, group)) return 1;
} }
if (sd->custom_theme) if (sd->custom_theme)

View File

@ -36,9 +36,11 @@
#define DEF_SYNC_NUM 8 #define DEF_SYNC_NUM 8
#define DEF_ROUND_TRIP 0.05 #define DEF_ROUND_TRIP 0.05
#define DEF_ROUND_TRIP_TOLERANCE 0.01 #define DEF_ROUND_TRIP_TOLERANCE 0.01
#define DEF_MOD_BACKOFF 0.2
typedef struct _E_Dir E_Dir; typedef struct _E_Dir E_Dir;
typedef struct _E_Fop E_Fop; typedef struct _E_Fop E_Fop;
typedef struct _E_Mod E_Mod;
struct _E_Dir struct _E_Dir
{ {
@ -53,6 +55,9 @@ struct _E_Dir
int sync; int sync;
double sync_time; double sync_time;
int sync_num; int sync_num;
Evas_List *recent_mods;
Ecore_Timer *recent_clean;
unsigned char cleaning : 1;
}; };
struct _E_Fop struct _E_Fop
@ -69,6 +74,16 @@ struct _E_Fop
void *data; void *data;
}; };
struct _E_Mod
{
const char *path;
double timestamp;
unsigned char add : 1;
unsigned char del : 1;
unsigned char mod : 1;
unsigned char done : 1;
};
/* local subsystem functions */ /* local subsystem functions */
static int _e_ipc_init(void); static int _e_ipc_init(void);
static int _e_ipc_cb_server_add(void *data, int type, void *event); static int _e_ipc_cb_server_add(void *data, int type, void *event);
@ -76,12 +91,13 @@ static int _e_ipc_cb_server_del(void *data, int type, void *event);
static int _e_ipc_cb_server_data(void *data, int type, void *event); static int _e_ipc_cb_server_data(void *data, int type, void *event);
static void _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path); static void _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path);
static int _e_cb_recent_clean(void *data);
static void _e_file_add_mod(int id, const char *path, int op, int listing); static void _e_file_add_mod(E_Dir *ed, const char *path, int op, int listing);
static void _e_file_add(int id, const char *path, int listing); static void _e_file_add(E_Dir *ed, const char *path, int listing);
static void _e_file_del(int id, const char *path); static void _e_file_del(E_Dir *ed, const char *path);
static void _e_file_mod(int id, const char *path); static void _e_file_mod(E_Dir *ed, const char *path);
static void _e_file_mon_dir_del(int id, const char *path); static void _e_file_mon_dir_del(E_Dir *ed, const char *path);
static void _e_file_mon_list_sync(E_Dir *ed); static void _e_file_mon_list_sync(E_Dir *ed);
static int _e_cb_file_mon_list_idler(void *data); static int _e_cb_file_mon_list_idler(void *data);
@ -91,6 +107,7 @@ static int _e_cb_fop_mv_idler(void *data);
static int _e_cb_fop_cp_idler(void *data); static int _e_cb_fop_cp_idler(void *data);
static char *_e_str_list_remove(Evas_List **list, char *str); static char *_e_str_list_remove(Evas_List **list, char *str);
static void _e_path_fix_order(const char *path, const char *rel, int rel_to, int x, int y); static void _e_path_fix_order(const char *path, const char *rel, int rel_to, int x, int y);
static void _e_dir_del(E_Dir *ed);
/* local subsystem globals */ /* local subsystem globals */
static Ecore_Ipc_Server *_e_ipc_server = NULL; static Ecore_Ipc_Server *_e_ipc_server = NULL;
@ -224,9 +241,13 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
dir = opendir(e->data); dir = opendir(e->data);
if (!dir) if (!dir)
{ {
E_Dir ted;
/* we can't open the dir - tell E the dir is deleted as /* we can't open the dir - tell E the dir is deleted as
* we can't look in it */ * we can't look in it */
_e_file_mon_dir_del(e->ref, e->data); memset(&ted, 0, sizeof(E_Dir));
ted.id = e->ref;
_e_file_mon_dir_del(&ted, e->data);
} }
else else
{ {
@ -244,13 +265,11 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
{ {
/* if no previous monitoring dir exists - this one /* if no previous monitoring dir exists - this one
* becomes the master monitor enty */ * becomes the master monitor enty */
printf("MON %s\n", ed->dir);
ed->mon = ecore_file_monitor_add(ed->dir, _e_cb_file_monitor, ed); ed->mon = ecore_file_monitor_add(ed->dir, _e_cb_file_monitor, ed);
ed->mon_ref = 1; ed->mon_ref = 1;
} }
else else
{ {
printf("REF ORIG\n");
/* an existing monitor exists - ref it up */ /* an existing monitor exists - ref it up */
ed->mon_real = ped; ed->mon_real = ped;
ped->mon_ref++; ped->mon_ref++;
@ -296,6 +315,7 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
files = f2; files = f2;
} }
} }
ed->fq = files;
/* FIXME: if .order file- load it, sort all items int it /* FIXME: if .order file- load it, sort all items int it
* that are in files then just append whatever is left in * that are in files then just append whatever is left in
* alphabetical order * alphabetical order
@ -314,14 +334,13 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
else else
snprintf(buf, sizeof(buf), "%s/.order", (char *)e->data); snprintf(buf, sizeof(buf), "%s/.order", (char *)e->data);
if (evas_list_count(files) == 1) if (evas_list_count(files) == 1)
_e_file_add(ed->id, buf, 2); _e_file_add(ed, buf, 2);
else else
_e_file_add(ed->id, buf, 1); _e_file_add(ed, buf, 1);
} }
/* send empty file - indicate empty dir */ /* send empty file - indicate empty dir */
if (!files) _e_file_add(ed->id, "", 2); if (!files) _e_file_add(ed, "", 2);
/* and in an idler - list files, statting them etc. */ /* and in an idler - list files, statting them etc. */
ed->fq = files;
ed->idler = ecore_idler_add(_e_cb_file_mon_list_idler, ed); ed->idler = ecore_idler_add(_e_cb_file_mon_list_idler, ed);
ed->sync_num = DEF_SYNC_NUM; ed->sync_num = DEF_SYNC_NUM;
} }
@ -343,56 +362,24 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
* real one */ * real one */
if (ed->mon_real) if (ed->mon_real)
{ {
printf("UNREF ORIG\n");
/* unref original monitor node */ /* unref original monitor node */
ed->mon_real->mon_ref--; ed->mon_real->mon_ref--;
if (ed->mon_real->mon_ref == 0) if (ed->mon_real->mon_ref == 0)
{ {
printf("FREE ORIG\n");
/* original is at 0 ref - free it */ /* original is at 0 ref - free it */
evas_stringshare_del(ed->mon_real->dir); _e_dir_del(ed->mon_real);
if (ed->mon_real->idler)
ecore_idler_del(ed->mon_real->idler);
while (ed->mon_real->fq)
{
free(ed->mon_real->fq->data);
ed->mon_real->fq = evas_list_remove_list(ed->mon_real->fq, ed->mon_real->fq);
}
free(ed->mon_real);
ed->mon_real = NULL; ed->mon_real = NULL;
} }
printf("FREE THIS\n");
/* free this node */ /* free this node */
evas_stringshare_del(ed->dir); _e_dir_del(ed);
if (ed->idler) ecore_idler_del(ed->idler);
while (ed->fq)
{
free(ed->fq->data);
ed->fq = evas_list_remove_list(ed->fq, ed->fq);
}
free(ed);
} }
/* this is a core monitoring node - remove ref */ /* this is a core monitoring node - remove ref */
else else
{ {
printf("UNREF\n");
ed->mon_ref--; ed->mon_ref--;
/* we are the last ref - free */ /* we are the last ref - free */
if (ed->mon_ref == 0) if (ed->mon_ref == 0) _e_dir_del(ed);
{
printf("UNMON %s\n", ed->dir);
ecore_file_monitor_del(ed->mon);
evas_stringshare_del(ed->dir);
if (ed->idler) ecore_idler_del(ed->idler);
while (ed->fq)
{
free(ed->fq->data);
ed->fq = evas_list_remove_list(ed->fq, ed->fq);
}
free(ed);
}
} }
printf("REMOVE FROM LIST\n");
/* remove from dirs list anyway */ /* remove from dirs list anyway */
_e_dirs = evas_list_remove_list(_e_dirs, l); _e_dirs = evas_list_remove_list(_e_dirs, l);
break; break;
@ -593,17 +580,13 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
if ((event == ECORE_FILE_EVENT_CREATED_FILE) || if ((event == ECORE_FILE_EVENT_CREATED_FILE) ||
(event == ECORE_FILE_EVENT_CREATED_DIRECTORY)) (event == ECORE_FILE_EVENT_CREATED_DIRECTORY))
{ {
printf("CREATE %s\n", path);
rp = ecore_file_realpath(dir); rp = ecore_file_realpath(dir);
for (l = _e_dirs; l; l = l->next) for (l = _e_dirs; l; l = l->next)
{ {
ed = l->data; ed = l->data;
drp = ecore_file_realpath(ed->dir); drp = ecore_file_realpath(ed->dir);
if (!strcmp(rp, drp)) if (!strcmp(rp, drp))
{ _e_file_add(ed, path, 0);
printf("file add %s\n", path);
_e_file_add(ed->id, path, 0);
}
free(drp); free(drp);
} }
free(rp); free(rp);
@ -611,14 +594,13 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
else if ((event == ECORE_FILE_EVENT_DELETED_FILE) || else if ((event == ECORE_FILE_EVENT_DELETED_FILE) ||
(event == ECORE_FILE_EVENT_DELETED_DIRECTORY)) (event == ECORE_FILE_EVENT_DELETED_DIRECTORY))
{ {
printf("DEL %s\n", path);
rp = ecore_file_realpath(dir); rp = ecore_file_realpath(dir);
for (l = _e_dirs; l; l = l->next) for (l = _e_dirs; l; l = l->next)
{ {
ed = l->data; ed = l->data;
drp = ecore_file_realpath(ed->dir); drp = ecore_file_realpath(ed->dir);
if (!strcmp(rp, drp)) if (!strcmp(rp, drp))
_e_file_del(ed->id, path); _e_file_del(ed, path);
} }
free(rp); free(rp);
} }
@ -630,7 +612,7 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
ed = l->data; ed = l->data;
drp = ecore_file_realpath(ed->dir); drp = ecore_file_realpath(ed->dir);
if (!strcmp(rp, drp)) if (!strcmp(rp, drp))
_e_file_mod(ed->id, path); _e_file_mod(ed, path);
} }
free(rp); free(rp);
} }
@ -642,15 +624,46 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
ed = l->data; ed = l->data;
drp = ecore_file_realpath(ed->dir); drp = ecore_file_realpath(ed->dir);
if (!strcmp(rp, drp)) if (!strcmp(rp, drp))
_e_file_mon_dir_del(ed->id, path); _e_file_mon_dir_del(ed, path);
} }
free(rp); free(rp);
} }
free(dir); free(dir);
} }
static int
_e_cb_recent_clean(void *data)
{
E_Dir *ed;
Evas_List *l, *pl;
E_Mod *m;
double t_now;
ed = data;
ed->cleaning = 1;
t_now = ecore_time_get();
for (l = ed->recent_mods; l;)
{
m = l->data;
pl = l;
l = l->next;
if ((m->mod) && ((t_now - m->timestamp) >= DEF_MOD_BACKOFF))
{
ed->recent_mods = evas_list_remove_list(ed->recent_mods, pl);
if (!m->done) _e_file_add_mod(ed, m->path, 5, 0);
evas_stringshare_del(m->path);
free(m);
}
}
ed->cleaning = 0;
if (ed->recent_mods) return 1;
ed->recent_clean = NULL;
return 0;
}
static void static void
_e_file_add_mod(int id, const char *path, int op, int listing) _e_file_add_mod(E_Dir *ed, const char *path, int op, int listing)
{ {
struct stat st; struct stat st;
char *lnk = NULL, *rlnk = NULL; char *lnk = NULL, *rlnk = NULL;
@ -661,7 +674,46 @@ _e_file_add_mod(int id, const char *path, int op, int listing)
* *
* stat_info[stat size] + broken_link[1] + path[n]\0 + lnk[n]\0 + rlnk[n]\0 */ * stat_info[stat size] + broken_link[1] + path[n]\0 + lnk[n]\0 + rlnk[n]\0 */
[sizeof(struct stat) + 1 + 4096 + 4096 + 4096]; [sizeof(struct stat) + 1 + 4096 + 4096 + 4096];
/* FIXME: handle BACKOFF */
if ((!listing) && (op == 5) && (!ed->cleaning)) /* 5 == mod */
{
Evas_List *l;
E_Mod *m;
double t_now;
int skip = 0;
t_now = ecore_time_get();
for (l = ed->recent_mods; l; l = l->next)
{
m = l->data;
if ((m->mod) && (!strcmp(m->path, path)))
{
if ((t_now - m->timestamp) < DEF_MOD_BACKOFF)
{
m->done = 0;
skip = 1;
}
}
}
if (!skip)
{
m = calloc(1, sizeof(E_Mod));
m->path = evas_stringshare_add(path);
m->mod = 1;
m->done = 1;
m->timestamp = t_now;
ed->recent_mods = evas_list_append(ed->recent_mods, m);
}
if ((!ed->recent_clean) && (ed->recent_mods))
ed->recent_clean = ecore_timer_add(DEF_MOD_BACKOFF, _e_cb_recent_clean, ed);
if (skip)
{
// printf("SKIP MOD %s %3.3f\n", path, t_now);
return;
}
}
// printf("MOD %s %3.3f\n", path, ecore_time_get());
lnk = ecore_file_readlink(path); lnk = ecore_file_readlink(path);
if (stat(path, &st) == -1) if (stat(path, &st) == -1)
{ {
@ -694,40 +746,50 @@ _e_file_add_mod(int id, const char *path, int op, int listing)
p += strlen(rlnk) + 1; p += strlen(rlnk) + 1;
bsz = p - buf; bsz = p - buf;
ecore_ipc_server_send(_e_ipc_server, 6/*E_IPC_DOMAIN_FM*/, op, 0, id, ecore_ipc_server_send(_e_ipc_server, 6/*E_IPC_DOMAIN_FM*/, op, 0, ed->id,
listing, buf, bsz); listing, buf, bsz);
if (lnk) free(lnk); if (lnk) free(lnk);
if (rlnk) free(rlnk); if (rlnk) free(rlnk);
} }
static void static void
_e_file_add(int id, const char *path, int listing) _e_file_add(E_Dir *ed, const char *path, int listing)
{ {
_e_file_add_mod(id, path, 3, listing);/*file add*/ if (!listing)
{
/* FIXME: handle BACKOFF */
}
_e_file_add_mod(ed, path, 3, listing);/*file add*/
} }
static void static void
_e_file_del(int id, const char *path) _e_file_del(E_Dir *ed, const char *path)
{ {
{
/* FIXME: handle BACKOFF */
}
ecore_ipc_server_send(_e_ipc_server, ecore_ipc_server_send(_e_ipc_server,
6/*E_IPC_DOMAIN_FM*/, 6/*E_IPC_DOMAIN_FM*/,
4/*file del*/, 4/*file del*/,
0, id, 0, (void *)path, strlen(path) + 1); 0, ed->id, 0, (void *)path, strlen(path) + 1);
} }
static void static void
_e_file_mod(int id, const char *path) _e_file_mod(E_Dir *ed, const char *path)
{ {
_e_file_add_mod(id, path, 5, 0);/*file change*/ {
/* FIXME: handle BACKOFF */
}
_e_file_add_mod(ed, path, 5, 0);/*file change*/
} }
static void static void
_e_file_mon_dir_del(int id, const char *path) _e_file_mon_dir_del(E_Dir *ed, const char *path)
{ {
ecore_ipc_server_send(_e_ipc_server, ecore_ipc_server_send(_e_ipc_server,
6/*E_IPC_DOMAIN_FM*/, 6/*E_IPC_DOMAIN_FM*/,
6/*mon dir del*/, 6/*mon dir del*/,
0, id, 0, (void *)path, strlen(path) + 1); 0, ed->id, 0, (void *)path, strlen(path) + 1);
} }
static void static void
@ -764,9 +826,9 @@ _e_cb_file_mon_list_idler(void *data)
if ((!ed->fq->next) || if ((!ed->fq->next) ||
((!strcmp(ed->fq->next->data, ".order")) && ((!strcmp(ed->fq->next->data, ".order")) &&
(!ed->fq->next->next))) (!ed->fq->next->next)))
_e_file_add(ed->id, buf, 2); _e_file_add(ed, buf, 2);
else else
_e_file_add(ed->id, buf, 1); _e_file_add(ed, buf, 1);
} }
free(file); free(file);
ed->fq = evas_list_remove_list(ed->fq, ed->fq); ed->fq = evas_list_remove_list(ed->fq, ed->fq);
@ -1158,14 +1220,12 @@ _e_path_fix_order(const char *path, const char *rel, int rel_to, int x, int y)
if (!strcmp(f, rel)) return; if (!strcmp(f, rel)) return;
d = ecore_file_get_dir(path); d = ecore_file_get_dir(path);
if (!d) return; if (!d) return;
printf("_e_path_fix_order(%s, %s, %i, %i, %i)\n", path, rel, rel_to, x, y);
snprintf(buf, sizeof(buf), "%s/.order", d); snprintf(buf, sizeof(buf), "%s/.order", d);
if (ecore_file_exists(buf)) if (ecore_file_exists(buf))
{ {
FILE *fh; FILE *fh;
Evas_List *files = NULL, *l; Evas_List *files = NULL, *l;
printf(".order exists\n");
fh = fopen(buf, "r"); fh = fopen(buf, "r");
if (fh) if (fh)
{ {
@ -1186,7 +1246,6 @@ _e_path_fix_order(const char *path, const char *rel, int rel_to, int x, int y)
{ {
if (!strcmp(l->data, f)) if (!strcmp(l->data, f))
{ {
printf("REMOVE\n");
free(l->data); free(l->data);
files = evas_list_remove_list(files, l); files = evas_list_remove_list(files, l);
break; break;
@ -1197,7 +1256,6 @@ _e_path_fix_order(const char *path, const char *rel, int rel_to, int x, int y)
{ {
if (!strcmp(l->data, rel)) if (!strcmp(l->data, rel))
{ {
printf("INSERT %s\n", (char *)l->data);
if (rel_to == 2) /* replace */ if (rel_to == 2) /* replace */
{ {
free(l->data); free(l->data);
@ -1220,7 +1278,6 @@ _e_path_fix_order(const char *path, const char *rel, int rel_to, int x, int y)
{ {
while (files) while (files)
{ {
printf("W %s\n", (char *)files->data);
fprintf(fh, "%s\n", (char *)files->data); fprintf(fh, "%s\n", (char *)files->data);
free(files->data); free(files->data);
files = evas_list_remove_list(files, files); files = evas_list_remove_list(files, files);
@ -1230,3 +1287,27 @@ _e_path_fix_order(const char *path, const char *rel, int rel_to, int x, int y)
} }
free(d); free(d);
} }
static void
_e_dir_del(E_Dir *ed)
{
evas_stringshare_del(ed->dir);
if (ed->idler) ecore_idler_del(ed->idler);
if (ed->recent_clean)
ecore_timer_del(ed->recent_clean);
while (ed->recent_mods)
{
E_Mod *m;
m = ed->recent_mods->data;
evas_stringshare_del(m->path);
free(m);
ed->recent_mods = evas_list_remove_list(ed->recent_mods, ed->recent_mods);
}
while (ed->fq)
{
free(ed->fq->data);
ed->fq = evas_list_remove_list(ed->fq, ed->fq);
}
free(ed);
}

View File

@ -225,16 +225,6 @@ e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
if (!fwin) return NULL; if (!fwin) return NULL;
fwin->zone = zone; fwin->zone = zone;
fwins = evas_list_append(fwins, fwin); fwins = evas_list_append(fwins, fwin);
/*
e_win_resize_callback_set(fwin->win, _e_fwin_cb_resize);
fwin->win->data = fwin;
o = edje_object_add(e_win_evas_get(fwin->win));
e_theme_edje_object_set(o, "base/theme/fileman",
"e/fileman/window/main");
evas_object_show(o);
fwin->bg_obj = o;
*/
o = e_fm2_add(zone->container->bg_evas); o = e_fm2_add(zone->container->bg_evas);
fwin->fm_obj = o; fwin->fm_obj = o;
@ -294,7 +284,7 @@ e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
* to specify the .edj files to get the list and icon theme stuff from * to specify the .edj files to get the list and icon theme stuff from
*/ */
e_scrollframe_custom_theme_set(o, "base/theme/fileman", e_scrollframe_custom_theme_set(o, "base/theme/fileman",
"e/fileman/scrollframe/default"); "e/fileman/scrollframe/desktop");
evas_object_data_set(fwin->fm_obj, "fwin", fwin); evas_object_data_set(fwin->fm_obj, "fwin", fwin);
e_scrollframe_extern_pan_set(o, fwin->fm_obj, e_scrollframe_extern_pan_set(o, fwin->fm_obj,
_e_fwin_pan_set, _e_fwin_pan_set,
@ -307,39 +297,17 @@ e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
evas_object_resize(fwin->scrollframe_obj, fwin->zone->w, fwin->zone->h); evas_object_resize(fwin->scrollframe_obj, fwin->zone->w, fwin->zone->h);
evas_object_show(o); evas_object_show(o);
/*
o = edje_object_add(e_win_evas_get(fwin->win));
edje_object_part_swallow(fwin->bg_obj, "e.swallow.bg", o);
evas_object_pass_events_set(o, 1);
fwin->under_obj = o;
o = edje_object_add(e_win_evas_get(fwin->win));
edje_object_part_swallow(e_scrollframe_edje_object_get(fwin->scrollframe_obj), "e.swallow.overlay", o);
evas_object_pass_events_set(o, 1);
fwin->over_obj = o;
*/
e_fm2_window_object_set(fwin->fm_obj, E_OBJECT(fwin->zone)); e_fm2_window_object_set(fwin->fm_obj, E_OBJECT(fwin->zone));
evas_object_focus_set(fwin->fm_obj, 1); evas_object_focus_set(fwin->fm_obj, 1);
e_fm2_path_set(fwin->fm_obj, dev, path); e_fm2_path_set(fwin->fm_obj, dev, path);
/*
snprintf(buf, sizeof(buf), "_fwin::/%s", e_fm2_real_path_get(fwin->fm_obj));
e_win_name_class_set(fwin->win, "E", buf);
*/
file = ecore_file_get_file(e_fm2_real_path_get(fwin->fm_obj)); file = ecore_file_get_file(e_fm2_real_path_get(fwin->fm_obj));
if (file) if (file)
snprintf(buf, sizeof(buf), "%s", file); snprintf(buf, sizeof(buf), "%s", file);
else else
snprintf(buf, sizeof(buf), "%s", e_fm2_real_path_get(fwin->fm_obj)); snprintf(buf, sizeof(buf), "%s", e_fm2_real_path_get(fwin->fm_obj));
/*
e_win_title_set(fwin->win, buf);
e_win_size_min_set(fwin->win, 24, 24);
e_win_resize(fwin->win, 280, 200);
e_win_show(fwin->win);
*/
return fwin; return fwin;
} }

View File

@ -656,10 +656,22 @@ _e_zone_free(E_Zone *zone)
free(zone); free(zone);
} }
static void
_e_zone_cb_fwin_del(void *obj)
{
E_Zone *zone;
zone = (E_Zone *)e_object_data_get(E_OBJECT(obj));
if (!zone) return;
zone->bg_fwin = NULL;
}
static void static void
_e_zone_fm_add(E_Zone *zone, const char *dev, const char *path) _e_zone_fm_add(E_Zone *zone, const char *dev, const char *path)
{ {
zone->bg_fwin = e_fwin_zone_new(zone, dev, path); zone->bg_fwin = e_fwin_zone_new(zone, dev, path);
e_object_data_set(E_OBJECT(zone->bg_fwin), zone);
e_object_del_attach_func_set(E_OBJECT(zone->bg_fwin), _e_zone_cb_fwin_del);
} }
static void static void