forked from enlightenment/enlightenment
a lot of patches - also my work on moving the IO stuff in e_fm to a slave
process to stop e from ever "locking up". this unfortunately breaks the other source stuff and thus breaks the app editor config dialogs and anything using fm2 for .desktop stuff from the e applications/all repo. i am doing this as i expect this to go away with efreet anyway so not too much of an issue. not all fm operatiosn work currently - note. so beware. it can view files though :) SVN revision: 28528
This commit is contained in:
parent
e57524d44c
commit
b2a0abb8eb
10
TODO
10
TODO
|
@ -8,6 +8,16 @@ Some of the things (in very short form) that need to be done to E17...
|
|||
BUGS / FIXES
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
* shelf autohide uses mouse in/out events for the shelf object. this is not all
|
||||
good as it conflicts with edge flip for desktops (if shelves slide off the
|
||||
screen) also it doesn't account for window placement and sizing when the
|
||||
shelf is hidden so you cant maximize to the now available region when the
|
||||
shelf hides. i think hiding needs to be done noutside of the theme and by
|
||||
the shelf itself. e will still emit signals to let the theme do things, but
|
||||
e will also handle the hide/show based on a unified edge mouse event trap or
|
||||
trap on the region the shelf would normally be in. also need a way to lock
|
||||
the gadcon and thus gadcon asks shelf to lock in (stay visible) for things
|
||||
like popping up menus, popups etc.
|
||||
* shelves seem to get confused with their contents if you have 3 shelves over
|
||||
2 screens/zones - when you go back to 1 screen form 2, one of the shelves
|
||||
gts the contents from the now non-existant shelf.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,3 +10,4 @@ enlightenment_imc
|
|||
enlightenment_start
|
||||
enlightenment_sys
|
||||
enlightenment_thumb
|
||||
enlightenment_fm
|
||||
|
|
|
@ -19,7 +19,8 @@ enlightenment_remote \
|
|||
enlightenment_imc \
|
||||
enlightenment_start \
|
||||
enlightenment_thumb \
|
||||
enlightenment_sys
|
||||
enlightenment_sys \
|
||||
enlightenment_fm
|
||||
|
||||
ENLIGHTENMENTHEADERS = \
|
||||
e.h \
|
||||
|
@ -377,13 +378,19 @@ e_start_main.c
|
|||
enlightenment_start_LDFLAGS = @dlopen_libs@
|
||||
|
||||
enlightenment_thumb_SOURCES = \
|
||||
e.h \
|
||||
e_thumb_main.c \
|
||||
e_user.c \
|
||||
e_sha1.c
|
||||
|
||||
enlightenment_thumb_LDFLAGS = @e_libs@ @dlopen_libs@
|
||||
|
||||
enlightenment_fm_SOURCES = \
|
||||
e_fm_main.c \
|
||||
e_user.c \
|
||||
e_sha1.c
|
||||
|
||||
enlightenment_fm_LDFLAGS = @e_libs@ @dlopen_libs@
|
||||
|
||||
enlightenment_sys_SOURCES = \
|
||||
e_sys_main.c
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/param.h>
|
||||
#include <pwd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <math.h>
|
||||
#include <fnmatch.h>
|
||||
|
|
|
@ -422,6 +422,7 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal)
|
|||
|
||||
bd->resize_mode = RESIZE_NONE;
|
||||
bd->layer = 100;
|
||||
bd->saved.layer = bd->layer;
|
||||
bd->changes.icon = 1;
|
||||
bd->changes.size = 1;
|
||||
bd->changes.shape = 1;
|
||||
|
@ -974,6 +975,7 @@ e_border_layer_set(E_Border *bd, int layer)
|
|||
|
||||
raise = e_config->transient.raise;
|
||||
|
||||
bd->saved.layer = bd->layer;
|
||||
bd->layer = layer;
|
||||
if (e_config->transient.layer)
|
||||
{
|
||||
|
@ -2071,7 +2073,7 @@ e_border_unfullscreen(E_Border *bd)
|
|||
e_border_move_resize(bd, bd->saved.x, bd->saved.y, bd->saved.w, bd->saved.h);
|
||||
|
||||
/* FIXME: Find right layer */
|
||||
e_border_layer_set(bd, 100);
|
||||
e_border_layer_set(bd, bd->saved.layer);
|
||||
|
||||
e_hints_window_fullscreen_set(bd, 0);
|
||||
bd->client.border.changed = 1;
|
||||
|
|
|
@ -389,6 +389,7 @@ struct _E_Border
|
|||
|
||||
struct {
|
||||
int x, y, w, h;
|
||||
unsigned int layer;
|
||||
} saved;
|
||||
|
||||
struct {
|
||||
|
|
|
@ -121,6 +121,7 @@ e_config_init(void)
|
|||
E_CONFIG_VAL(D, T, style, STR);
|
||||
E_CONFIG_VAL(D, T, size, INT);
|
||||
E_CONFIG_VAL(D, T, overlap, INT);
|
||||
E_CONFIG_VAL(D, T, autohide, INT);
|
||||
|
||||
_e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", E_Config_Desktop_Background);
|
||||
#undef T
|
||||
|
@ -1133,7 +1134,7 @@ e_config_init(void)
|
|||
{
|
||||
E_Config_Shelf *cf_es;
|
||||
|
||||
#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap) \
|
||||
#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap, _autohide) \
|
||||
cf_es = E_NEW(E_Config_Shelf, 1); \
|
||||
cf_es->name = evas_stringshare_add(_name); \
|
||||
cf_es->container = _con; \
|
||||
|
@ -1146,30 +1147,31 @@ e_config_init(void)
|
|||
cf_es->style = evas_stringshare_add(_style); \
|
||||
cf_es->size = _size; \
|
||||
cf_es->overlap = _overlap; \
|
||||
cf_es->autohide = _autohide; \
|
||||
e_config->shelves = evas_list_append(e_config->shelves, cf_es)
|
||||
/* shelves for 4 zones on head 0 by default */
|
||||
CFG_SHELF("shelf", 0, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0);
|
||||
1, 0, "default", 40, 0, 0);
|
||||
CFG_SHELF("shelf", 0, 1,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0);
|
||||
1, 0, "default", 40, 0, 0);
|
||||
CFG_SHELF("shelf", 0, 2,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0);
|
||||
1, 0, "default", 40, 0, 0);
|
||||
CFG_SHELF("shelf", 0, 3,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0);
|
||||
1, 0, "default", 40, 0, 0);
|
||||
/* shelves for heada 1, 2, and 3 by default */
|
||||
CFG_SHELF("shelf", 1, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0);
|
||||
1, 0, "default", 40, 0, 0);
|
||||
CFG_SHELF("shelf", 2, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0);
|
||||
1, 0, "default", 40, 0, 0);
|
||||
CFG_SHELF("shelf", 3, 0,
|
||||
1, 200, E_GADCON_ORIENT_BOTTOM,
|
||||
1, 0, "default", 40, 0);
|
||||
1, 0, "default", 40, 0, 0);
|
||||
}
|
||||
IFCFGEND;
|
||||
|
||||
|
|
|
@ -390,6 +390,7 @@ struct _E_Config_Shelf
|
|||
const char *style;
|
||||
int size;
|
||||
int overlap;
|
||||
int autohide;
|
||||
};
|
||||
|
||||
struct _E_Config_Mime_Icon
|
||||
|
|
1494
src/bin/e_fm.c
1494
src/bin/e_fm.c
File diff suppressed because it is too large
Load Diff
|
@ -56,7 +56,6 @@ struct _E_Fm2_Config
|
|||
/* general view mode */
|
||||
struct {
|
||||
E_Fm2_View_Mode mode;
|
||||
const char *extra_file_source;
|
||||
unsigned char open_dirs_in_place;
|
||||
unsigned char selector;
|
||||
unsigned char single_click;
|
||||
|
@ -118,12 +117,10 @@ struct _E_Fm2_Icon_Info
|
|||
const char *icon;
|
||||
const char *link;
|
||||
const char *real_link;
|
||||
const char *pseudo_dir;
|
||||
struct stat statinfo;
|
||||
unsigned char icon_type;
|
||||
unsigned char mount : 1;
|
||||
unsigned char removable : 1;
|
||||
unsigned char pseudo_link : 1;
|
||||
unsigned char deleted : 1;
|
||||
unsigned char broken_link : 1;
|
||||
};
|
||||
|
@ -180,10 +177,12 @@ EAPI void e_fm2_pan_child_size_get(Evas_Object *obj, Evas_Coord
|
|||
|
||||
EAPI void e_fm2_all_icons_update(void);
|
||||
|
||||
/*
|
||||
EAPI void e_fm2_fop_delete_add(Evas_Object *obj, E_Fm2_Icon_Info *ici);
|
||||
EAPI void e_fm2_fop_move_add(Evas_Object *obj, const char *src, const char *dst, const char *rel, int after, int file_add);
|
||||
EAPI void e_fm2_fop_link_add(Evas_Object *obj, const char *src, const char *dst);
|
||||
EAPI void e_fm2_fop_add_add(Evas_Object *obj, const char *file, const char *rel, int after);
|
||||
*/
|
||||
|
||||
EAPI Evas_Object *
|
||||
e_fm2_icon_get(Evas *evas, const char *realpath,
|
||||
|
@ -192,6 +191,9 @@ EAPI Evas_Object *
|
|||
void (*gen_func) (void *data, Evas_Object *obj, void *event_info),
|
||||
void *data, int force_gen, const char **type_ret);
|
||||
|
||||
EAPI void e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e);
|
||||
EAPI void e_fm2_client_del(Ecore_Ipc_Event_Client_Del *e);
|
||||
|
||||
extern EAPI int E_EVENT_REMOVABLE_ADD;
|
||||
extern EAPI int E_EVENT_REMOVABLE_DEL;
|
||||
|
||||
|
|
|
@ -0,0 +1,669 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/param.h>
|
||||
#include <math.h>
|
||||
#include <fnmatch.h>
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <dirent.h>
|
||||
#include <pwd.h>
|
||||
#include <glob.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <Ecore.h>
|
||||
#include <Ecore_Evas.h>
|
||||
#include <Ecore_Ipc.h>
|
||||
#include <Ecore_File.h>
|
||||
#include <Ecore_Desktop.h>
|
||||
#include <Evas.h>
|
||||
#include <Eet.h>
|
||||
#include <Edje.h>
|
||||
|
||||
/* FIXME: things to add to the slave enlightenment_fm process and ipc to e:
|
||||
*
|
||||
* * icon finding
|
||||
* * .desktop parsing
|
||||
* * file operations (fop's) (cp, mv, rm etc.)
|
||||
* * reporting results of fop's
|
||||
* * dbus removable device monitoring
|
||||
* * mount/umount of removable devices
|
||||
*
|
||||
*/
|
||||
|
||||
#define DEF_SYNC_NUM 8
|
||||
#define DEF_ROUND_TRIP 0.05
|
||||
#define DEF_ROUND_TRIP_TOLERANCE 0.01
|
||||
|
||||
typedef enum _E_Fop_Type
|
||||
{
|
||||
E_FOP_NONE,
|
||||
E_FOP_DEL,
|
||||
E_FOP_TRASH,
|
||||
E_FOP_RENAME,
|
||||
E_FOP_MV,
|
||||
E_FOP_CP,
|
||||
E_FOP_MKDIR,
|
||||
E_FOP_MOUNT,
|
||||
E_FOP_UMOUNT,
|
||||
E_FOP_LAST
|
||||
} E_Fop_Type;
|
||||
|
||||
typedef struct _E_Dir E_Dir;
|
||||
typedef struct _E_Fop E_Fop;
|
||||
|
||||
struct _E_Dir
|
||||
{
|
||||
int id;
|
||||
const char *dir;
|
||||
Ecore_File_Monitor *mon;
|
||||
int mon_ref;
|
||||
Evas_List *fq;
|
||||
Ecore_Idler *idler;
|
||||
int dot_order;
|
||||
int sync;
|
||||
double sync_time;
|
||||
int sync_num;
|
||||
};
|
||||
|
||||
struct _E_Fop
|
||||
{
|
||||
int id;
|
||||
E_Fop_Type type;
|
||||
const char *src;
|
||||
const char *dst;
|
||||
};
|
||||
|
||||
/* local subsystem functions */
|
||||
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_del(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_file_add_mod(int id, const char *path, int op, int listing);
|
||||
static void _e_file_add(int id, const char *path, int listing);
|
||||
static void _e_file_del(int id, const char *path);
|
||||
static void _e_file_mod(int id, const char *path);
|
||||
static void _e_file_mon_dir_del(int id, const char *path);
|
||||
static void _e_file_mon_list_sync(E_Dir *ed);
|
||||
|
||||
static int _e_cb_file_mon_list_idler(void *data);
|
||||
static char *_e_str_list_remove(Evas_List **list, char *str);
|
||||
|
||||
/* local subsystem globals */
|
||||
static Ecore_Ipc_Server *_e_ipc_server = NULL;
|
||||
|
||||
static Evas_List *_e_dirs = NULL;
|
||||
static int _e_sync_num = 0;
|
||||
|
||||
/* externally accessible functions */
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if ((!strcmp(argv[i], "-h")) ||
|
||||
(!strcmp(argv[i], "-help")) ||
|
||||
(!strcmp(argv[i], "--help")))
|
||||
{
|
||||
printf(
|
||||
"This is an internal tool for Enlightenment.\n"
|
||||
"do not use it.\n"
|
||||
);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
ecore_init();
|
||||
ecore_app_args_set(argc, (const char **)argv);
|
||||
eet_init();
|
||||
evas_init();
|
||||
edje_init();
|
||||
ecore_file_init();
|
||||
ecore_ipc_init();
|
||||
|
||||
if (_e_ipc_init()) ecore_main_loop_begin();
|
||||
|
||||
if (_e_ipc_server)
|
||||
{
|
||||
ecore_ipc_server_del(_e_ipc_server);
|
||||
_e_ipc_server = NULL;
|
||||
}
|
||||
|
||||
ecore_ipc_shutdown();
|
||||
ecore_file_shutdown();
|
||||
ecore_evas_shutdown();
|
||||
edje_shutdown();
|
||||
evas_shutdown();
|
||||
eet_shutdown();
|
||||
ecore_shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
static int
|
||||
_e_ipc_init(void)
|
||||
{
|
||||
char *sdir;
|
||||
|
||||
sdir = getenv("E_IPC_SOCKET");
|
||||
if (!sdir)
|
||||
{
|
||||
printf("The E_IPC_SOCKET environment variable is not set. This is\n"
|
||||
"exported by Enlightenment to all processes it launches.\n"
|
||||
"This environment variable must be set and must point to\n"
|
||||
"Enlightenment's IPC socket file (minus port number).\n");
|
||||
return 0;
|
||||
}
|
||||
_e_ipc_server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM, sdir, 0, NULL);
|
||||
if (!_e_ipc_server)
|
||||
{
|
||||
printf("Cannot connect to enlightenment - abort\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD, _e_ipc_cb_server_add, NULL);
|
||||
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL, _e_ipc_cb_server_del, NULL);
|
||||
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA, _e_ipc_cb_server_data, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_ipc_cb_server_add(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_Ipc_Event_Server_Add *e;
|
||||
|
||||
e = event;
|
||||
ecore_ipc_server_send(e->server,
|
||||
6/*E_IPC_DOMAIN_FM*/,
|
||||
1/*hello*/,
|
||||
0, 0, 0, NULL, 0); /* send hello */
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_ipc_cb_server_del(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_Ipc_Event_Server_Del *e;
|
||||
|
||||
e = event;
|
||||
/* quit now */
|
||||
ecore_main_loop_quit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_e_ipc_cb_server_data(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_Ipc_Event_Server_Data *e;
|
||||
|
||||
e = event;
|
||||
if (e->major != 6/*E_IPC_DOMAIN_FM*/) return 1;
|
||||
switch (e->minor)
|
||||
{
|
||||
case 1: /* monitor dir (and implicitly list) */
|
||||
{
|
||||
E_Dir *ed, *ped = NULL;
|
||||
DIR *dir;
|
||||
|
||||
Evas_List *l;
|
||||
|
||||
for (l = _e_dirs; l; l = l->next)
|
||||
{
|
||||
E_Dir *ed;
|
||||
|
||||
ed = l->data;
|
||||
if ((ed->mon) && (!strcmp(ed->dir, e->data)))
|
||||
{
|
||||
ped = ed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
dir = opendir(e->data);
|
||||
if (!dir)
|
||||
{
|
||||
_e_file_mon_dir_del(e->ref, e->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_List *files = NULL;
|
||||
struct dirent *dp;
|
||||
int dot_order = 0;
|
||||
char *file;
|
||||
char buf[4096];
|
||||
FILE *f;
|
||||
|
||||
ed = calloc(1, sizeof(E_Dir));
|
||||
ed->id = e->ref;
|
||||
ed->dir = evas_stringshare_add(e->data);
|
||||
if (!ped)
|
||||
{
|
||||
ed->mon = ecore_file_monitor_add(ed->dir, _e_cb_file_monitor, ed);
|
||||
ed->mon_ref = 1;
|
||||
}
|
||||
else
|
||||
ped->mon_ref++;
|
||||
_e_dirs = evas_list_append(_e_dirs, ed);
|
||||
|
||||
while (dp = readdir(dir))
|
||||
{
|
||||
if ((!strcmp(dp->d_name, ".")) || (!strcmp(dp->d_name, "..")))
|
||||
continue;
|
||||
if (!strcmp(dp->d_name, ".order")) dot_order = 1;
|
||||
files = evas_list_append(files, strdup(dp->d_name));
|
||||
}
|
||||
closedir(dir);
|
||||
if (dot_order)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/.order", e->data);
|
||||
f = fopen(buf, "r");
|
||||
if (f)
|
||||
{
|
||||
Evas_List *f2 = NULL;
|
||||
int len;
|
||||
char *s;
|
||||
|
||||
while (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
len = strlen(buf);
|
||||
if (len > 0) buf[len - 1] = 0;
|
||||
s = _e_str_list_remove(&files, buf);
|
||||
if (s) f2 = evas_list_append(f2, s);
|
||||
}
|
||||
fclose(f);
|
||||
while (files)
|
||||
{
|
||||
f2 = evas_list_append(f2, files->data);
|
||||
files = evas_list_remove_list(files, files);
|
||||
}
|
||||
files = f2;
|
||||
}
|
||||
}
|
||||
/* FIXME: if .order file- load it, sort all items int it
|
||||
* that are in files then just append whatever is left in
|
||||
* alphabetical order
|
||||
*/
|
||||
/* FIXME: maybe one day we can sort files here and handle
|
||||
* .order file stuff here - but not today
|
||||
*/
|
||||
ed->dot_order = dot_order;
|
||||
if (dot_order)
|
||||
{
|
||||
if (!strcmp(e->data, "/"))
|
||||
snprintf(buf, sizeof(buf), "/.order");
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s/.order", e->data);
|
||||
if (evas_list_count(files) == 1)
|
||||
_e_file_add(ed->id, buf, 2);
|
||||
else
|
||||
_e_file_add(ed->id, buf, 1);
|
||||
}
|
||||
ed->fq = files;
|
||||
ed->idler = ecore_idler_add(_e_cb_file_mon_list_idler, ed);
|
||||
ed->sync_num = DEF_SYNC_NUM;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2: /* monitor dir end */
|
||||
{
|
||||
Evas_List *l, *ll;
|
||||
|
||||
for (l = _e_dirs; l; l = l->next)
|
||||
{
|
||||
E_Dir *ed;
|
||||
|
||||
ed = l->data;
|
||||
if ((e->ref == ed->id) && (!strcmp(ed->dir, e->data)))
|
||||
{
|
||||
if (ed->mon)
|
||||
{
|
||||
if (ed->mon_ref > 1)
|
||||
{
|
||||
for (ll = _e_dirs; ll; ll = ll->next)
|
||||
{
|
||||
E_Dir *ped;
|
||||
|
||||
ped = ll->data;
|
||||
if ((!ped->mon) &&
|
||||
(!strcmp(ped->dir, ed->dir)))
|
||||
{
|
||||
ped->mon = ed->mon;
|
||||
ped->mon_ref = ed->mon_ref - 1;
|
||||
goto contdel;
|
||||
}
|
||||
}
|
||||
}
|
||||
ecore_file_monitor_del(ed->mon);
|
||||
}
|
||||
contdel:
|
||||
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);
|
||||
_e_dirs = evas_list_remove_list(_e_dirs, l);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3: /* fop delete file/dir */
|
||||
{
|
||||
ecore_file_recursive_rm(e->data);
|
||||
/* FIXME: send back file del if src is monitored */
|
||||
}
|
||||
break;
|
||||
case 4: /* fop trash file/dir */
|
||||
{
|
||||
ecore_file_recursive_rm(e->data);
|
||||
/* FIXME: send back file del if src is monitored */
|
||||
}
|
||||
break;
|
||||
case 5: /* fop rename file/dir */
|
||||
/* FIXME: send back file del + add if dir is monitored */
|
||||
break;
|
||||
case 6: /* fop mv file/dir */
|
||||
/* FIXME: send back file del + add if src and dest are monitored */
|
||||
break;
|
||||
case 7: /* fop cp file/dir */
|
||||
/* FIXME: send back file add if succeeded - and dest monitored */
|
||||
break;
|
||||
case 8: /* fop mkdir */
|
||||
{
|
||||
ecore_file_mkdir(e->data);
|
||||
/* FIXME: send back file add if succeeded */
|
||||
}
|
||||
break;
|
||||
case 9: /* fop mount fs */
|
||||
/* FIXME: implement later - for now in e */
|
||||
break;
|
||||
case 10: /* fop umount fs */
|
||||
/* FIXME: implement later - for now in e */
|
||||
break;
|
||||
case 11: /* quit */
|
||||
ecore_main_loop_quit();
|
||||
break;
|
||||
case 12: /* mon list sync */
|
||||
{
|
||||
Evas_List *l;
|
||||
double stime;
|
||||
|
||||
for (l = _e_dirs; l; l = l->next)
|
||||
{
|
||||
E_Dir *ed;
|
||||
|
||||
ed = l->data;
|
||||
if (ed->fq)
|
||||
{
|
||||
if (ed->sync == e->response)
|
||||
{
|
||||
stime = ecore_time_get() - ed->sync_time;
|
||||
/* try keep round trips to round trip tolerance */
|
||||
if
|
||||
(stime < (DEF_ROUND_TRIP - DEF_ROUND_TRIP_TOLERANCE))
|
||||
ed->sync_num += 1;
|
||||
else if
|
||||
(stime > (DEF_ROUND_TRIP + DEF_ROUND_TRIP_TOLERANCE))
|
||||
ed->sync_num -= 1;
|
||||
/* always sync at least 1 file */
|
||||
if (ed->sync_num < 1) ed->sync_num = 1;
|
||||
ed->idler = ecore_idler_add(_e_cb_file_mon_list_idler, ed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* always send back an "OK" for each request so e can basically keep a
|
||||
* count of outstanding requests - maybe for balancing between fm
|
||||
* slaves later. ref_to is set to the the ref id in the request to
|
||||
* allow for async handling later */
|
||||
ecore_ipc_server_send(_e_ipc_server,
|
||||
6/*E_IPC_DOMAIN_FM*/,
|
||||
2/*req ok*/,
|
||||
0, e->ref, 0, NULL, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
|
||||
{
|
||||
E_Dir *ed;
|
||||
char *dir, *rp, *drp;
|
||||
const char *file;
|
||||
Evas_List *l;
|
||||
|
||||
dir = ecore_file_get_dir(path);
|
||||
file = ecore_file_get_file(path);
|
||||
if ((event == ECORE_FILE_EVENT_CREATED_FILE) ||
|
||||
(event == ECORE_FILE_EVENT_CREATED_DIRECTORY))
|
||||
{
|
||||
rp = ecore_file_realpath(dir);
|
||||
for (l = _e_dirs; l; l = l->next)
|
||||
{
|
||||
ed = l->data;
|
||||
drp = ecore_file_realpath(ed->dir);
|
||||
if (!strcmp(rp, drp))
|
||||
_e_file_add(ed->id, path, 0);
|
||||
free(drp);
|
||||
}
|
||||
free(rp);
|
||||
}
|
||||
else if ((event == ECORE_FILE_EVENT_DELETED_FILE) ||
|
||||
(event == ECORE_FILE_EVENT_DELETED_DIRECTORY))
|
||||
{
|
||||
rp = ecore_file_realpath(dir);
|
||||
for (l = _e_dirs; l; l = l->next)
|
||||
{
|
||||
ed = l->data;
|
||||
drp = ecore_file_realpath(ed->dir);
|
||||
if (!strcmp(rp, drp))
|
||||
_e_file_del(ed->id, path);
|
||||
}
|
||||
free(rp);
|
||||
}
|
||||
else if (event == ECORE_FILE_EVENT_MODIFIED)
|
||||
{
|
||||
rp = ecore_file_realpath(dir);
|
||||
for (l = _e_dirs; l; l = l->next)
|
||||
{
|
||||
ed = l->data;
|
||||
drp = ecore_file_realpath(ed->dir);
|
||||
if (!strcmp(rp, drp))
|
||||
_e_file_mod(ed->id, path);
|
||||
}
|
||||
free(rp);
|
||||
}
|
||||
else if (event == ECORE_FILE_EVENT_DELETED_SELF)
|
||||
{
|
||||
rp = ecore_file_realpath(path);
|
||||
for (l = _e_dirs; l; l = l->next)
|
||||
{
|
||||
ed = l->data;
|
||||
drp = ecore_file_realpath(ed->dir);
|
||||
if (!strcmp(rp, drp))
|
||||
_e_file_mon_dir_del(ed->id, path);
|
||||
}
|
||||
free(rp);
|
||||
}
|
||||
free(dir);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_add_mod(int id, const char *path, int op, int listing)
|
||||
{
|
||||
struct stat st;
|
||||
char *lnk = NULL, *rlnk = NULL;
|
||||
int broken_lnk = 0;
|
||||
int bsz = 0;
|
||||
unsigned char *p, buf
|
||||
/* file add/change format is as follows:
|
||||
*
|
||||
8 stat_info[stat size] + broken_link[1] + path[n]\0 + lnk[n]\0 + rlnk[n]\0 */
|
||||
[sizeof(struct stat) + 1 + 4096 + 4096 + 4096];
|
||||
|
||||
lnk = ecore_file_readlink(buf);
|
||||
if (stat(path, &st) == -1)
|
||||
{
|
||||
if (lnk) broken_lnk = 1;
|
||||
else return;
|
||||
}
|
||||
if ((lnk) && (lnk[0] != '/')) rlnk = ecore_file_realpath(path);
|
||||
if (!lnk) lnk = strdup("");
|
||||
if (!rlnk) rlnk = strdup("");
|
||||
|
||||
p = buf;
|
||||
/* NOTE: i am NOT converting this data to portable arch/os independant
|
||||
* format. i am ASSUMING e_fm_main and e are local and built together
|
||||
* and thus this will work. if this ever changes this here needs to
|
||||
* change */
|
||||
memcpy(buf, &st, sizeof(struct stat));
|
||||
p += sizeof(struct stat);
|
||||
|
||||
p[0] = broken_lnk;
|
||||
p += 1;
|
||||
|
||||
strcpy(p, path);
|
||||
p += strlen(path) + 1;
|
||||
|
||||
strcpy(p, lnk);
|
||||
p += strlen(lnk) + 1;
|
||||
|
||||
strcpy(p, rlnk);
|
||||
p += strlen(rlnk) + 1;
|
||||
|
||||
bsz = p - buf;
|
||||
ecore_ipc_server_send(_e_ipc_server, 6/*E_IPC_DOMAIN_FM*/, op, 0, id,
|
||||
listing, buf, bsz);
|
||||
if (lnk) free(lnk);
|
||||
if (rlnk) free(rlnk);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_add(int id, const char *path, int listing)
|
||||
{
|
||||
// printf("+++FADD %s\n", path);
|
||||
_e_file_add_mod(id, path, 3, listing);/*file add*/
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_del(int id, const char *path)
|
||||
{
|
||||
// printf("+++FDEL %s\n", path);
|
||||
ecore_ipc_server_send(_e_ipc_server,
|
||||
6/*E_IPC_DOMAIN_FM*/,
|
||||
4/*file del*/,
|
||||
0, id, 0, (void *)path, strlen(path) + 1);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_mod(int id, const char *path)
|
||||
{
|
||||
// printf("+++FMOD %s\n", path);
|
||||
_e_file_add_mod(id, path, 5, 0);/*file change*/
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_mon_dir_del(int id, const char *path)
|
||||
{
|
||||
ecore_ipc_server_send(_e_ipc_server,
|
||||
6/*E_IPC_DOMAIN_FM*/,
|
||||
6/*mon dir del*/,
|
||||
0, id, 0, (void *)path, strlen(path) + 1);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_mon_list_sync(E_Dir *ed)
|
||||
{
|
||||
_e_sync_num++;
|
||||
if (_e_sync_num == 0) _e_sync_num = 1;
|
||||
ed->sync = _e_sync_num;
|
||||
ed->sync_time = ecore_time_get();
|
||||
ecore_ipc_server_send(_e_ipc_server,
|
||||
6/*E_IPC_DOMAIN_FM*/,
|
||||
7/*mon list sync*/,
|
||||
0, ed->id, ed->sync, NULL, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
_e_cb_file_mon_list_idler(void *data)
|
||||
{
|
||||
E_Dir *ed;
|
||||
int n = 0;
|
||||
char *file, buf[4096];
|
||||
|
||||
ed = data;
|
||||
/* FIXME: spool off files in idlers and handle sync req's */
|
||||
while (ed->fq)
|
||||
{
|
||||
file = ed->fq->data;
|
||||
if (!((ed->dot_order) && (!strcmp(file, ".order"))))
|
||||
{
|
||||
if (!strcmp(ed->dir, "/"))
|
||||
snprintf(buf, sizeof(buf), "/%s", file);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s/%s", ed->dir, file);
|
||||
if ((!ed->fq->next) ||
|
||||
((!strcmp(ed->fq->next->data, ".order")) &&
|
||||
(!ed->fq->next->next)))
|
||||
_e_file_add(ed->id, buf, 2);
|
||||
else
|
||||
_e_file_add(ed->id, buf, 1);
|
||||
// printf("+++ FLIST %s\n", buf);
|
||||
}
|
||||
free(file);
|
||||
ed->fq = evas_list_remove_list(ed->fq, ed->fq);
|
||||
n++;
|
||||
if (n == ed->sync_num)
|
||||
{
|
||||
_e_file_mon_list_sync(ed);
|
||||
ed->idler = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
ed->sync_num = DEF_SYNC_NUM;
|
||||
ed->sync = 0;
|
||||
ed->sync_time = 0.0;
|
||||
ed->idler = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *
|
||||
_e_str_list_remove(Evas_List **list, char *str)
|
||||
{
|
||||
Evas_List *l;
|
||||
|
||||
for (l = *list; l; l = l->next)
|
||||
{
|
||||
char *s;
|
||||
|
||||
s = l->data;
|
||||
if (!strcmp(s, str))
|
||||
{
|
||||
*list = evas_list_remove_list(*list, l);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -23,8 +23,6 @@
|
|||
* advanced (extra) -
|
||||
* * show access date
|
||||
* * show change date
|
||||
* * show pseudolink status
|
||||
* * show pseudolink src
|
||||
* * show comment
|
||||
* * show generic
|
||||
* * show mount status
|
||||
|
|
|
@ -572,10 +572,7 @@ _e_fwin_file_exec(E_Fwin *fwin, E_Fm2_Icon_Info *ici, E_Fwin_Exec_Type ext)
|
|||
e_zone_exec(fwin->win->border->zone, buf);
|
||||
break;
|
||||
case E_FWIN_EXEC_DESKTOP:
|
||||
if (ici->pseudo_link)
|
||||
snprintf(buf, sizeof(buf), "%s/%s", ici->pseudo_dir, ici->file);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->fm_obj), ici->file);
|
||||
snprintf(buf, sizeof(buf), "%s/%s", e_fm2_real_path_get(fwin->fm_obj), ici->file);
|
||||
a = e_app_new(buf, 0);
|
||||
if (a)
|
||||
{
|
||||
|
@ -821,7 +818,6 @@ _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files, int always)
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 1;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 24;
|
||||
fmc.icon.list.h = 24;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -440,9 +440,9 @@ _cb_files_edited(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
|
||||
realpath = e_fm2_real_path_get(cfdata->gui.o_fm_all);
|
||||
|
||||
if (info->pseudo_link)
|
||||
snprintf(buf, sizeof(buf), "%s/%s", info->link, info->file);
|
||||
else
|
||||
// if (info->pseudo_link)
|
||||
// snprintf(buf, sizeof(buf), "%s/%s", info->link, info->file);
|
||||
// else
|
||||
snprintf(buf, sizeof(buf), "%s/%s", realpath, info->file);
|
||||
|
||||
if (ecore_file_is_dir(buf)) return;
|
||||
|
@ -671,7 +671,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
fmc_all.view.selector = 1;
|
||||
fmc_all.view.single_click = 0;
|
||||
fmc_all.view.no_subdir_jump = 0;
|
||||
fmc_all.view.extra_file_source = cfdata->path_everything;
|
||||
fmc_all.view.always_order = 1;
|
||||
fmc_all.icon.list.w = 24;
|
||||
fmc_all.icon.list.h = 24;
|
||||
|
@ -764,7 +763,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = cfdata->path_everything;
|
||||
fmc.view.always_order = 1;
|
||||
fmc.view.link_drop = 1;
|
||||
fmc.icon.list.w = 24;
|
||||
|
|
|
@ -218,7 +218,6 @@ _adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 48;
|
||||
fmc.icon.list.h = 48;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -236,7 +236,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 24;
|
||||
fmc.icon.list.h = 24;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -846,7 +846,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 16;
|
||||
fmc.icon.list.h = 16;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -236,6 +236,7 @@ _cb_add(void *data, void *data2)
|
|||
cfg->style = evas_stringshare_add("default");
|
||||
cfg->size = 40;
|
||||
cfg->overlap = 0;
|
||||
cfg->autohide = 0;
|
||||
e_config->shelves = evas_list_append(e_config->shelves, cfg);
|
||||
e_config_save_queue();
|
||||
|
||||
|
|
|
@ -296,7 +296,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 48;
|
||||
fmc.icon.list.h = 48;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -382,7 +382,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 48;
|
||||
fmc.icon.list.h = 48;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -480,7 +480,6 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 48;
|
||||
fmc.icon.list.h = 48;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
@ -632,7 +631,6 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 48;
|
||||
fmc.icon.list.h = 48;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -35,6 +35,7 @@ struct _E_Config_Dialog_Data
|
|||
int size;
|
||||
int layering;
|
||||
int overlapping;
|
||||
int autohiding;
|
||||
};
|
||||
|
||||
/* a nice easy setup function that does the dirty work */
|
||||
|
@ -115,6 +116,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->fit_size = cfdata->escfg->fit_size;
|
||||
cfdata->size = cfdata->escfg->size;
|
||||
cfdata->overlapping = cfdata->escfg->overlap;
|
||||
cfdata->autohiding = cfdata->escfg->autohide;
|
||||
if (cfdata->size <= 24)
|
||||
cfdata->basic_size = 24;
|
||||
else if (cfdata->size <= 32)
|
||||
|
@ -335,7 +337,18 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
|
||||
cfdata->escfg->overlap = cfdata->overlapping;
|
||||
|
||||
cfdata->escfg->autohide = cfdata->autohiding;
|
||||
if (cfdata->escfg->autohide)
|
||||
{
|
||||
edje_object_signal_emit(cfdata->es->o_base, "e,state,hidden", "e");
|
||||
cfdata->es->hidden = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
edje_object_signal_emit(cfdata->es->o_base, "e,state,visible", "e");
|
||||
cfdata->es->hidden = 0;
|
||||
}
|
||||
|
||||
if (restart)
|
||||
{
|
||||
zone = cfdata->es->zone;
|
||||
|
@ -446,6 +459,8 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_check_add(evas, _("Allow windows to overlap the shelf"), &(cfdata->overlapping));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_check_add(evas, _("Auto-hide the shelf"), &(cfdata->autohiding));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o2, of, 1, 1, 0.5);
|
||||
|
||||
of = e_widget_frametable_add(evas, _("Layout"), 1);
|
||||
|
|
|
@ -117,6 +117,7 @@ _e_ipc_cb_client_del(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
if (ecore_ipc_client_server_get(e->client) != _e_ipc_server) return 1;
|
||||
/* delete client sruct */
|
||||
e_thumb_client_del(e);
|
||||
e_fm2_client_del(e);
|
||||
ecore_ipc_client_del(e->client);
|
||||
return 1;
|
||||
}
|
||||
|
@ -146,6 +147,9 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
case E_IPC_DOMAIN_THUMB:
|
||||
e_thumb_client_data(e);
|
||||
break;
|
||||
case E_IPC_DOMAIN_FM:
|
||||
e_fm2_client_data(e);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ typedef enum _E_Ipc_Domain
|
|||
E_IPC_DOMAIN_REPLY,
|
||||
E_IPC_DOMAIN_EVENT,
|
||||
E_IPC_DOMAIN_THUMB,
|
||||
E_IPC_DOMAIN_FM,
|
||||
E_IPC_DOMAIN_LAST
|
||||
} E_Ipc_Domain;
|
||||
|
||||
|
|
|
@ -529,14 +529,6 @@ main(int argc, char **argv)
|
|||
|
||||
/*** Finished loading subsystems, Loading WM Specifics ***/
|
||||
|
||||
TS("fm2");
|
||||
/* init the enlightenment file manager */
|
||||
if (!e_fm2_init())
|
||||
{
|
||||
e_error_message_show(_("Enlightenment cannot initialize the File manager.\n"));
|
||||
_e_main_shutdown(-1);
|
||||
}
|
||||
_e_main_shutdown_push(e_fm2_shutdown);
|
||||
TS("dirs");
|
||||
/* setup directories we will be using for configurations storage etc. */
|
||||
if (!_e_main_dirs_init())
|
||||
|
@ -680,6 +672,14 @@ main(int argc, char **argv)
|
|||
if (_e_main_ipc_init())
|
||||
_e_main_shutdown_push(_e_main_ipc_shutdown);
|
||||
|
||||
TS("fm2");
|
||||
/* init the enlightenment file manager */
|
||||
if (!e_fm2_init())
|
||||
{
|
||||
e_error_message_show(_("Enlightenment cannot initialize the File manager.\n"));
|
||||
_e_main_shutdown(-1);
|
||||
}
|
||||
_e_main_shutdown_push(e_fm2_shutdown);
|
||||
TS("msg");
|
||||
/* setup generic msg handling etc */
|
||||
if (!e_msg_init())
|
||||
|
|
|
@ -323,6 +323,7 @@ e_shelf_save(E_Shelf *es)
|
|||
cf_es->fit_along = es->fit_along;
|
||||
cf_es->fit_size = es->fit_size;
|
||||
cf_es->overlap = 0;
|
||||
cf_es->autohide = 0;
|
||||
es->cfg = cf_es;
|
||||
}
|
||||
e_config_save_queue();
|
||||
|
@ -520,6 +521,11 @@ e_shelf_popup_set(E_Shelf *es, int popup)
|
|||
static void
|
||||
_e_shelf_free(E_Shelf *es)
|
||||
{
|
||||
if (es->hide_timer)
|
||||
{
|
||||
ecore_timer_del(es->hide_timer);
|
||||
es->hide_timer = NULL;
|
||||
}
|
||||
if (es->menu)
|
||||
{
|
||||
e_menu_post_deactivate_callback_set(es->menu, NULL, NULL);
|
||||
|
@ -963,6 +969,37 @@ _e_shelf_cb_mouse_in(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
|||
es = data;
|
||||
ev = event_info;
|
||||
edje_object_signal_emit(es->o_base, "e,state,focused", "e");
|
||||
if (es->cfg->autohide)
|
||||
{
|
||||
if (es->hidden)
|
||||
{
|
||||
es->hidden = 0;
|
||||
edje_object_signal_emit(es->o_base, "e,state,visible", "e");
|
||||
}
|
||||
}
|
||||
if (es->hide_timer)
|
||||
{
|
||||
ecore_timer_del(es->hide_timer);
|
||||
es->hide_timer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
_e_shelf_cb_hide_timer(void *data)
|
||||
{
|
||||
E_Shelf *es;
|
||||
|
||||
es = data;
|
||||
if (!e_menu_grab_window_get())
|
||||
{
|
||||
if (!es->hidden)
|
||||
{
|
||||
edje_object_signal_emit(es->o_base, "e,state,hidden", "e");
|
||||
}
|
||||
}
|
||||
es->hide_timer = NULL;
|
||||
es->hidden = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -973,6 +1010,17 @@ _e_shelf_cb_mouse_out(void *data, Evas *evas, Evas_Object *obj, void *event_info
|
|||
|
||||
es = data;
|
||||
ev = event_info;
|
||||
if (es->cfg->autohide)
|
||||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
evas_object_geometry_get(es->o_base, &x, &y, &w, &h);
|
||||
if (!E_INSIDE(ev->canvas.x, ev->canvas.y, x, y, w, h))
|
||||
{
|
||||
if (es->hide_timer) ecore_timer_del(es->hide_timer);
|
||||
es->hide_timer = ecore_timer_add(0.25, _e_shelf_cb_hide_timer, es);
|
||||
}
|
||||
}
|
||||
edje_object_signal_emit(es->o_base, "e,state,unfocused", "e");
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,11 @@ struct _E_Shelf
|
|||
E_Config_Shelf *cfg;
|
||||
unsigned char fit_along : 1;
|
||||
unsigned char fit_size : 1;
|
||||
unsigned char hidden : 1;
|
||||
int size;
|
||||
E_Config_Dialog *config_dialog;
|
||||
E_Menu *menu;
|
||||
Ecore_Timer *hide_timer;
|
||||
};
|
||||
|
||||
EAPI int e_shelf_init(void);
|
||||
|
|
|
@ -41,8 +41,8 @@ e_sys_init(void)
|
|||
/* this is not optimal - but it does work cleanly */
|
||||
_e_sys_exe_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
|
||||
_e_sys_cb_exit, NULL);
|
||||
/* delay this for 5.0 seconds while the rest of e starts up */
|
||||
ecore_timer_add(5.0, _e_sys_cb_timer, NULL);
|
||||
/* delay this for 2.0 seconds while the rest of e starts up */
|
||||
ecore_timer_add(2.0, _e_sys_cb_timer, NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -536,7 +536,6 @@ _e_test_internal(E_Container *con)
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 24;
|
||||
fmc.icon.list.h = 24;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
@ -576,7 +575,6 @@ _e_test_internal(E_Container *con)
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 1;
|
||||
fmc.view.no_subdir_jump = 1;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 24;
|
||||
fmc.icon.list.h = 24;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -35,7 +35,7 @@ static Evas_List *_thumb_queue = NULL;
|
|||
static int _objid = 0;
|
||||
static Evas_Hash *_thumbs = NULL;
|
||||
static int _pending = 0;
|
||||
static int _num_thumbnailers = 2;
|
||||
static int _num_thumbnailers = 1;
|
||||
static Ecore_Event_Handler *_exe_del_handler = NULL;
|
||||
static Ecore_Timer *_kill_timer = NULL;
|
||||
|
||||
|
|
|
@ -139,7 +139,10 @@ _e_ipc_cb_server_add(void *data, int type, void *event)
|
|||
Ecore_Ipc_Event_Server_Add *e;
|
||||
|
||||
e = event;
|
||||
ecore_ipc_server_send(e->server, 5, 1, 0, 0, 0, NULL, 0); /* send hello */
|
||||
ecore_ipc_server_send(e->server,
|
||||
5/*E_IPC_DOMAIN_THUMB*/,
|
||||
1/*hello*/,
|
||||
0, 0, 0, NULL, 0); /* send hello */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -164,7 +167,7 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
|
|||
char *key = NULL;
|
||||
|
||||
e = event;
|
||||
if (e->major != 5) return 1;
|
||||
if (e->major != 5/*E_IPC_DOMAIN_THUMB*/) return 1;
|
||||
switch (e->minor)
|
||||
{
|
||||
case 1:
|
||||
|
@ -187,7 +190,7 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
|
|||
eth->file = strdup(file);
|
||||
if (key) eth->key = strdup(key);
|
||||
_thumblist = evas_list_append(_thumblist, eth);
|
||||
if (!_timer) _timer = ecore_timer_add(0.000001, _e_cb_timer, NULL);
|
||||
if (!_timer) _timer = ecore_timer_add(0.01, _e_cb_timer, NULL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -234,7 +237,7 @@ _e_cb_timer(void *data)
|
|||
if (eth->key) free(eth->key);
|
||||
free(eth);
|
||||
|
||||
if (_thumblist) _timer = ecore_timer_add(0.000001, _e_cb_timer, NULL);
|
||||
if (_thumblist) _timer = ecore_timer_add(0.01, _e_cb_timer, NULL);
|
||||
else _timer = NULL;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -395,7 +395,6 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
|
|||
fmc.view.single_click = 1;
|
||||
fmc.view.no_subdir_jump = 1;
|
||||
fmc.view.no_subdir_drop = 1;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.view.link_drop = 1;
|
||||
fmc.icon.list.w = 24;
|
||||
fmc.icon.list.h = 24;
|
||||
|
@ -437,7 +436,6 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
|
|||
fmc.view.selector = 1;
|
||||
fmc.view.single_click = 0;
|
||||
fmc.view.no_subdir_jump = 0;
|
||||
fmc.view.extra_file_source = NULL;
|
||||
fmc.icon.list.w = 24;
|
||||
fmc.icon.list.h = 24;
|
||||
fmc.icon.fixed.w = 1;
|
||||
|
|
|
@ -45,6 +45,10 @@ static Evas_Object *list_object = NULL;
|
|||
static Evas_Object *icon_object = NULL;
|
||||
static Evas_List *wins = NULL;
|
||||
static Evas_List *win_selected = NULL;
|
||||
static E_Desk *last_desk = NULL;
|
||||
static int last_pointer_x = 0;
|
||||
static int last_pointer_y = 0;
|
||||
static E_Border *last_border = NULL;
|
||||
static int hold_count = 0;
|
||||
static int hold_mod = 0;
|
||||
static Evas_List *handlers = NULL;
|
||||
|
@ -82,7 +86,6 @@ e_winlist_show(E_Zone *zone)
|
|||
Evas_Object *o;
|
||||
Evas_List *l;
|
||||
E_Desk *desk;
|
||||
E_Border *bd;
|
||||
|
||||
E_OBJECT_CHECK_RETURN(zone, 0);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
|
||||
|
@ -152,12 +155,20 @@ e_winlist_show(E_Zone *zone)
|
|||
e_winlist_hide();
|
||||
return 1;
|
||||
}
|
||||
|
||||
bd = e_border_focused_get();
|
||||
if (bd)
|
||||
|
||||
if (e_config->winlist_list_show_other_desk_windows ||
|
||||
e_config->winlist_list_show_other_screen_windows)
|
||||
last_desk = e_desk_current_get(winlist->zone);
|
||||
if (e_config->winlist_warp_while_selecting)
|
||||
ecore_x_pointer_xy_get(winlist->zone->container->win,
|
||||
&last_pointer_x, &last_pointer_y);
|
||||
last_border = e_border_focused_get();
|
||||
if (last_border)
|
||||
{
|
||||
if (!bd->lock_focus_out)
|
||||
e_border_focus_set(bd, 0, 0);
|
||||
if (!last_border->lock_focus_out)
|
||||
e_border_focus_set(last_border, 0, 0);
|
||||
else
|
||||
last_border = NULL;
|
||||
}
|
||||
_e_winlist_activate_nth(1);
|
||||
evas_event_thaw(winlist->evas);
|
||||
|
@ -485,6 +496,7 @@ _e_winlist_border_del(E_Border *bd)
|
|||
{
|
||||
Evas_List *l;
|
||||
|
||||
if (bd == last_border) last_border = NULL;
|
||||
for (l = wins; l; l = l->next)
|
||||
{
|
||||
E_Winlist_Win *ww;
|
||||
|
@ -694,6 +706,26 @@ _e_winlist_show_active(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_winlist_restore_desktop(void)
|
||||
{
|
||||
if (last_desk &&
|
||||
(e_config->winlist_list_show_other_desk_windows ||
|
||||
e_config->winlist_list_show_other_screen_windows))
|
||||
e_desk_show(last_desk);
|
||||
if (e_config->winlist_warp_while_selecting)
|
||||
ecore_x_pointer_warp(winlist->zone->container->win,
|
||||
last_pointer_x, last_pointer_y);
|
||||
_e_winlist_deactivate();
|
||||
win_selected = NULL;
|
||||
e_winlist_hide();
|
||||
if (last_border)
|
||||
{
|
||||
e_border_focus_set(last_border, 1, 1);
|
||||
last_border = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
_e_winlist_cb_event_border_add(void *data, int type, void *event)
|
||||
{
|
||||
|
@ -737,7 +769,7 @@ _e_winlist_cb_key_down(void *data, int type, void *event)
|
|||
else if (!strcmp(ev->keysymbol, "space"))
|
||||
e_winlist_hide();
|
||||
else if (!strcmp(ev->keysymbol, "Escape"))
|
||||
e_winlist_hide();
|
||||
_e_winlist_restore_desktop();
|
||||
else if (!strcmp(ev->keysymbol, "1"))
|
||||
_e_winlist_activate_nth(0);
|
||||
else if (!strcmp(ev->keysymbol, "2"))
|
||||
|
|
Loading…
Reference in New Issue