been working on E............ needs efsd now, desktops are now views, new


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 22 years ago
parent 9cc55ff857
commit f3e2ca146f
  1. 57
      README
  2. BIN
      data/images/bg.jpg
  3. BIN
      data/images/bg.png
  4. BIN
      data/orig/icon_file.png
  5. BIN
      data/orig/icon_file.xcf
  6. 1
      src/Makefile.am
  7. 3
      src/actions.c
  8. 43
      src/background.c
  9. 15
      src/border.c
  10. 389
      src/desktops.c
  11. 51
      src/e.h
  12. 77
      src/fs.c
  13. 30
      src/icons.c
  14. 2
      src/main.c
  15. 31
      src/menu.c
  16. 33
      src/util.c
  17. 343
      src/view.c

@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
Enlightenment 0.17.0 CVS Code....
Enlightenment 0.17.pre CVS Code....
-------------------------------------------------------------------------------
The Rasterman - raster@valinux.com, raster@rasterman.com
@ -18,10 +18,11 @@ you at all use this code, you are HEAVILY URGED, when it is finally released,
to remove all traces of anything this CVS code base has installed on your
system (it is COMPLETELY up to you to keep track of that - do NOT expect any
help), and then install the full release on a cleaned system. Don't come
asking "can I just keep using CVS" oonce things are released - thqat is the
reason I pu this paragraph here - so you don't ask. The asnwer is the same
asking "can I just keep using CVS" once things are released - that is the
reason I put this paragraph here - so you don't ask. The asnwer is the same
as above - if there is a proper final release use that. CVS is really only
for those havily hacking on the code.
for those havily hacking on the code, or whose curiosity is too much to resist
not giving it a look and try.
Now we have that warning over and done with. How to build and install from
CVS?
@ -49,21 +50,22 @@ Enlightenment does not check for previously running Window Managers right
now - so you need to make sure no other WM is running - E will not do that
for you.
Enlightenment has no menus or keybindings or any way of launching
applications right now - you'll have to figure out an alternative way of
doing it.
Enlightenment has no keybindings right now, but does have a primitve menu for
launching some applications. It is configurable - it's in a database file
and tere is a script that builds this menu - you could build a new one after
editing the script or do whatever your like.
Enlightenment only handles a small subset of ICCCM and thus will have bugs -
some applications will not behave correctly and may apear in odd spots or
some applications will not behave correctly and may appear in odd spots or
not resize or place themselves properly etc. Expect this - it's code being
worked on. Just be happy it does as much as it already does.
Enlightenment RELIES on lots of libraires that have been written. Ecore,
Ebits, Evas, Edb, Imlib2 just to mention a few. Especially Ebits, Ecore and
Evas change in CVS often - you will need the absolute latest of these if you
wish Enlightenment 0.17 code to run properly or compile. If you update
Enlightenment from CVS update these too to get any changes they have in
their trees.
Ebits, Evas, Edb, Imlib2, Efsd just to mention a few. Especially Ebits,
Ecore, Efsd and Evas change in CVS often - you will need the absolute latest
of these if you wish Enlightenment 0.17 code to run properly or compile. If
you update Enlightenment from CVS update these too to get any changes they
have in their trees.
If you plan on working on the code... STOP! don't rush in and work on it -
even if you have CVS commit access - EXPECT me (Raster) to revert any changes
@ -75,22 +77,27 @@ intricate than E 0.16 - but at the same time it's much cleaner and more
object oriented. Learn it well first. Some parts of E 0.17 are "hacked" with
hard-coded stuff, just so, for now, it works. They will be virtualized and
imporved over time. If you have plans - tell me about them first - discuss
them before you go impliment them. I know I already have a lot of the
components of E 0.17's code planned in my head - but I won't get to them for
a while - and if people go impliment or hack bad stuff in, it means I have to
spend lots of time fixing something that is bad in the first place, or we
end up doing duplicate work. There *IS* a plan - believe it or not - but to
be honest - it's more complex and large than I can just write down in a
README, so talk about your ideas first. I'm going to be ruthless in keeping
the code neat, clean and free of nasty hacks (except ones I put in as
temporary stop-gap measures to make the thing work - since I know where
those are and what I need to do to do it right). If you can't find me or I
don't reply to your e-mail - don't get impatient - just wait. I currently
them before you go impliment them - once you've discussed them and we all
aree on how it should be done, you can go ahead and do it. I know I already
have a lot of the components of E 0.17's code planned in my head - but I
won't get to them for a while - and if people go impliment or hack bad stuff
in, it means I have to spend lots of time fixing something that is bad in the
first place, or we end up doing duplicate work. There *IS* a plan - believe
it or not - but to be honest - it's more complex and large than I can just
write down in a README, so talk about your ideas first. I'm going to be
ruthless in keeping the code neat, clean and free of nasty hacks (except ones
I put in as temporary stop-gap measures to make the thing work - since I know
where those are and what I need to do to do it right). If you can't find me
or I don't reply to your e-mail - don't get impatient - just wait. I currently
have no network access at home, so I'm doing a chunk of code offline. I'll
get to your mail and queries as time allows.
If you have problems with the code or bugs to report, kindly forward them to
/dev/null (the code is in now way or form ready for bug reports - I don't
want crap filling my mailbox).
want crap filling my mailbox), unless its a patch hat fixes a silly bug
somewhere. Only experienced people should in any way consider sending a bug
report as I need useful reports, not junk cluttering my mailbox.
I hope that clears things up for now.
In the meantime - have fun.

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

@ -8,6 +8,7 @@ bin_PROGRAMS = enlightenment
enlightenment_SOURCES = \
actions.c \
background.c \
border.c \
config.c \
desktops.c \

@ -426,7 +426,8 @@ e_actions_init(void)
/* FIXME: these REALLY need to go into other file(s) but it's not worht it */
/* yet at this point. it can be done later */
static void
e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)

@ -0,0 +1,43 @@
#include "e.h"
void
e_background_free(E_Background *bg)
{
IF_FREE(bg->image);
if ((bg->evas) && (bg->obj))
evas_del_object(bg->evas, bg->obj);
FREE(bg);
}
E_Background *
e_background_new(void)
{
E_Background *bg;
bg = NEW(E_Background, 1);
ZERO(bg, E_Background, 1);
OBJ_INIT(bg, e_background_free);
return bg;
}
void
e_background_realize(E_Background *bg, Evas evas)
{
Evas_Object o;
int iw, ih;
if (bg->evas) return;
/* FIXME: boring for now - just a scaled image */
bg->evas = evas;
bg->obj = evas_add_image_from_file(bg->evas, bg->image);
evas_set_layer(bg->evas, bg->obj, 0);
evas_move(bg->evas, bg->obj, 0, 0);
evas_resize(bg->evas, bg->obj, bg->geom.w, bg->geom.h);
evas_set_image_fill(bg->evas, bg->obj, 0, 0, bg->geom.w, bg->geom.h);
evas_show(bg->evas, bg->obj);
o = evas_add_image_from_file(bg->evas, PACKAGE_DATA_DIR"/data/images/e_logo.png");
evas_get_image_size(bg->evas, o, &iw, &ih);
evas_move(bg->evas, o, (bg->geom.w - iw) / 2, (bg->geom.h - ih) / 2);
evas_show(bg->evas, o);
}

@ -123,7 +123,9 @@ e_configure_request(Eevent * ev)
if (e->mask & EV_VALUE_Y)
b->current.requested.y = e->y;
if (e->mask & EV_VALUE_W)
b->current.requested.w = e->w + pl + pr;
{
b->current.requested.w = e->w + pl + pr;
}
if (e->mask & EV_VALUE_H)
{
if (b->current.shaded == b->client.h)
@ -1188,6 +1190,8 @@ e_border_adopt(Window win, int use_client_pos)
/* fix size so it matches the hints a client asks for */
b->changed = 1;
e_border_adjust_limits(b);
b->current.requested.h = b->current.h;
b->current.requested.w = b->current.w;
e_border_raise(b);
e_window_show(win);
return b;
@ -1632,7 +1636,10 @@ e_border_adjust_limits(E_Border *b)
{
int w, h, pl, pr, pt, pb, mx, my;
if (b->mode.move) e_resist_border(b);
if (b->mode.move)
{
e_resist_border(b);
}
else
{
b->current.x = b->current.requested.x;
@ -1642,8 +1649,8 @@ e_border_adjust_limits(E_Border *b)
b->current.w = b->current.requested.w;
b->current.h = b->current.requested.h - b->current.shaded;
if (!b->current.shaded)
{
if ((!b->current.shaded) && (!b->mode.move))
{
if (b->current.w < 1) b->current.w = 1;
if (b->current.h < 1) b->current.h = 1;

@ -6,315 +6,15 @@ static int screen_w, screen_h;
static int current_desk = 0;
static void e_idle(void *data);
static void e_key_down(Eevent * ev);
static void e_key_up(Eevent * ev);
static void e_mouse_down(Eevent * ev);
static void e_mouse_up(Eevent * ev);
static void e_mouse_in(Eevent * ev);
static void e_mouse_out(Eevent * ev);
static void e_window_expose(Eevent * ev);
static void
e_idle(void *data)
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
e_desktops_update(desk);
}
e_db_flush();
return;
UN(data);
}
/* handling key down events */
static void
e_key_down(Eevent * ev)
{
Ev_Key_Down *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
if (!strcmp(e->key, "Up"))
{
}
else if (!strcmp(e->key, "Down"))
{
}
else if (!strcmp(e->key, "Left"))
{
}
else if (!strcmp(e->key, "Right"))
{
}
else if (!strcmp(e->key, "Escape"))
{
}
else
{
/* infact we should pass this onto the view handling */
/* this desktop here */
char *type;
type = e_key_press_translate_into_typeable(e);
if (type)
{
}
}
}
}
}
}
/* handling key up events */
static void
e_key_up(Eevent * ev)
{
Ev_Key_Up *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
}
}
}
}
/* handling mouse down events */
static void
e_mouse_down(Eevent * ev)
{
Ev_Mouse_Down *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_button_down(evas, x, y, e->button);
if (e->button == 1)
{
static E_Build_Menu *buildmenu = NULL;
if (!buildmenu)
{
char *apps_menu_db;
apps_menu_db = e_config_get("apps_menu");
if (apps_menu_db) buildmenu = e_build_menu_new_from_db(apps_menu_db);
}
if (buildmenu)
{
static E_Menu *menu = NULL;
menu = buildmenu->menu;
if (menu)
e_menu_show_at_mouse(menu, e->rx, e->ry, e->time);
}
}
return;
}
}
}
}
/* handling mouse up events */
static void
e_mouse_up(Eevent * ev)
{
Ev_Mouse_Up *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_button_up(evas, x, y, e->button);
return;
}
}
}
}
/* handling mouse move events */
static void
e_mouse_move(Eevent * ev)
{
Ev_Mouse_Move *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_move(evas, x, y);
return;
}
}
}
}
/* handling mouse enter events */
static void
e_mouse_in(Eevent * ev)
{
Ev_Window_Enter *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
/* focus handling for desktop */
e_focus_to_window(e->win);
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_move(evas, x, y);
evas_event_enter(evas);
return;
}
}
}
}
/* handling mouse leave events */
static void
e_mouse_out(Eevent * ev)
{
Ev_Window_Leave *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_move(evas, x, y);
evas_event_leave(evas);
return;
}
}
}
}
/* handling expose events */
static void
e_window_expose(Eevent * ev)
{
Ev_Window_Expose *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (!desk->evas.pmap)
{
if (evas_get_window(desk->evas.desk) == e->win)
evas_update_rect(desk->evas.desk, e->x, e->y, e->w, e->h);
}
}
}
}
void
e_desktops_init(void)
{
@ -325,14 +25,6 @@ e_desktops_init(void)
e_window_show(e_base_win);
desk = e_desktops_new();
e_desktops_show(desk);
e_event_filter_handler_add(EV_MOUSE_DOWN, e_mouse_down);
e_event_filter_handler_add(EV_MOUSE_UP, e_mouse_up);
e_event_filter_handler_add(EV_MOUSE_MOVE, e_mouse_move);
e_event_filter_handler_add(EV_MOUSE_IN, e_mouse_in);
e_event_filter_handler_add(EV_MOUSE_OUT, e_mouse_out);
e_event_filter_handler_add(EV_WINDOW_EXPOSE, e_window_expose);
e_event_filter_handler_add(EV_KEY_DOWN, e_key_down);
e_event_filter_handler_add(EV_KEY_UP, e_key_up);
e_event_filter_idle_handler_add(e_idle, NULL);
e_icccm_advertise_e_compat();
@ -459,7 +151,6 @@ e_desktops_free(E_Desktop *desk)
}
}
e_window_destroy(desk->win.main);
if (desk->evas.pmap) e_pixmap_free(desk->evas.pmap);
IF_FREE(desk->name);
IF_FREE(desk->dir);
FREE(desk);
@ -468,47 +159,20 @@ e_desktops_free(E_Desktop *desk)
void
e_desktops_init_file_display(E_Desktop *desk)
{
int max_colors = 216;
int font_cache = 1024 * 1024;
int image_cache = 8192 * 1024;
char *font_dir;
font_dir = e_config_get("fonts");
/* software */
desk->evas.desk = evas_new_all(e_display_get(),
desk->win.container,
0, 0, screen_w, screen_h,
RENDER_METHOD_ALPHA_SOFTWARE,
max_colors,
font_cache,
image_cache,
font_dir);
desk->win.desk = evas_get_window(desk->evas.desk);
e_add_child(desk->win.container, desk->win.desk);
/* pixmap backing for desktop */
desk->evas.pmap = e_pixmap_new(desk->win.desk, screen_w, screen_h, 0);
evas_set_output(desk->evas.desk, e_display_get(), desk->evas.pmap,
evas_get_visual(desk->evas.desk), evas_get_colormap(desk->evas.desk));
e_window_set_background_pixmap(desk->win.desk, desk->evas.pmap);
/* normal stuff */
e_window_set_events(desk->win.desk, XEV_EXPOSE | XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT | XEV_KEY);
desk->view = e_view_new();
desk->view->size.w = desk->real.w;
desk->view->size.h = desk->real.h;
desk->view->bg = e_background_new();
desk->view->bg->image = strdup(PACKAGE_DATA_DIR"/data/images/bg.jpg");
/* fixme later */
/* uncomment this and comment out the next line for some tress testing */
/* desk->view->dir = strdup("/dev");*/
desk->view->dir = strdup(e_file_home());
e_view_realize(desk->view);
if (desk->view->options.back_pixmap) e_view_update(desk->view);
desk->win.desk = desk->view->win.base;
e_window_reparent(desk->win.desk, desk->win.container, 0, 0);
e_window_show(desk->win.desk);
{
Evas_Object o;
Evas e;
char buf[4096];
e = desk->evas.desk;
sprintf(buf, "%sbg.png", e_config_get("images"));
o = evas_add_image_from_file(e, buf);
evas_move(e, o, 0, 0);
evas_resize(e, o, screen_w, screen_h);
evas_show(e, o);
sprintf(buf, "%se_logo.png", e_config_get("images"));
o = evas_add_image_from_file(e, buf);
evas_move(e, o, 0, 0);
evas_show(e, o);
}
}
E_Desktop *
@ -565,13 +229,13 @@ e_desktops_delete(E_Desktop *d)
void
e_desktops_show(E_Desktop *d)
{
e_desktops_update(d);
e_window_show(d->win.main);
}
void
e_desktops_hide(E_Desktop *d)
{
if (d->view->options.back_pixmap) e_view_update(d->view);
e_window_hide(d->win.main);
}
@ -603,28 +267,3 @@ e_desktops_get_current(void)
{
return current_desk;
}
void
e_desktops_update(E_Desktop *desk)
{
Imlib_Updates up;
up = evas_render_updates(desk->evas.desk);
if (up)
{
Imlib_Updates u;
for (u = up; u; u = imlib_updates_get_next(u))
{
int x, y, w, h;
imlib_updates_get_coordinates(u, &x, &y, &w, &h);
e_window_clear_area(desk->win.desk, x, y, w, h);
}
imlib_updates_free(up);
}
if (desk->changed)
{
desk->changed = 0;
}
}

@ -132,6 +132,7 @@ typedef struct _E_Rect E_Rect;
typedef struct _E_Active_Action_Timer E_Active_Action_Timer;
typedef struct _E_View E_View;
typedef struct _E_Icon E_Icon;
typedef struct _E_Background E_Background;
typedef struct _E_Menu E_Menu;
typedef struct _E_Menu_Item E_Menu_Item;
typedef struct _E_Build_Menu E_Build_Menu;
@ -279,10 +280,7 @@ struct _E_Desktop
Window container;
Window desk;
} win;
struct {
Pixmap pmap;
Evas desk;
} evas;
E_View *view;
int x, y;
struct {
int w, h;
@ -307,7 +305,7 @@ struct _E_View
{
OBJ_PROPERTIES;
char *directory;
char *dir;
struct {
Evas_Render_Method render_method;
@ -330,10 +328,21 @@ struct _E_View
int x, y;
} location;
struct {
Evas_Object obj_rect;
Evas_Object obj_l1;
Evas_Object obj_l2;
Evas_Object obj_l3;
Evas_Object obj_l4;
int on;
int start_x, start_y;
int x, y, w, h;
} selection;
E_Background *bg;
int is_listing;
int monitor_id;
Evas_List icons;
int changed;
@ -344,9 +353,9 @@ struct _E_Icon
OBJ_PROPERTIES;
char *file;
char *dir;
E_View *view;
int x, y, w, h;
struct {
int text_location;
@ -363,13 +372,30 @@ struct _E_Icon
Ebits_Object base_text;
} obj;
struct {
int clicked;
int selected;
int hilited;
int clicked;
int selected;
int hilited;
} state;
char *icon;
int visible;
int changed;
};
struct _E_Background
{
OBJ_PROPERTIES;
Evas evas;
struct {
int sx, sy;
int w, h;
} geom;
/* FIXME: REALLY boring for now - just a scaled image - temporoary */
char *image;
Evas_Object obj;
};
struct _E_Menu
{
OBJ_PROPERTIES;
@ -548,7 +574,10 @@ int e_file_is_dir(char *file);
char *e_file_home(void);
int e_file_mkdir(char *dir);
int e_file_cp(char *src, char *dst);
char *e_file_real(char *file);
char *e_file_get_file(char *file);
char *e_file_get_dir(char *file);
void e_exec_set_args(int argc, char **argv);
void e_exec_restart(void);
pid_t e_exec_run(char *exe);
@ -604,3 +633,5 @@ 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);
EfsdConnection *e_fs_get_connection(void);

@ -9,22 +9,55 @@ static void
_e_fs_fd_handle(int fd)
{
EfsdEvent ev;
int i = 1;
#if 0 /* WE REALLY need NON BLOCKING comms with efsd! cK!!!!! */
while (efsd_read_event(ec->fd, &ev) >= 0)
/* VERY nasty - sicne efas has no way of checkign If an event is in the */
/* event queue waiting to be picked up - i cant loop and get the events */
printf("_e_fs_fd_handle(%i)\n", fd);
while (i >= 0)
{
Evas_List l;
fd_set fdset;
struct timeval tv;
for (l = fs_handlers; l; l = l->next)
FD_ZERO(&fdset);
FD_SET(fd, &fdset);
tv.tv_sec = 0;
tv.tv_usec = 0;
select(fd + 1, &fdset, NULL, NULL, &tv);
if (FD_ISSET(fd, &fdset))
{
void (*func) (EfsdEvent *ev);
func = l->data;
func(&ev);
i = efsd_next_event(ec, &ev);
if (i < 0)
{
efsd_close(ec);
e_del_event_fd(fd);
/* FIXME: need to queue a popup dialog here saying */
/* efsd went wonky */
printf("EEEEEEEEEEK efsd went wonky\n");
/*
ec = efsd_open();
if (ec)
e_add_event_fd(efsd_get_connection_fd(ec),
_e_fs_fd_handle);
*/
}
if (i >= 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);
}
}
efsd_cleanup_event(&ev);
else
i = -1;
}
#endif
}
void
@ -50,16 +83,32 @@ e_fs_init(void)
{
ec = efsd_open();
sleep(1);
if (i > 8) break;
/* > than 4 seconds later efsd isnt there... try forced start */
if (i > 4)
{
e_exec_run("efsd --forcestart");
for (i = 0; (!ec); i++)
{
ec = efsd_open();
sleep(1);
/* > 4 seconds later forced efsd not alive - give up */
if (i > 4) break;
}
break;
}
}
}
/* after several atempts to talk to efsd - lets give up */
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"));
}
EfsdConnection *
e_fs_get_connection(void)
{
return ec;
}

