fs layer in... using efsd... :) primitive for now


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 22 years ago
parent 70034543c0
commit f744c4833b
  1. 6
      configure.in
  2. 5
      src/Makefile.am
  3. 14
      src/e.h
  4. 65
      src/fs.c
  5. 1
      src/icons.c
  6. 1
      src/main.c
  7. 39
      src/view.c

@ -81,6 +81,10 @@ ebits_libs=`ebits-config --libs`
ecore_cflags=`ecore-config --cflags`
ecore_libs=`ecore-config --libs`
# a hack for now till efsd gets a proper efsd-config
efsd_cflags='-I/usr/local/include'
efsd_libs='-L/usr/local/lib -lefsd'
AC_SUBST(evas_cflags)
AC_SUBST(evas_libs)
AC_SUBST(edb_cflags)
@ -89,6 +93,8 @@ AC_SUBST(ebits_cflags)
AC_SUBST(ebits_libs)
AC_SUBST(ecore_cflags)
AC_SUBST(ecore_libs)
AC_SUBST(efsd_cflags)
AC_SUBST(efsd_libs)
AC_OUTPUT([
Makefile

@ -2,7 +2,7 @@
INCLUDES = \
-I$(top_srcdir)/intl \
@evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@
@evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@
bin_PROGRAMS = enlightenment
@ -12,6 +12,7 @@ border.c \
config.c \
desktops.c \
exec.c \
fs.c \
icccm.c \
icons.c \
main.c \
@ -22,5 +23,5 @@ util.c \
view.c \
e.h
enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ -lm $(INTLLIBS)
enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ -lm $(INTLLIBS)

@ -1,10 +1,5 @@
#include "../config.h"
#include <X11/Xlib.h>
#include <Imlib2.h>
#include <Evas.h>
#include <Ebits.h>
#include <Ecore.h>
#include <Edb.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -20,6 +15,12 @@
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
#include <Imlib2.h>
#include <Evas.h>
#include <Ebits.h>
#include <Ecore.h>
#include <Edb.h>
#include <libefsd.h>
#define E_PROF 1
#ifdef E_PROF
@ -600,3 +601,6 @@ E_Menu *e_build_menu_build_number(E_Build_Menu *bm, E_DB_File *db, int num
void e_build_menu_build(E_Build_Menu *bm);
void e_build_menu_free(E_Build_Menu *bm);
E_Build_Menu *e_build_menu_new_from_db(char *file);
void e_fs_add_event_handler(void (*func) (EfsdEvent *ev));
void e_fs_init(void);

@ -0,0 +1,65 @@
#include "e.h"
static EfsdConnection *ec = NULL;
static Evas_List fs_handlers = NULL;
static void _e_fs_fd_handle(int fd);
static void
_e_fs_fd_handle(int fd)
{
EfsdEvent ev;
#if 0 /* WE REALLY need NON BLOCKING comms with efsd! cK!!!!! */
while (efsd_read_event(ec->fd, &ev) >= 0)
{
Evas_List l;
for (l = fs_handlers; l; l = l->next)
{
void (*func) (EfsdEvent *ev);
func = l->data;
func(&ev);
}
efsd_cleanup_event(&ev);
}
#endif
}
void
e_fs_add_event_handler(void (*func) (EfsdEvent *ev))
{
if (!func) return;
fs_handlers = evas_list_append(fs_handlers, func);
}
void
e_fs_init(void)
{
int i;
/* already have an efsd around? */
ec = efsd_open();
/* no - efsd around */
if (!ec)
{
/* start efsd */
e_exec_run("efsd");
for (i = 0; (!ec); i++)
{
ec = efsd_open();
sleep(1);
if (i > 8) break;
}
}
if (!ec)
{
fprintf(stderr, "efsd is not running - please run efsd.\n");
exit(-1);
}
e_add_event_fd(efsd_get_connection_fd(ec), _e_fs_fd_handle);
/* HACK FIXME: testing.... */
efsd_start_monitor(ec, getenv("HOME"));
}

@ -20,4 +20,5 @@ e_icon_new(void)
void
e_icon_calulcate_geometry(E_Icon *icon)
{
if (!icon->view) return;
}

@ -51,6 +51,7 @@ main(int argc, char **argv)
e_border_init();
e_actions_init();
e_menu_init();
e_fs_init();
e_view_init();
setup();

@ -243,27 +243,63 @@ e_view_new(void)
void
e_view_set_background(E_View *v)
{
v->changed = 1;
}
void
e_view_set_dir(E_View *v, char *dir)
{
{
/* stop monitoring old dir */
IF_FREE(v->directory);
v->directory = strdup(dir);
/* start monitoring new dir */
{
/* bad hack- lets just add some dummy stuff for testing */
int i;
char *files[8] = {
"The first file",
"Some more things",
"K is a FISH!",
"Possum Eyes",
"Nasty Bums",
"BLUMFRUB!",
"Oh lookie here now!",
"Last one...."
};
for (i = 0; i < 8; i++)
{
E_Icon *icon;
icon = e_icon_new();
icon->file = strdup(files[i]);
e_view_add_icon(v, icon);
}
}
v->changed = 1;
}
void
e_view_scroll(E_View *v, int dx, int dy)
{
v->changed = 1;
}
void
e_view_add_icon(E_View *v, E_Icon *icon)
{
if (icon->view) return;
icon->view = v;
icon->changed = 1;
v->changed = 1;
}
void
e_view_del_icon(E_View *v, E_Icon *icon)
{
if (!icon->view) return;
icon->view = NULL;
icon->changed = 1;
v->changed = 1;
}
@ -302,6 +338,7 @@ e_view_realize(E_View *v)
XEV_EXPOSE | XEV_MOUSE_MOVE |
XEV_BUTTON | XEV_IN_OUT | XEV_KEY);
e_window_show(v->win.main);
e_view_set_dir(v, v->directory);
v->changed = 1;
}

Loading…
Cancel
Save