Am Donnerstag, den 05.01.2006, 00:39 +0200 schrieb Hisham Mardam Bey:
> On 1/4/06, mista <[EMAIL PROTECTED]> wrote:
> > >
> > ok, the other thing I realized is that a greater TILE_SIZE solves the
> > problem that,
> > if you scroll up with keys, the viewport sometimes get not updated and
> > the selected icon is then not more visible.
> >
>
> we will have to look into this in detail.
>
ok, but don´t forget
> >
> > -usability changes, like having dirs shown first,
> >
>
> can you turn this into an option or a sort mode?
>
sure.
> > renaming can be applied with enter and denied with escape,
> >
>
> good.
>
> > icon-menu has a submenu with eaps(and their respective icons) that can
> > open this filetype, this gets only generated once for each type, the
> > first time the menu shows up and is afterwards hashed.
> >
>
> good, we will have to integrate it into efm's mime system.
>
for now efm's mimesystem looks like a lot strcmp(strrchr()). can we add
an element
char *mime in E_Fm_File and a function to check if E_Fm_Assoc_App
matches with a file?
> for now, we do not want something that is efl-wide. we just want a
> part of efm's configs to map extentions to application names. once
> thats done and other bugs are ironed out, we can talk to Chaos and
> others and try to get something working across all of the EFL.
>
ok, i keep my idea for later
> > scroll with band-selection and remember selected files that are not more
> > visible. I had to change icon_canvas, so that icon_pack return the
> > coordinates where the icon is placed and let selections_rect_add work
> > with these coords.
> >
>
> good.
I can only do this if icon_pack returns something from which i can get
the coordinates where on the canvas th icon is located. Currently I let
it return just the coordinates.
>
> > dnd works for single files(to drop files into other apps I put an ugly
> > sleep(1) in e_drag_end).
> > I have the problem, that the e_dnd_cb_mouse_up still gets called after
> > the drop is done. Is this a known bug?
> >
>
> I am not sure about this, maybe Chaos can give in some input about
> this as he has also done XDND using ecore_x?
>
> > -logical grouping changes in key_down_cb and key_select_-functions,
> > which reduces the size and is much better to read, as I think. for
> > example in key_down_cb is one section for each state typebuf_shown,
> > _not_shown and renaming.
> > I attached a snippet of the key_select functions, as they solve the
> > problem of flickering selections if one is already at the end in that
> > direction.
> >
>
> good.
>
Sorry,the snippet was only matching to my version of e. Today i downloaded a
brand
new clean e source to work on.
>
> > - and some code convenience changes like wrapping the often used
> > ext = strrchr(file->name, '.');
> > if (!ext) return 0;
> > if (strcasecmp(ext, ".eap"))
> > return 0;
> > with: e_fm_file_has_mime(file,"eap")
> >
>
> good.
>
> > One extra functionality that is working is mime lookup via libmagic,
> > this is also comfortable for files without extension, but if one
> > extension is recognized it gets hashed - so you just need to add the
> > mimetypes manually if the type could not be found by libmagic or the
> > found one is not to your liking.
> s>
>
> this is nice, but does this require that E links against libmagic? I
> believe so, and hence we cant include it in Efm right now.
>
ok, i thought so.
> >
> > if this information can be used by other e-applications then this is for
> > sure a better solution.
>
> refer to my comment above about this subject.
>
> > Though my version allows easy reuse of mimetype definitions
> > in .desktop-files, as e17genmenu can be tweaked with little effort to
> > put this information in the eap.
> > What about reading the information once from the eap to store them in
> > the eet-config?
> >
> Can you elaborate please?
>
>
I thought it would be good to have the mimetypes stored in the eap,
because every application that shows/uses this eap has directly access
to the mime information. That would make it for example possible that
ibar or engage know when a file is dropped on an eap if the file can be
opened with it. If an Application like efm creates a new mime to
application assignment and stores them in an eaps, then this
information can be reused by other apps very simple.
As far as I know e17genmenu should become the standard app to create
eap-sets. The data it uses to create eaps comes from desktop-files,
which include often a list of mimetypes. My point, is that we should use
that list and not write every mimetype for every app by hand.
For now i changed my own ugly eap generator to store this list in the
comments field of the eap. when efm starts it go through the global eap
list and generates a list to lookup an application by mimetype. then,
when an icon-menu gets opened it goes through the list to lookup
suitable applications, which then get shown in a submenu.
is this what you asked for?
> All the items marked with "good" seem worthy of inclusion with-in Efm.
> Could you port them to work with-in Efm and generate a patch for
> review?
>
I don´t know how to make patches against a cvs-tree. Can you give me a list of
commands you are using?
Have you rules for identation?
When I apply my local patch the identation looks completly messed up. Should I
then
make two patches, one to delete the old part and a second to fill in the new?
the attached patch are the corrected key select functions,
more to follow when i know how its done right (my diff dont allow the -3
option???)
regards,
jeff
p.s. we should use a different mail subject this is mostly off topic
--- e_fileman_smart.c-old 2006-01-05 23:13:26.000000000 +0000
+++ e_fileman_smart.c 2006-01-05 23:15:00.000000000 +0000
@@ -2640,300 +2640,6 @@
}
}
-static void
-_e_fm_icon_select_up(E_Fm_Smart_Data *sd)
-{
- Evas_List *l;
-
- if(sd->selection.current.ptr)
- {
- E_Fm_Icon *icon;
- Evas_Coord x, y, x2, y2;
-
- l = sd->selection.current.ptr;
- icon = l->data;
- evas_object_geometry_get(icon->icon_obj, &x, &y, NULL, NULL);
- x2 = x + 1;
- l = l->prev;
- while(l && x != x2)
- {
- icon = l->data;
- evas_object_geometry_get(icon->icon_obj, &x2, &y2, NULL, NULL);
- if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- {
- if(icon->state.selected)
- {
- _e_fm_selections_del(l->data);
- _e_fm_selections_current_set(l->data, l);
- }
- else
- _e_fm_selections_add(l->data, l);
- }
- l = l->prev;
- }
- if(l && !evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- {
- if(l->next) l = l->next;
- if(!l) return;
- _e_fm_selections_clear(sd);
- _e_fm_selections_add(l->data, l);
- }
- else if(!l)
- {
- if(!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- _e_fm_selections_clear(sd);
- _e_fm_selections_add(sd->files->data, sd->files);
- }
- if(l)
- {
- E_Fm_Icon *icon;
- Evas_Coord x, y, w, h;
- icon = l->data;
- evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
- if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
- {
- E_Event_Fm_Reconfigure *ev;
-
- ev = E_NEW(E_Event_Fm_Reconfigure, 1);
- if (ev)
- {
- ev->object = sd->object;
- ev->x = sd->x;
- ev->y = sd->child.y - (sd->y - (y -
sd->icon_info.y_space));
- ev->w = sd->w;
- ev->h = sd->h;
- ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
- }
- }
- }
- }
- else
- _e_fm_selections_add(sd->files->data, sd->files);
-}
-
-static void
-_e_fm_icon_select_down(E_Fm_Smart_Data *sd)
-{
- Evas_List *l;
-
- if(sd->selection.current.ptr)
- {
- E_Fm_Icon *icon;
- Evas_Coord x, y, x2, y2;
-
- l = sd->selection.current.ptr;
- icon = l->data;
- evas_object_geometry_get(icon->icon_obj, &x, &y, NULL, NULL);
- x2 = x + 1;
- l = l->next;
- while(l && x != x2)
- {
- icon = l->data;
- evas_object_geometry_get(icon->icon_obj, &x2, &y2, NULL, NULL);
- if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- {
- if(icon->state.selected)
- {
- _e_fm_selections_del(l->data);
- _e_fm_selections_current_set(l->data, l);
- }
- else
- _e_fm_selections_add(l->data, l);
- }
- l = l->next;
- }
- if(l && !evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- {
- if(l->prev) l = l->prev;
- if(!l) return;
- _e_fm_selections_clear(sd);
- _e_fm_selections_add(l->data, l);
- }
- else if(!l)
- {
- if(!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- _e_fm_selections_clear(sd);
- _e_fm_selections_add((evas_list_last(sd->files))->data,
evas_list_last(sd->files));
- }
- if(l)
- {
- E_Fm_Icon *icon;
- Evas_Coord x, y, w, h;
-
- icon = l->data;
- evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
- if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
- {
- E_Event_Fm_Reconfigure *ev;
- ev = E_NEW(E_Event_Fm_Reconfigure, 1);
- if (ev)
- {
- ev->object = sd->object;
- ev->x = sd->x;
- ev->y = sd->child.y + y + h + sd->icon_info.y_space -
(sd->y + sd->h);
- ev->w = sd->w;
- ev->h = sd->h;
- ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL, NULL);
- }
- }
- }
- }
- else
- _e_fm_selections_add(sd->files->data, sd->files);
-}
-
-static void
-_e_fm_icon_select_left(E_Fm_Smart_Data *sd)
-{
- Evas_List *prev;
-
- if(sd->selection.current.ptr)
- {
- if(sd->selection.current.ptr->prev)
- {
- prev = sd->selection.current.ptr->prev;
- if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- {
- E_Fm_Icon *icon;
-
- icon = prev->data;
- if(icon->state.selected)
- {
- _e_fm_selections_del(prev->data);
- _e_fm_selections_current_set(prev->data, prev);
- }
- else
- _e_fm_selections_add(prev->data, prev);
- }
- else
- {
- _e_fm_selections_clear(sd);
- _e_fm_selections_add(prev->data, prev);
- }
- {
- E_Fm_Icon *icon;
- Evas_Coord x, y, w, h;
- icon = prev->data;
- evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
- if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
- {
- E_Event_Fm_Reconfigure *ev;
-
- ev = E_NEW(E_Event_Fm_Reconfigure, 1);
- if (ev)
- {
- ev->object = sd->object;
- ev->x = sd->x;
- ev->y = sd->child.y - (sd->y - (y -
sd->icon_info.y_space));
- ev->w = sd->w;
- ev->h = sd->h;
- ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL,
NULL);
- }
- }
- }
- }
- }
- else
- _e_fm_selections_add(sd->files->data, sd->files);
-}
-
-static void
-_e_fm_icon_select_right(E_Fm_Smart_Data *sd)
-{
- Evas_List *next;
-
- if (sd->selection.current.ptr)
- {
- if (sd->selection.current.ptr->next)
- {
- next = sd->selection.current.ptr->next;
- if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
- {
- E_Fm_Icon *icon;
-
- icon = next->data;
- if (icon->state.selected)
- {
- _e_fm_selections_del(next->data);
- _e_fm_selections_current_set(next->data, next);
- }
- else
- _e_fm_selections_add(next->data, next);
- }
- else
- {
- _e_fm_selections_clear(sd);
- _e_fm_selections_add(next->data, next);
- }
- {
- E_Fm_Icon *icon;
- Evas_Coord x, y, w, h;
- icon = next->data;
- evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
- if (!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
- {
- E_Event_Fm_Reconfigure *ev;
-
- ev = E_NEW(E_Event_Fm_Reconfigure, 1);
- if (ev)
- {
- ev->object = sd->object;
- ev->x = sd->x;
- ev->y = sd->child.y + y + h + sd->icon_info.y_space
- (sd->y + sd->h);
- ev->w = sd->w;
- ev->h = sd->h;
- ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL,
NULL);
- }
- }
- }
- }
- }
- else
- _e_fm_selections_add(sd->files->data, sd->files);
-}
-
-static void
-_e_fm_icon_run(E_Fm_Smart_Data *sd)
-{
- E_Fm_Icon *icon;
-
- if (sd->selection.current.ptr)
- {
- icon = sd->selection.current.file;
- if (icon->file->type == E_FM_FILE_TYPE_DIRECTORY)
- {
- char *fullname;
-
- if (!strcmp(icon->file->name, ".."))
- {
- fullname = _e_fm_dir_pop(icon->sd->dir);
- }
- else
- {
- fullname = strdup(icon->file->path);
- }
- if (fullname)
- {
- if (icon->sd->win)
- e_win_title_set(icon->sd->win, fullname);
- _e_fm_dir_set(icon->sd, fullname);
- free(fullname);
- }
- }
- else if (icon->file->type == E_FM_FILE_TYPE_FILE)
- {
- if (icon->sd->is_selector)
- {
- _e_fm_selector_send_file(icon);
- return;
- }
-
- if ((!e_fm_file_assoc_exec(icon->file)) &&
- (e_fm_file_can_exec(icon->file)))
- e_fm_file_exec(icon->file);
- }
- }
-}
static void
_e_fm_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
--- e_fileman_smart.c-old2 2006-01-05 23:15:00.000000000 +0000
+++ e_fileman_smart.c 2006-01-05 17:14:22.000000000 +0000
@@ -2641,6 +2641,296 @@
}
+
+
+
+
+static void
+_e_fm_icon_select_up(E_Fm_Smart_Data *sd)
+{
+ Evas_List *l;
+ E_Fm_Icon *icon;
+
+ if(!sd->selection.current.ptr)
+ _e_fm_selections_add(sd->files->data, sd->files);
+ else
+ {
+ if(sd->selection.current.ptr->prev) /* are we already at the beginning?
*/
+ {
+ Evas_Coord x, x2, y, w, h;
+
+ l = sd->selection.current.ptr;
+ icon = l->data;
+ evas_object_geometry_get(icon->icon_obj, &x, NULL,
NULL, NULL);
+ x2 = x + 1;
+
+ if
(!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control"))
+ {
+ while(l->prev && (x != x2))
+ {
+ l = l->prev;
+ icon = l->data;
+ evas_object_geometry_get(icon->icon_obj, &x2, NULL,
NULL, NULL);
+
+ }
+ _e_fm_selections_clear(sd);
+ _e_fm_selections_add(l->data, l);
+
+ }
+ else /* Control modifier set */
+ {
+ while(l->prev && (x != x2))
+ {
+ l = l->prev;
+ icon = l->data;
+ evas_object_geometry_get(icon->icon_obj, &x2, NULL,
NULL, NULL);
+
+ if(icon->state.selected)
+ {
+ _e_fm_selections_del(l->data);
+ _e_fm_selections_current_set(l->data, l);
+ }
+ else
+ _e_fm_selections_add(l->data, l);
+ }
+ }
+ evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
+ if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
+ {
+ E_Event_Fm_Reconfigure *ev;
+
+ ev = E_NEW(E_Event_Fm_Reconfigure, 1);
+ if (ev)
+ {
+ ev->object = sd->object;
+ ev->x = sd->x;
+ ev->y = sd->child.y - (sd->y - (y -
sd->icon_info.y_space));
+ ev->w = sd->w;
+ ev->h = sd->h;
+ ecore_event_add(E_EVENT_FM_RECONFIGURE, ev,
NULL, NULL);
+ }
+ }
+ }
+ }
+}
+
+
+static void
+_e_fm_icon_select_down(E_Fm_Smart_Data *sd)
+{
+ Evas_List *l;
+
+ if(!sd->selection.current.ptr)
+ _e_fm_selections_add(sd->files->data, sd->files);
+ else
+ {
+ if(sd->selection.current.ptr->next) /* are we already at the end? */
+ {
+
+ E_Fm_Icon *icon;
+ Evas_Coord x, x2, y, w, h;;
+
+ l = sd->selection.current.ptr;
+ icon = l->data;
+ evas_object_geometry_get(icon->icon_obj, &x, NULL,
NULL, NULL);
+ x2 = x + 1;
+
+ if
(!evas_key_modifier_is_set(evas_key_modifier_get(sd->evas), "Control"))
+ {
+ while(l->next && (x != x2))
+ {
+ l = l->next;
+ icon = l->data;
+ evas_object_geometry_get(icon->icon_obj, &x2, NULL,
NULL, NULL);
+ }
+ _e_fm_selections_clear(sd);
+ _e_fm_selections_add(l->data, l);
+ }
+ else /* Control modifier set */
+ {
+ while(l->next && (x != x2))
+ {
+ l = l->next;
+ icon = l->data;
+ evas_object_geometry_get(icon->icon_obj, &x2, NULL,
NULL, NULL);
+
+ if(icon->state.selected)
+ {
+ _e_fm_selections_del(l->data);
+ _e_fm_selections_current_set(l->data, l);
+ }
+ else
+ _e_fm_selections_add(l->data, l);
+ }
+ }
+ evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
+ if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
+ {
+ E_Event_Fm_Reconfigure *ev;
+
+ ev = E_NEW(E_Event_Fm_Reconfigure, 1);
+ if (ev)
+ {
+ ev->object = sd->object;
+ ev->x = sd->x;
+ ev->y = sd->child.y - (sd->y - (y -
sd->icon_info.y_space));
+ ev->w = sd->w;
+ ev->h = sd->h;
+ ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL,
NULL);
+ }
+ }
+ }
+ }
+}
+
+static void
+_e_fm_icon_select_left(E_Fm_Smart_Data *sd)
+{
+ if(!sd->selection.current.ptr)
+ _e_fm_selections_add(sd->files->data, sd->files);
+ else
+ {
+ if(sd->selection.current.ptr->prev)
+ {
+ Evas_List *prev;
+ E_Fm_Icon *icon;
+ Evas_Coord x, y, w, h;
+
+ prev = sd->selection.current.ptr->prev;
+ icon = prev->data;
+
+ if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
+ {
+ if(icon->state.selected)
+ {
+ _e_fm_selections_del(prev->data);
+ _e_fm_selections_current_set(prev->data, prev);
+ }
+ else
+ _e_fm_selections_add(prev->data, prev);
+ }
+ else
+ {
+ _e_fm_selections_clear(sd);
+ _e_fm_selections_add(prev->data, prev);
+ }
+
+ evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
+ if(!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
+ {
+ E_Event_Fm_Reconfigure *ev;
+ ev = E_NEW(E_Event_Fm_Reconfigure, 1);
+ if (ev)
+ {
+ ev->object = sd->object;
+ ev->x = sd->x;
+ ev->y = sd->child.y - (sd->y - (y -
sd->icon_info.y_space));
+ ev->w = sd->w;
+ ev->h = sd->h;
+ ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL,
NULL);
+ }
+ }
+ }
+ }
+}
+
+static void
+_e_fm_icon_select_right(E_Fm_Smart_Data *sd)
+{
+ if(!sd->selection.current.ptr)
+ _e_fm_selections_add(sd->files->data, sd->files);
+ else
+ {
+ if (sd->selection.current.ptr->next)
+ {
+ Evas_List *next;
+ E_Fm_Icon *icon;
+ Evas_Coord x, y, w, h;
+
+ next = sd->selection.current.ptr->next;
+ icon = next->data;
+
+ if (evas_key_modifier_is_set(evas_key_modifier_get(sd->evas),
"Control"))
+ {
+ if (icon->state.selected)
+ {
+ _e_fm_selections_del(next->data);
+ _e_fm_selections_current_set(next->data, next);
+ }
+ else
+ _e_fm_selections_add(next->data, next);
+ }
+ else
+ {
+ _e_fm_selections_clear(sd);
+ _e_fm_selections_add(next->data, next);
+ }
+
+ evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
+ if (!E_CONTAINS(sd->x, sd->y, sd->w, sd->h, x, y, w, h))
+ {
+ E_Event_Fm_Reconfigure *ev;
+
+ ev = E_NEW(E_Event_Fm_Reconfigure, 1);
+ if (ev)
+ {
+ ev->object = sd->object;
+ ev->x = sd->x;
+ ev->y = sd->child.y + y + h + sd->icon_info.y_space
- (sd->y + sd->h);
+ ev->w = sd->w;
+ ev->h = sd->h;
+ ecore_event_add(E_EVENT_FM_RECONFIGURE, ev, NULL,
NULL);
+ }
+ }
+ }
+ }
+}
+
+
+
+static void
+_e_fm_icon_run(E_Fm_Smart_Data *sd)
+{
+ E_Fm_Icon *icon;
+
+ if (sd->selection.current.ptr)
+ {
+ icon = sd->selection.current.file;
+ if (icon->file->type == E_FM_FILE_TYPE_DIRECTORY)
+ {
+ char *fullname;
+
+ if (!strcmp(icon->file->name, ".."))
+ {
+ fullname = _e_fm_dir_pop(icon->sd->dir);
+ }
+ else
+ {
+ fullname = strdup(icon->file->path);
+ }
+ if (fullname)
+ {
+ if (icon->sd->win)
+ e_win_title_set(icon->sd->win, fullname);
+ _e_fm_dir_set(icon->sd, fullname);
+ free(fullname);
+ }
+ }
+ else if (icon->file->type == E_FM_FILE_TYPE_FILE)
+ {
+ if (icon->sd->is_selector)
+ {
+ _e_fm_selector_send_file(icon);
+ return;
+ }
+
+ if ((!e_fm_file_assoc_exec(icon->file)) &&
+ (e_fm_file_can_exec(icon->file)))
+ e_fm_file_exec(icon->file);
+ }
+ }
+}
+
static void
_e_fm_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{