@ -22,3 +22,33 @@ e_icon_calulcate_geometry(E_Icon *icon)
{
if (!icon->view) return;
}
void
e_icon_realize(E_Icon *icon)
{
int fx, fy;
int iw, ih;
double tw, th;
icon->obj.icon = evas_add_image_from_file(icon->view->evas, icon->icon);
icon->obj.filename = evas_add_text(icon->view->evas, "borzoib", 8, icon->file);
evas_get_geometry(icon->view->evas, icon->obj.filename, NULL, NULL, &tw, &th);
evas_get_image_size(icon->view->evas, icon->obj.icon, & iw, &ih);
evas_set_color(icon->view->evas, icon->obj.filename, 0, 0, 0, 255);
fx = icon->x + ((iw - tw) / 2);
fy = icon->y + ih;
evas_set_layer(icon->view->evas, icon->obj.icon, 10);
evas_set_layer(icon->view->evas, icon->obj.filename, 10);
evas_move(icon->view->evas, icon->obj.icon, icon->x, icon->y);
evas_move(icon->view->evas, icon->obj.filename, fx, fy);
if (icon->visible)
{
evas_show(icon->view->evas, icon->obj.icon);
evas_show(icon->view->evas, icon->obj.filename);
}
}
void
e_icon_unrealize(E_Icon *icon)
{
}

@ -47,11 +47,11 @@ main(int argc, char **argv)
e_event_filter_init();
e_ev_x_init();
e_fs_init();
e_desktops_init();
e_border_init();
e_actions_init();
e_menu_init();
/* e_fs_init(); */
e_view_init();
setup();

@ -39,6 +39,7 @@ e_scroller_timer(int val, void *data)
scroll_speed = (int)(((t - last_time) / 0.02) * (double)scroll_speed);
last_time = t;
ok = 0;
if (mouse_x >= (screen_w - resist))
{
int scroll = 0;
@ -49,10 +50,7 @@ e_scroller_timer(int val, void *data)
m = l->data;
if ((m->current.x + m->current.w) > screen_w)
{
scroll = m->current.x + m->current.w - screen_w;
break;
}
scroll = m->current.x + m->current.w - screen_w;
}
if (scroll)
{
@ -71,10 +69,7 @@ e_scroller_timer(int val, void *data)
m = l->data;
if (m->current.x < 0)
{
scroll = -m->current.x;
break;
}
scroll = -m->current.x;
}
if (scroll)
{
@ -93,10 +88,7 @@ e_scroller_timer(int val, void *data)
m = l->data;
if ((m->current.y + m->current.h) > screen_h)
{
scroll = m->current.y + m->current.h - screen_h;
break;
}
scroll = m->current.y + m->current.h - screen_h;
}
if (scroll)
{
@ -115,10 +107,7 @@ e_scroller_timer(int val, void *data)
m = l->data;
if (m->current.y < 0)
{
scroll = -m->current.y;
break;
}
scroll = -m->current.y;
}
if (scroll)
{
@ -127,7 +116,7 @@ e_scroller_timer(int val, void *data)
ok = 1;
}
}
if (ok)
if ((ok) && (open_menus))
e_add_event_timer("menu_scroller", 0.02, e_scroller_timer, val + 1, NULL);
return;
UN(data);
@ -208,7 +197,11 @@ e_key_down(Eevent * ev)
E_Menu *m;
m = l->data;
if ((e->win == m->win.main) || (e->win == m->win.evas)) ok = 1;
if ((e->win == m->win.main) || (e->win == m->win.evas))
{
ok = 1;
break;
}
}
}
if (ok)
@ -223,6 +216,7 @@ e_key_down(Eevent * ev)
if (m->selected)
{
mi = m->selected;
break;
}
}
if (!strcmp(e->key, "Up"))
@ -446,6 +440,7 @@ e_window_expose(Eevent * ev)
{
m->first_expose = 1;
evas_update_rect(m->evas, e->x, e->y, e->w, e->h);
break;
}
}
}

@ -78,3 +78,36 @@ e_file_cp(char *src, char *dst)
fclose(f2);
return 1;
}
char *
e_file_real(char *file)
{
char buf[4096];
if (!realpath(file, buf)) return strdup("");
return strdup(buf);
}
char *
e_file_get_file(char *file)
{
char *p;
char buf[4096];
p = strchr(file, '/');
if (!p) return strdup(file);
return strdup(&(p[1]));
}
char *
e_file_get_dir(char *file)
{
char *p;
char buf[4096];
strcpy(buf, file);
p = strchr(buf, '/');
if (!p) return strdup(file);
*p = 0;
return strdup(buf);
}

@ -12,12 +12,14 @@ static void e_mouse_move(Eevent * ev);
static void e_mouse_in(Eevent * ev);
static void e_mouse_out(Eevent * ev);
static void e_window_expose(Eevent * ev);
static void e_view_handle_fs(EfsdEvent *ev);
static void
e_idle(void *data)
{
Evas_List l;
printf("view idle.\n");
for (l = views; l; l = l->next)
{
E_View *v;
@ -83,6 +85,7 @@ e_key_down(Eevent * ev)
{
}
}
return;
}
}
}
@ -94,6 +97,7 @@ e_key_up(Eevent * ev)
Evas_List l;
e = ev->event;
return;
for (l = views; l; l = l->next)
{
E_View *v;
@ -116,7 +120,40 @@ e_mouse_down(Eevent * ev)
v = l->data;
if (e->win == v->win.main)
{
/* FIXME: */
/* normally would handle selection in evasa object callbacks */
/* but for now it's handled here */
if (e->button == 1)
{
v->selection.on = 1;
v->selection.start_x = e->x;
v->selection.start_y = e->y;
v->selection.x = e->x;
v->selection.y = e->y;
v->selection.w = 1;
v->selection.h = 1;
if (!v->selection.obj_rect)
{
v->selection.obj_rect = evas_add_rectangle(v->evas);
v->selection.obj_l1 = evas_add_line(v->evas);
v->selection.obj_l2 = evas_add_line(v->evas);
v->selection.obj_l3 = evas_add_line(v->evas);
v->selection.obj_l4 = evas_add_line(v->evas);
evas_set_color(v->evas, v->selection.obj_rect, 255, 255, 255, 100);
evas_set_color(v->evas, v->selection.obj_l1, 0, 0, 0, 200);
evas_set_color(v->evas, v->selection.obj_l2, 0, 0, 0, 200);
evas_set_color(v->evas, v->selection.obj_l3, 0, 0, 0, 200);
evas_set_color(v->evas, v->selection.obj_l4, 0, 0, 0, 200);
evas_set_layer(v->evas, v->selection.obj_rect, 100);
evas_set_layer(v->evas, v->selection.obj_l1, 100);
evas_set_layer(v->evas, v->selection.obj_l2, 100);
evas_set_layer(v->evas, v->selection.obj_l3, 100);
evas_set_layer(v->evas, v->selection.obj_l4, 100);
}
e_view_update_selection(v, e->x, e->y);
}
evas_event_button_down(v->evas, e->x, e->y, e->button);
return;
}
}
}
@ -135,6 +172,54 @@ e_mouse_up(Eevent * ev)
v = l->data;
if (e->win == v->win.main)
{
/* FIXME: temporary for now- should only do this if its a deskop */
/* view and desktops accept focus on click. */
/* e_focus_to_window(e->win); */
if ((v->selection.w < 6) && (v->selection.h < 6))
{
if (e->button == 1)
{
static E_Build_Menu *buildmenu = NULL;
if (!buildmenu)
{
char *apps_menu_db;
apps_menu_db = e_config_get("apps_menu");
if (apps_menu_db) buildmenu = e_build_menu_new_from_db(apps_menu_db);
}
if (buildmenu)
{
static E_Menu *menu = NULL;
menu = buildmenu->menu;
if (menu)
e_menu_show_at_mouse(menu, e->rx, e->ry, e->time);
}
}
else if (e->button == 3)
{
static E_Menu *menu = NULL;
if (!menu)
{
E_Menu_Item *menuitem;
menu = e_menu_new();
menu->pad.icon = 2;
menu->pad.state = 2;
menuitem = e_menu_item_new("Enlightenment "VERSION);
menuitem->icon = strdup(PACKAGE_DATA_DIR"/data/images/e_logo.png");
e_menu_add_item(menu, menuitem);
}
if (menu)
e_menu_show_at_mouse(menu, e->rx, e->ry, e->time);
}
}
if (e->button == 1)
{
v->selection.on = 0;
e_view_update_selection(v, e->x, e->y);
}
evas_event_button_up(v->evas, e->x, e->y, e->button);
}
}
@ -154,7 +239,9 @@ e_mouse_move(Eevent * ev)
v = l->data;
if (e->win == v->win.main)
{
e_view_update_selection(v, e->x, e->y);
evas_event_move(v->evas, e->x, e->y);
return;
}
}
}
@ -173,7 +260,11 @@ e_mouse_in(Eevent * ev)
v = l->data;
if (e->win == v->win.main)
{
/* FIXME: temporary for now- should only do this if its a deskop */
/* view and desktops accept focus on mouse. */
e_focus_to_window(e->win);
evas_event_enter(v->evas);
return;
}
}
}
@ -193,6 +284,7 @@ e_mouse_out(Eevent * ev)
if (e->win == v->win.main)
{
evas_event_leave(v->evas);
return;
}
}
}
@ -212,11 +304,198 @@ e_window_expose(Eevent * ev)
if (e->win == v->win.main)
{
if (!(v->pmap))
evas_update_rect(v->evas, e->x, e->y, e->w, e->h);
evas_update_rect(v->evas, e->x, e->y, e->w, e->h);
v->changed = 1;
return;
}
}
}
int
e_view_filter_file(E_View *v, char *file)
{
if (file[0] == '.') return 0;
return 1;
}
void
e_view_update_selection(E_View *v, int x, int y)
{
if (v->selection.on)
{
if (x < v->selection.start_x)
{
v->selection.w = (-(x - v->selection.start_x)) + 1;
v->selection.x = x;
}
else
{
v->selection.w = (x - v->selection.start_x) + 1;
v->selection.x = v->selection.start_x;
}
if (y < v->selection.start_y)
{
v->selection.h = (-(y - v->selection.start_y)) + 1;
v->selection.y = y;
}
else
{
v->selection.h = (y - v->selection.start_y) + 1;
v->selection.y = v->selection.start_y;
}
evas_move(v->evas, v->selection.obj_rect, v->selection.x, v->selection.y);
evas_resize(v->evas, v->selection.obj_rect, v->selection.w, v->selection.h);
evas_set_line_xy(v->evas, v->selection.obj_l1, v->selection.x, v->selection.y, v->selection.x + v->selection.w - 1, v->selection.y);
evas_set_line_xy(v->evas, v->selection.obj_l2, v->selection.x, v->selection.y, v->selection.x, v->selection.y + v->selection.h - 1);
evas_set_line_xy(v->evas, v->selection.obj_l3, v->selection.x, v->selection.y + v->selection.h - 1, v->selection.x + v->selection.w - 1, v->selection.y + v->selection.h - 1);
evas_set_line_xy(v->evas, v->selection.obj_l4, v->selection.x + v->selection.w - 1, v->selection.y, v->selection.x + v->selection.w - 1, v->selection.y + v->selection.h - 1);
evas_show(v->evas, v->selection.obj_rect);
evas_show(v->evas, v->selection.obj_l1);
evas_show(v->evas, v->selection.obj_l2);
evas_show(v->evas, v->selection.obj_l3);
evas_show(v->evas, v->selection.obj_l4);
}
else
{
evas_hide(v->evas, v->selection.obj_rect);
evas_hide(v->evas, v->selection.obj_l1);
evas_hide(v->evas, v->selection.obj_l2);
evas_hide(v->evas, v->selection.obj_l3);
evas_hide(v->evas, v->selection.obj_l4);
}
}
void