Enlightenment CVS committal Author : jlzapata Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_fileman_icon.c e_fileman_mime.c e_fileman_mime.h Log Message: efm: - thumbnails are back in, still a few mime types to be added. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_icon.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- e_fileman_icon.c 14 Feb 2006 19:39:39 -0000 1.30 +++ e_fileman_icon.c 17 Feb 2006 13:36:31 -0000 1.31 @@ -143,8 +143,7 @@ file->icon_object = obj; /* FIXME fix this */ -#if 0 - if (e_fm_file_can_preview(sd->file)) + if (sd->file->mime->thumbnail) { sd->thumb_path = e_thumb_file_get(sd->file->path); if (e_thumb_exists(sd->file->path)) @@ -174,7 +173,7 @@ } else { - sd->thumb_object = e_thumb_generate_begin(sd->file->path, sd->iw, + sd->thumb_object = sd->file->mime->thumbnail(sd->file->path, sd->iw, sd->ih, sd->evas, &sd->thumb_object, _e_fm_icon_thumb_generate_cb, @@ -184,7 +183,6 @@ } } else -#endif { _e_fm_icon_icon_mime_get(sd); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_mime.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_fileman_mime.c 16 Feb 2006 17:06:37 -0000 1.6 +++ e_fileman_mime.c 17 Feb 2006 13:36:31 -0000 1.7 @@ -66,7 +66,14 @@ * %h => hover file (might be the current directory, other file, whatever) * * - * + * FUTURE + * ====== + * a new approach can be made, but is too expensive for what e17 currently needs. + * the mime subsystem can be in fact independent from e_fileman_smart (the function calls + * are very simple to change, just pass always an Evas_List of files, and the E_Fm_File hover, + * instead of the E_Fileman_Smart). What is complicated is how to pass the data to the internal + * actions, and if we should define the internal actions here or in the component that will + * use the mime subsytem. * */ @@ -82,6 +89,8 @@ static void _e_fm_mime_action_internal_folder_open_other(E_Fm_Smart_Data *data); static void _e_fm_mime_action_internal_copy_to(E_Fm_Smart_Data *data); static void _e_fm_mime_action_internal_move_to(E_Fm_Smart_Data *data); +/* definitions of thumbnail functions */ +Evas_Object * _e_fm_mime_thumbnail_evas(char *path, Evas_Coord w, Evas_Coord h, Evas *evas, Evas_Object **tmp, void (*cb)(Evas_Object *obj, void *data), void *data); static int init_count = 0; @@ -198,6 +207,7 @@ entry->parent = l2; entry->level = 3; entry->suffix = strdup("jpg"); + entry->thumbnail = &_e_fm_mime_thumbnail_evas; entries = evas_list_append(entries,entry); /* png */ @@ -207,6 +217,7 @@ entry->parent = l2; entry->level = 3; entry->suffix = strdup("png"); + entry->thumbnail = &_e_fm_mime_thumbnail_evas; entries = evas_list_append(entries,entry); } @@ -322,7 +333,7 @@ continue; if(!strcmp(suffix,entry->suffix)) { - printf("found by suffix %s\n", suffix); + //printf("found by suffix %s\n", suffix); file->mime = entry; } free(suffix); @@ -625,3 +636,16 @@ printf("going to move to %s\n", sd->operation.hover->path); } +/* thumbnail functions */ +/***********************/ +Evas_Object * _e_fm_mime_thumbnail_evas(char *path, Evas_Coord w, Evas_Coord h, Evas *evas, Evas_Object **tmp, void (*cb)(Evas_Object *obj, void *data), void *data) +{ + Evas_Object *r; + + r = e_thumb_generate_begin(path, w, + h, evas, tmp, cb, + data); + + return r; +} + =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_mime.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- e_fileman_mime.h 16 Feb 2006 17:06:37 -0000 1.5 +++ e_fileman_mime.h 17 Feb 2006 13:36:31 -0000 1.6 @@ -6,7 +6,6 @@ typedef struct _E_Fm_Mime_Entry E_Fm_Mime_Entry; typedef struct _E_Fm_Mime_Action E_Fm_Mime_Action; -typedef int (*E_Fm_Mime_Thumbnail_Function) (E_Fm_File*); typedef int (*E_Fm_Mime_Preview_Function) (E_Fm_File*); #if 0 @@ -36,9 +35,9 @@ char *suffix; int type; /* to thumbnail this file type */ - E_Fm_Mime_Thumbnail_Function preview; + Evas_Object * (*thumbnail) (char *path, Evas_Coord w, Evas_Coord h, Evas *evas, Evas_Object **tmp, void (*cb)(Evas_Object *obj, void *data), void *data); /* to preview this file type */ - E_Fm_Mime_Preview_Function thumbnail; + E_Fm_Mime_Preview_Function preview; }; ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs