Enlightenment CVS committal Author : chaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: Makefile.am action_simple.c distribution_thumbnailer.c etk_list_viewer.c etk_meta_plugin.c etk_structure_viewer.c filesystem.c layout_etk_simple.c metadata_extract.c mime.c remote_thumbnailer.c thumbnail_system.c thumbnailer.c Log Message: * Begin migration to more rigid plugin structure, and do away with the dlopen/dlsym nastiness everywhere =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/Makefile.am,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- Makefile.am 28 Mar 2006 10:31:15 -0000 1.26 +++ Makefile.am 2 Apr 2006 05:47:38 -0000 1.27 @@ -11,10 +11,15 @@ 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 -EWL_LIST_L = ewl_list.la -STRUCTURE_VIEWER_L = structure_viewer.la +#LAYOUT_L = layout_ewl_simple.la +#EWL_LOCAL_ICON_L = ewl_local_icon.la +#EWL_LIST_L = ewl_list.la +#STRUCTURE_VIEWER_L = structure_viewer.la +LAYOUT_L = +EWL_LOCAL_ICON_L = +EWL_LIST_L = +STRUCTURE_VIEWER_L = + SYSTEM_THUMBNAILER_L = system_thumbnailer.la ACTION_SIMPLE_L = action_simple.la =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/action_simple.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- action_simple.c 28 Mar 2006 10:31:15 -0000 1.12 +++ action_simple.c 2 Apr 2006 05:47:38 -0000 1.13 @@ -178,9 +178,19 @@ } +entropy_plugin* +entropy_plugin_init(entropy_core* core) +{ + Entropy_Plugin_Gui* plugin; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Gui)); + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core) +entropy_plugin_gui_instance_new (entropy_core * core) { int config; =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/distribution_thumbnailer.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- distribution_thumbnailer.c 21 Feb 2006 11:40:16 -0000 1.4 +++ distribution_thumbnailer.c 2 Apr 2006 05:47:38 -0000 1.5 @@ -31,8 +31,18 @@ return types; } +entropy_plugin* +entropy_plugin_init(entropy_core* core) +{ + Entropy_Plugin_Thumbnailer_Distribution* plugin; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Thumbnailer_Distribution)); + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core) +entropy_plugin_gui_instance_new (entropy_core * core) { entropy_gui_component_instance *instance = =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/etk_list_viewer.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- etk_list_viewer.c 1 Apr 2006 07:41:29 -0000 1.53 +++ etk_list_viewer.c 2 Apr 2006 05:47:38 -0000 1.54 @@ -820,9 +820,21 @@ } +Entropy_Plugin* +entropy_plugin_init (entropy_core * core) +{ + Entropy_Plugin_Gui* plugin; + Entropy_Plugin* base; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Gui)); + base = ENTROPY_PLUGIN(plugin); + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core, +entropy_plugin_gui_instance_new (entropy_core * core, entropy_gui_component_instance * layout, void *data) { entropy_gui_component_instance *instance; =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/etk_meta_plugin.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- etk_meta_plugin.c 28 Mar 2006 10:33:25 -0000 1.1 +++ etk_meta_plugin.c 2 Apr 2006 05:47:38 -0000 1.2 @@ -135,8 +135,20 @@ } +entropy_plugin* +entropy_plugin_init(entropy_core* core) +{ + Entropy_Plugin_Gui* plugin; + + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Gui)); + + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core, +entropy_plugin_gui_instance_new (entropy_core * core, entropy_gui_component_instance * layout, void* parent_visual, void *data) { Etk_Tree_Col* col; =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/etk_structure_viewer.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- etk_structure_viewer.c 1 Apr 2006 04:35:36 -0000 1.22 +++ etk_structure_viewer.c 2 Apr 2006 05:47:38 -0000 1.23 @@ -273,9 +273,21 @@ } +Entropy_Plugin* +entropy_plugin_init (entropy_core * core) +{ + Entropy_Plugin_Gui* plugin; + Entropy_Plugin* base; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Gui)); + base = ENTROPY_PLUGIN(plugin); + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core, +entropy_plugin_gui_instance_new (entropy_core * core, entropy_gui_component_instance * layout, void* parent_visual, void *data) { entropy_gui_component_instance *instance; =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/filesystem.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -3 -r1.58 -r1.59 --- filesystem.c 28 Mar 2006 10:31:15 -0000 1.58 +++ filesystem.c 2 Apr 2006 05:47:38 -0000 1.59 @@ -21,6 +21,19 @@ Ecore_Hash *evfs_dir_requests; entropy_core *filesystem_core; /*A reference to the core */ +Ecore_List *structurelist_get (char *base); +struct stat *filestat_get (entropy_file_request * request); +Ecore_List *filelist_get (entropy_file_request * request); +void entropy_filesystem_file_copy (entropy_generic_file * file, char *path_to, entropy_gui_component_instance * instance); + +void entropy_filesystem_file_rename (entropy_generic_file * file_from, entropy_generic_file * file_to); +void entropy_filesystem_operation_respond(long id, int response); +void entropy_filesystem_directory_create (entropy_generic_file * parent, char* child_name); +void entropy_filesystem_file_remove (entropy_generic_file * file, entropy_gui_component_instance* instance); + + + + //TODO: In its current implementation - stats can only be tracked by one instance at a time. // I.e. if a request is made for a file by one instance, and another instance requests a stat on that file, @@ -500,18 +513,47 @@ return ENTROPY_PLUGIN_BACKEND_FILE; } -void +Entropy_Plugin* entropy_plugin_init (entropy_core * core) { + Entropy_Plugin_File* plugin; + Entropy_Plugin* base; + + /*Initialise misc. hashes*/ folder_monitor_hash = ecore_hash_new (ecore_direct_hash, ecore_direct_compare); stat_request_hash = ecore_hash_new (ecore_str_hash, ecore_str_compare); evfs_dir_requests = ecore_hash_new (ecore_str_hash, ecore_str_compare); file_copy_hash = ecore_hash_new (ecore_str_hash, ecore_str_compare); + /*Connect to evfs*/ con = evfs_connect (&callback, NULL); + /*Save a core reference to avoid lookups*/ filesystem_core = core; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_File)); + base = ENTROPY_PLUGIN(plugin); + + plugin->file_functions.structurelist_get = &structurelist_get; + plugin->file_functions.filestat_get = &filestat_get; + plugin->file_functions.filelist_get = &filelist_get; + plugin->file_functions.file_copy = &entropy_filesystem_file_copy; + + plugin->file_functions.file_rename = &entropy_filesystem_file_rename; + plugin->file_functions.operation_respond = &entropy_filesystem_operation_respond; + plugin->file_functions.directory_create = &entropy_filesystem_directory_create; + plugin->file_functions.file_remove = &entropy_filesystem_file_remove; + + + + + + + + return plugin; + + } void =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/layout_etk_simple.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- layout_etk_simple.c 1 Apr 2006 04:35:36 -0000 1.33 +++ layout_etk_simple.c 2 Apr 2006 05:47:38 -0000 1.34 @@ -47,6 +47,11 @@ } Etk_Menu_Item_Type; void layout_etk_simple_add_header(entropy_gui_component_instance* instance, Entropy_Config_Structure* structure); +void entropy_plugin_layout_main (); +char* entropy_plugin_toolkit_get(); +entropy_gui_component_instance* entropy_plugin_layout_create (entropy_core * core); + + void layout_etk_simple_quit(entropy_core* core) @@ -155,11 +160,24 @@ return menu_item; } -void +Entropy_Plugin* entropy_plugin_init (entropy_core * core) { + Entropy_Plugin_Gui* plugin; + Entropy_Plugin* base; + /*Init etk */ etk_init (); + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Gui)); + base = ENTROPY_PLUGIN(plugin); + + base->functions.entropy_plugin_init = &entropy_plugin_init; + plugin->gui_functions.layout_main = &entropy_plugin_layout_main; + plugin->gui_functions.layout_create = &entropy_plugin_layout_create; + plugin->gui_functions.toolkit_get= &entropy_plugin_toolkit_get; + + return plugin; } char * @@ -271,7 +289,7 @@ structure = entropy_plugins_type_get_first(ENTROPY_PLUGIN_GUI_COMPONENT,ENTROPY_PLUGIN_GUI_COMPONENT_STRUCTURE_VIEW); structure_plugin_init = - dlsym (structure->dl_ref, "entropy_plugin_init"); + dlsym (structure->dl_ref, "entropy_plugin_gui_instance_new"); /*We shouldn't really assume it's a folder - but it bootstraps us for * now- FIXME*/ @@ -455,7 +473,7 @@ local = entropy_plugins_type_get_first(ENTROPY_PLUGIN_GUI_COMPONENT,ENTROPY_PLUGIN_GUI_COMPONENT_LOCAL_VIEW); if (local) { local_plugin_init = - dlsym (local->dl_ref, "entropy_plugin_init"); + dlsym (local->dl_ref, "entropy_plugin_gui_instance_new"); instance = (*local_plugin_init)(core, layout,NULL); instance->plugin = local; } @@ -465,7 +483,7 @@ meta = entropy_plugins_type_get_first(ENTROPY_PLUGIN_GUI_COMPONENT, ENTROPY_PLUGIN_GUI_COMPONENT_INFO_PROVIDER); if (meta) { metadata_plugin_init = - dlsym(meta->dl_ref, "entropy_plugin_init"); + dlsym(meta->dl_ref, "entropy_plugin_gui_instance_new"); meta_instance = (*metadata_plugin_init)(core,layout,layout->gui_object,NULL); meta_instance->plugin = meta; } =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/metadata_extract.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- metadata_extract.c 28 Mar 2006 10:33:25 -0000 1.1 +++ metadata_extract.c 2 Apr 2006 05:47:38 -0000 1.2 @@ -71,8 +71,20 @@ } -entropy_gui_component_instance * +Entropy_Plugin* entropy_plugin_init (entropy_core * core) +{ + Entropy_Plugin_Gui* plugin; + Entropy_Plugin* base; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Gui)); + base = ENTROPY_PLUGIN(plugin); + + return plugin; +} + +entropy_gui_component_instance * +entropy_plugin_gui_instance_new (entropy_core * core) { int config; =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/mime.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- mime.c 31 Jan 2006 07:17:48 -0000 1.9 +++ mime.c 2 Apr 2006 05:47:38 -0000 1.10 @@ -19,10 +19,13 @@ return ENTROPY_MIME_PLUGIN_PRIORITY_HIGH; } -void +Entropy_Plugin* entropy_plugin_init (entropy_core * core) { + Entropy_Plugin_Mime* plugin; + mime_hash = ecore_hash_new (ecore_str_hash, ecore_str_compare); + ecore_hash_set (mime_hash, ".png", "image/png"); ecore_hash_set (mime_hash, ".jpg", "image/jpeg"); @@ -51,7 +54,9 @@ ecore_hash_set (mime_hash, ".txt", "text/plain"); ecore_hash_set (mime_hash, ".mov", "video/quicktime"); + plugin = entropy_malloc(sizeof(Entropy_Plugin_Mime)); + return plugin; } char * =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/remote_thumbnailer.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- remote_thumbnailer.c 28 Mar 2006 10:31:15 -0000 1.11 +++ remote_thumbnailer.c 2 Apr 2006 05:47:38 -0000 1.12 @@ -77,8 +77,18 @@ } +entropy_plugin* +entropy_plugin_init(entropy_core* core) +{ + Entropy_Plugin_Thumbnailer_Child* plugin; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Thumbnailer_Child)); + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core) +entropy_plugin_gui_instance_new (entropy_core * core) { entropy_gui_component_instance *instance = =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/thumbnail_system.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- thumbnail_system.c 31 Jan 2006 07:17:48 -0000 1.8 +++ thumbnail_system.c 2 Apr 2006 05:47:38 -0000 1.9 @@ -114,20 +114,25 @@ strcpy (thumb->thumbnail_filename, PACKAGE_DATA_DIR "/icons/video.png"); } - - - - - thumb->parent = request->file; request->file->thumbnail = thumb; return thumb; } +entropy_plugin* +entropy_plugin_init(entropy_core* core) +{ + Entropy_Plugin_Thumbnailer_Child* plugin; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Thumbnailer_Child)); + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core) +entropy_plugin_gui_instance_new (entropy_core * core) { entropy_gui_component_instance *instance = =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/thumbnailer.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- thumbnailer.c 28 Mar 2006 10:31:15 -0000 1.5 +++ thumbnailer.c 2 Apr 2006 05:47:38 -0000 1.6 @@ -81,9 +81,19 @@ return 0; } +entropy_plugin* +entropy_plugin_init(entropy_core* core) +{ + Entropy_Plugin_Thumbnailer_Child* plugin; + + plugin = entropy_malloc(sizeof(Entropy_Plugin_Thumbnailer_Child)); + + return plugin; +} + entropy_gui_component_instance * -entropy_plugin_init (entropy_core * core) +entropy_plugin_gui_instance_new (entropy_core * core) { entropy_gui_component_instance *instance = ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs