Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: Makefile.am ewl_icon_local_viewer.c ewl_list_viewer.c ewl_progress_dialog.c filesystem.c thumbnail_system.c thumbnailer.c Added Files: distribution_thumbnailer.c remote_thumbnailer.c Log Message: * Big reorginisation. Thumbnailers now have tasks distributed to them by distribution_thumbnailers. This was to enable multiple thumbnailers to take a stab at an image. Therefore, we now have a demonstration: Entropy can now, with the aid of evfs, thumbnail images on evfs-devices (at the moment, this is only useful with samba). Ftp,tar, etc will follow soon. =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- Makefile.am 30 Dec 2005 00:43:20 -0000 1.12 +++ Makefile.am 2 Jan 2006 09:05:42 -0000 1.13 @@ -8,6 +8,8 @@ MIME_L = mime.la THUMBNAILER_L = imlib_thumbnailer.la +REMOTE_THUMBNAILER_L = remote_thumbnailer.la +DISTRIB_THUMBNAILER_L = distrib_thumbnailer.la POSIX_L = posix.la LAYOUT_L = layout_ewl_simple.la EWL_LOCAL_ICON_L = ewl_local_icon.la @@ -22,7 +24,7 @@ LAYOUT_ETK_L = #endif -pkg_LTLIBRARIES = $(MIME_L) $(THUMBNAILER_L) $(POSIX_L) $(LAYOUT_L) $(EWL_LOCAL_ICON_L) $(STRUCTURE_VIEWER_L) $(SYSTEM_THUMBNAILER_L) $(ACTION_SIMPLE_L) $(LAYOUT_ETK_L) $(EWL_LIST_L) +pkg_LTLIBRARIES = $(MIME_L) $(THUMBNAILER_L) $(POSIX_L) $(LAYOUT_L) $(EWL_LOCAL_ICON_L) $(STRUCTURE_VIEWER_L) $(SYSTEM_THUMBNAILER_L) $(ACTION_SIMPLE_L) $(LAYOUT_ETK_L) $(EWL_LIST_L) $(REMOTE_THUMBNAILER_L) $(DISTRIB_THUMBNAILER_L) ewl_local_icon_la_SOURCES = $(top_srcdir)/src/entropy_gui.c \ ewl_progress_dialog.c \ @@ -74,6 +76,17 @@ imlib_thumbnailer_la_LDFLAGS = -module -avoid-version imlib_thumbnailer_la_LIBADD = @IMLIB2_LIBS@ @ECORE_LIBS@ @PNG_LIBS@ @EPSILON_LIBS@ +remote_thumbnailer_la_SOURCES = remote_thumbnailer.c thumbnail_generic.c md5.c $(top_srcdir)/src/entropy_debug.c +remote_thumbnailer_la_CFLAGS = @ECORE_CFLAGS@ @IMLIB2_CFLAGS@ @EPSILON_CFLAGS@ +remote_thumbnailer_la_LDFLAGS = -module -avoid-version +remote_thumbnailer_la_LIBADD = @IMLIB2_LIBS@ @ECORE_LIBS@ @PNG_LIBS@ @EPSILON_LIBS@ + +distrib_thumbnailer_la_SOURCES = distribution_thumbnailer.c thumbnail_generic.c md5.c $(top_srcdir)/src/entropy_debug.c +distrib_thumbnailer_la_CFLAGS = @ECORE_CFLAGS@ @IMLIB2_CFLAGS@ @EPSILON_CFLAGS@ +distrib_thumbnailer_la_LDFLAGS = -module -avoid-version +distrib_thumbnailer_la_LIBADD = @IMLIB2_LIBS@ @ECORE_LIBS@ @PNG_LIBS@ @EPSILON_LIBS@ + + system_thumbnailer_la_SOURCES = thumbnail_system.c thumbnail_generic.c $(top_srcdir)/src/entropy_debug.c system_thumbnailer_la_CFLAGS = @ECORE_CFLAGS@ @IMLIB2_CFLAGS@ @EPSILON_CFLAGS@ system_thumbnailer_la_LDFLAGS = -module -avoid-version =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_icon_local_viewer.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- ewl_icon_local_viewer.c 30 Dec 2005 06:47:31 -0000 1.44 +++ ewl_icon_local_viewer.c 2 Jan 2006 09:05:42 -0000 1.45 @@ -562,6 +562,9 @@ /*We want to know about file transfer progress events*/ entropy_core_component_event_register(instance, entropy_core_gui_event_get(ENTROPY_GUI_EVENT_FILE_PROGRESS)); + /*We want to know about thumbnail available events*/ + entropy_core_component_event_register(instance, entropy_core_gui_event_get(ENTROPY_GUI_EVENT_THUMBNAIL_AVAILABLE)); + ewl_iconbox_controlled_key_callback_register(viewer->iconbox, ewl_icon_local_viewer_key_event_cb, instance); @@ -621,17 +624,22 @@ if (mime && strcmp(mime, ENTROPY_NULL_MIME)) { - thumb = entropy_thumbnailer_retrieve(comp->core->entropy_thumbnailers, mime); + thumb = entropy_thumbnailer_retrieve(mime); } else { thumb = NULL; } if (thumb) { + entropy_thumbnail_request* request = entropy_thumbnail_request_new(); + request->file = list_item; + request->instance = comp; + entropy_notify_event* ev = entropy_notify_request_register( comp->core->notify, comp, ENTROPY_NOTIFY_THUMBNAIL_REQUEST,thumb, - "entropy_thumbnailer_thumbnail_get", list_item,NULL); + "entropy_thumbnailer_thumbnail_get", request,NULL); entropy_notify_event_callback_add(ev, (void*)gui_event_callback, comp); + entropy_notify_event_cleanup_add(ev, request); entropy_notify_event_commit(comp->core->notify, ev); } @@ -684,18 +692,23 @@ if (mime && strcmp(mime, ENTROPY_NULL_MIME)) { - thumb = entropy_thumbnailer_retrieve(comp->core->entropy_thumbnailers, mime); + thumb = entropy_thumbnailer_retrieve(mime); } else { thumb = NULL; } if (thumb) { + entropy_thumbnail_request* request = entropy_thumbnail_request_new(); + request->file = file; + request->instance = comp; + entropy_notify_event* ev = entropy_notify_request_register( comp->core->notify, proc, ENTROPY_NOTIFY_THUMBNAIL_REQUEST,thumb, - "entropy_thumbnailer_thumbnail_get", file,NULL); + "entropy_thumbnailer_thumbnail_get", request,NULL); entropy_notify_event_callback_add(ev, (void*)gui_event_callback, proc->requestor); - + entropy_notify_event_cleanup_add(ev, request); + ecore_list_append(events, ev); } @@ -835,7 +848,7 @@ /*FIXME This is inefficient as all hell - find a better way to do this*/ //ewl_iconbox_icon_arrange(EWL_ICONBOX(view->iconbox)); } else { - printf("ERR: Couldn't find a hash reference for this file!\n"); + //printf("ERR: Couldn't find a hash reference for this file!\n"); } } } //End case =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_list_viewer.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_list_viewer.c 1 Jan 2006 02:03:34 -0000 1.5 +++ ewl_list_viewer.c 2 Jan 2006 09:05:42 -0000 1.6 @@ -452,7 +452,7 @@ if ( (gui_object = ecore_hash_get(view->gui_hash, list_item)) ) { //FIXME - ewl_tree_row_destroy(view->list, EWL_ROW(gui_object->icon)); + ewl_tree_row_destroy(EWL_TREE(view->list), EWL_ROW(gui_object->icon)); } } @@ -546,17 +546,23 @@ if (mime && strcmp(mime, ENTROPY_NULL_MIME)) { - thumb = entropy_thumbnailer_retrieve(comp->core->entropy_thumbnailers, mime); + thumb = entropy_thumbnailer_retrieve(mime); } else { thumb = NULL; } if (thumb) { + entropy_thumbnail_request* request = entropy_thumbnail_request_new(); + request->file = list_item; + request->instance = comp; + entropy_notify_event* ev = entropy_notify_request_register( comp->core->notify, comp, ENTROPY_NOTIFY_THUMBNAIL_REQUEST,thumb, - "entropy_thumbnailer_thumbnail_get", list_item,NULL); + "entropy_thumbnailer_thumbnail_get", request,NULL); entropy_notify_event_callback_add(ev, (void*)gui_event_callback, comp); + entropy_notify_event_cleanup_add(ev, request); + entropy_notify_event_commit(comp->core->notify, ev); } @@ -609,17 +615,22 @@ if (mime && strcmp(mime, ENTROPY_NULL_MIME)) { - thumb = entropy_thumbnailer_retrieve(comp->core->entropy_thumbnailers, mime); + thumb = entropy_thumbnailer_retrieve(mime); } else { thumb = NULL; } if (thumb) { + entropy_thumbnail_request* request = entropy_thumbnail_request_new(); + request->file = file; + request->instance = comp; + entropy_notify_event* ev = entropy_notify_request_register( comp->core->notify, proc, ENTROPY_NOTIFY_THUMBNAIL_REQUEST,thumb, - "entropy_thumbnailer_thumbnail_get", file,NULL); + "entropy_thumbnailer_thumbnail_get", request,NULL); entropy_notify_event_callback_add(ev, (void*)gui_event_callback, proc->requestor); + entropy_notify_event_cleanup_add(ev, request); ecore_list_append(events, ev); } =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_progress_dialog.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_progress_dialog.c 11 Dec 2005 07:09:57 -0000 1.1 +++ ewl_progress_dialog.c 2 Jan 2006 09:05:42 -0000 1.2 @@ -24,6 +24,7 @@ progress->progressbar = ewl_progressbar_new(); ewl_container_child_append(EWL_CONTAINER(vbox), progress->progressbar); ewl_progressbar_range_set(EWL_PROGRESSBAR(progress->progressbar), 100); + ewl_object_custom_h_set(EWL_OBJECT(progress->progressbar), 30); ewl_widget_show(progress->progressbar); } =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/filesystem.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- filesystem.c 30 Dec 2005 06:47:31 -0000 1.30 +++ filesystem.c 2 Jan 2006 09:05:42 -0000 1.31 @@ -681,7 +681,7 @@ evfs_file_uri_path* uri_path_from; char* uri = entropy_core_generic_file_uri_create(file,0); - printf("Deleting uri '%s'\n", uri); + //printf("Deleting uri '%s'\n", uri); uri_path_from = evfs_parse_uri(uri); evfs_client_file_remove(con, uri_path_from->files[0]); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/thumbnail_system.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- thumbnail_system.c 29 Nov 2005 08:27:16 -0000 1.6 +++ thumbnail_system.c 2 Jan 2006 09:05:42 -0000 1.7 @@ -39,50 +39,50 @@ return types; } -entropy_thumbnail* entropy_thumbnailer_thumbnail_get(entropy_generic_file* file) { - if (file->thumbnail) { - return file->thumbnail; +entropy_thumbnail* entropy_thumbnailer_thumbnail_get(entropy_thumbnail_request* request) { + if (request->file->thumbnail) { + return request->file->thumbnail; } entropy_thumbnail* thumb = entropy_thumbnail_new(); - if (!strcmp(file->mime_type, "file/folder")) { + if (!strcmp(request->file->mime_type, "file/folder")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/folder.png"); - } else if (!strcmp(file->mime_type, "text/x-perl")) { + } else if (!strcmp(request->file->mime_type, "text/x-perl")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/perl.png"); - } else if (!strcmp(file->mime_type, "video/x-ms-wmv")) { + } else if (!strcmp(request->file->mime_type, "video/x-ms-wmv")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/wmv.png"); - } else if (!strcmp(file->mime_type, "application/msword")) { + } else if (!strcmp(request->file->mime_type, "application/msword")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/document.png"); - } else if (!strcmp(file->mime_type, "application/pdf")) { + } else if (!strcmp(request->file->mime_type, "application/pdf")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/pdf.png"); - } else if (!strcmp(file->mime_type, "application/vnd.ms-excel")) { + } else if (!strcmp(request->file->mime_type, "application/vnd.ms-excel")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/spreadsheet.png"); - } else if (!strcmp(file->mime_type, "application/x-gtar")) { + } else if (!strcmp(request->file->mime_type, "application/x-gtar")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/tgz.png"); - } else if (!strcmp(file->mime_type, "audio/x-mp3")) { + } else if (!strcmp(request->file->mime_type, "audio/x-mp3")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/mp3.png"); - } else if (!strcmp(file->mime_type, "text/x-java")) { + } else if (!strcmp(request->file->mime_type, "text/x-java")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/java.png"); - } else if (!strcmp(file->mime_type, "text/xml")) { + } else if (!strcmp(request->file->mime_type, "text/xml")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/xml.png"); - } else if (!strcmp(file->mime_type, "application/x-jar")) { + } else if (!strcmp(request->file->mime_type, "application/x-jar")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/jar.png"); - } else if (!strcmp(file->mime_type, "text/html")) { + } else if (!strcmp(request->file->mime_type, "text/html")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/html.png"); - } else if (!strcmp(file->mime_type, "text/csrc")) { + } else if (!strcmp(request->file->mime_type, "text/csrc")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/c.png"); - } else if (!strcmp(file->mime_type, "video/mpeg")) { + } else if (!strcmp(request->file->mime_type, "video/mpeg")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/mpeg.png"); - } else if (!strcmp(file->mime_type, "application/x-bzip2")) { + } else if (!strcmp(request->file->mime_type, "application/x-bzip2")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/bz2.png"); - } else if (!strcmp(file->mime_type, "application/x-tar")) { + } else if (!strcmp(request->file->mime_type, "application/x-tar")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/tar.png"); - } else if (!strcmp(file->mime_type, "text/plain")) { + } else if (!strcmp(request->file->mime_type, "text/plain")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/txt.png"); - } else if (!strcmp(file->mime_type, "video/x-msvideo")) { + } else if (!strcmp(request->file->mime_type, "video/x-msvideo")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/video.png"); - } else if (!strcmp(file->mime_type, "video/quicktime")) { + } else if (!strcmp(request->file->mime_type, "video/quicktime")) { strcpy(thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/video.png"); } @@ -91,10 +91,25 @@ - thumb->parent = file; - file->thumbnail = thumb; + thumb->parent = request->file; + request->file->thumbnail = thumb; return thumb; } +entropy_gui_component_instance* entropy_plugin_init(entropy_core* core) { + + entropy_gui_component_instance* instance = entropy_gui_component_instance_new(); + entropy_gui_component_instance* layout = entropy_core_global_layout_get(core); + instance->layout_parent = layout; + instance->core = core; + + return instance; +} + + +void gui_event_callback(entropy_notify_event* eevent, void* requestor, void* obj, entropy_gui_component_instance* comp) { +} + + =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/thumbnailer.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- thumbnailer.c 20 Oct 2005 08:45:54 -0000 1.1 +++ thumbnailer.c 2 Jan 2006 09:05:42 -0000 1.2 @@ -1,6 +1,7 @@ #include "entropy.h" static Ecore_List* types= NULL; +#define THUMBNAILER_LOCAL_PLUGIN "posix" int entropy_plugin_type_get() { return ENTROPY_PLUGIN_THUMBNAILER; @@ -23,20 +24,34 @@ return types; } -entropy_thumbnail* entropy_thumbnailer_thumbnail_get(entropy_generic_file* file) { +entropy_gui_component_instance* entropy_plugin_init(entropy_core* core) { + + entropy_gui_component_instance* instance = entropy_gui_component_instance_new(); + entropy_gui_component_instance* layout = entropy_core_global_layout_get(core); + instance->layout_parent = layout; + instance->core = core; + + return instance; +} + +entropy_thumbnail* entropy_thumbnailer_thumbnail_get(entropy_thumbnail_request* request) { entropy_thumbnail* thumb; - if (!file->thumbnail) { - thumb = entropy_thumbnail_create(file); + + /*This thumbnailer is only for local files*/ + if (strcmp(request->file->uri_base, "posix")) return NULL; + + if (!request->file->thumbnail) { + thumb = entropy_thumbnail_create(request->file); } else { - return file->thumbnail; + return request->file->thumbnail; } /*Set the file up for this thumbnail. TODO this probably violates convention to do this here, * but we create the thumbnail downstream, and from here, so there's not much choice.. */ if (thumb) { /*printf("Created thumbnail '%s'\n", thumb->thumbnail_filename);*/ - thumb->parent = file; - file->thumbnail = thumb; + thumb->parent = request->file; + request->file->thumbnail = thumb; } else { //printf ("Returned thumb was null, assuming error...\n"); return NULL; @@ -45,4 +60,7 @@ return thumb; } +void gui_event_callback(entropy_notify_event* eevent, void* requestor, void* obj, entropy_gui_component_instance* comp) { +} + ------------------------------------------------------- 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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs