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 filesystem.c layout_etk_simple.c layout_ewl_simple.c structure_viewer.c Added Files: etk_list_viewer.c etk_structure_viewer.c Log Message: Lotsa changes (tm): * Layout engine selector. EWL layout engine is currently the default. Can be selected with 'entropy --layout=(ewl|etk)' * ETK structure viewer/ETK list viewer. Currently needs a bit of work, but it functions. Ability to add/remove locations coming soon. * Core settings engine, and command line parser =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/Makefile.am,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- Makefile.am 10 Feb 2006 04:32:50 -0000 1.18 +++ Makefile.am 20 Feb 2006 06:48:36 -0000 1.19 @@ -18,13 +18,17 @@ SYSTEM_THUMBNAILER_L = system_thumbnailer.la ACTION_SIMPLE_L = action_simple.la -#if 0 -#LAYOUT_ETK_L = layout_etk_simple.la -#else +if HAVE_ETK +LAYOUT_ETK_L = layout_etk_simple.la +ETK_STRUCTURE_VIEWER_L = etk_structure_viewer.la +ETK_LIST_VIEWER_L = etk_list.la +else LAYOUT_ETK_L = -#endif +ETK_LIST_VIEWER_L = +ETK_STRUCTURE_VIEWER_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) $(REMOTE_THUMBNAILER_L) $(DISTRIB_THUMBNAILER_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) $(ETK_STRUCTURE_VIEWER_L) $(ETK_LIST_VIEWER_L) ewl_local_icon_la_SOURCES = $(top_srcdir)/src/entropy_gui.c \ $(top_srcdir)/src/dialogs/ewl_progress_dialog.c \ @@ -68,11 +72,25 @@ layout_ewl_simple_la_LDFLAGS = -module -avoid-version layout_ewl_simple_la_LIBADD = @EWL_LIBS@ -#layout_etk_simple_la_SOURCES = layout_etk_simple.c $(top_srcdir)/src/entropy_debug.c -#layout_etk_simple_la_CFLAGS = @ETK_CFLAGS@ -#layout_etk_simple_la_LDFLAGS = -module -avoid-version -#layout_etk_simple_la_LIBADD = @ETK_LIBS@ +if HAVE_ETK +layout_etk_simple_la_SOURCES = layout_etk_simple.c $(top_srcdir)/src/entropy_debug.c +layout_etk_simple_la_CFLAGS = @ETK_CFLAGS@ +layout_etk_simple_la_LDFLAGS = -module -avoid-version +layout_etk_simple_la_LIBADD = @ETK_LIBS@ + +etk_structure_viewer_la_SOURCES = $(top_srcdir)/src/entropy_gui.c \ + etk_structure_viewer.c $(top_srcdir)/src/entropy_debug.c +etk_structure_viewer_la_CFLAGS = @ETK_CFLAGS@ +etk_structure_viewer_la_LDFLAGS = -module -avoid-version +etk_structure_viewer_la_LIBADD = @ETK_LIBS@ + +etk_list_la_SOURCES = etk_list_viewer.c $(top_srcdir)/src/entropy_gui.c \ + $(top_srcdir)/src/entropy_debug.c +etk_list_la_CFLAGS = @ETK_CFLAGS@ +etk_list_la_LDFLAGS = -module -avoid-version +etk_list_la_LIBADD = @ETK_LIBS@ +endif mime_la_SOURCES = mime.c $(top_srcdir)/src/entropy_core.c mime_la_CFLAGS = @EVFS_CFLAGS@ =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_icon_local_viewer.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -3 -r1.56 -r1.57 --- ewl_icon_local_viewer.c 1 Feb 2006 12:07:55 -0000 1.56 +++ ewl_icon_local_viewer.c 20 Feb 2006 06:48:36 -0000 1.57 @@ -109,6 +109,12 @@ return (char *) "Icon View"; } +char* +entropy_plugin_toolkit_get() +{ + return ENTROPY_TOOLKIT_EWL; +} + void entropy_file_wait_list_add (entropy_icon_viewer * viewer, Ecore_List * list) =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/ewl_list_viewer.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_list_viewer.c 2 Feb 2006 03:10:31 -0000 1.9 +++ ewl_list_viewer.c 20 Feb 2006 06:48:36 -0000 1.10 @@ -61,6 +61,12 @@ char current_dir[1024]; /* We should handle this at the core. FUTURE API TODO */ }; +char* +entropy_plugin_toolkit_get() +{ + return ENTROPY_TOOLKIT_EWL; +} + void entropy_file_wait_list_add (entropy_icon_viewer * viewer, Ecore_List * list) =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/filesystem.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -3 -r1.41 -r1.42 --- filesystem.c 5 Feb 2006 11:49:50 -0000 1.41 +++ filesystem.c 20 Feb 2006 06:48:36 -0000 1.42 @@ -248,7 +248,7 @@ printf("Looking for calling request with folder '%s'\n", folder); calling_request = ecore_hash_get (evfs_dir_requests, folder); - //printf("Received a file from the hash, path is '%s'\n", calling_request->file->path); + printf("Received a file from the hash, path is '%s'\n", calling_request->file->path); /*Append the original request as the first item in the list */ /*It's not nice having to do this, but we're kind of stuck. Should be ok as long =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_etk_simple.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- layout_etk_simple.c 31 Jan 2006 07:17:48 -0000 1.2 +++ layout_etk_simple.c 20 Feb 2006 06:48:36 -0000 1.3 @@ -1,5 +1,6 @@ #include <Etk.h> #include "entropy.h" +#include "entropy_gui.h" #include <dlfcn.h> #include <Ecore.h> #include <stdlib.h> @@ -14,6 +15,7 @@ entropy_gui_component_instance *iconbox_viewer; entropy_gui_component_instance *structure_viewer; Etk_Widget *tree; + Etk_Widget *paned; }; static Etk_Bool @@ -55,8 +57,7 @@ /*Now attach an object to it */ structure = - entropy_plugins_type_get_first (instance->core->plugin_list, - ENTROPY_PLUGIN_GUI_COMPONENT, + entropy_plugins_type_get_first ( ENTROPY_PLUGIN_GUI_COMPONENT, ENTROPY_PLUGIN_GUI_COMPONENT_STRUCTURE_VIEW); /*if (structure) { @@ -107,10 +108,6 @@ printf ("Name/uri is %s %s\n", name, uri); - layout_ewl_simple_add_header (instance, name, uri); - - - /*Cut the obj up by semicolon; */ } @@ -135,8 +132,6 @@ printf ("Name/uri is %s %s\n", name, uri); - layout_ewl_simple_add_header (instance, name, uri); - free (object); } ecore_list_destroy (objects); @@ -161,7 +156,7 @@ char * entropy_plugin_identify () { - return (char *) "Simple ETK layout container"; + return (char *) "etk"; } int @@ -170,9 +165,17 @@ return ENTROPY_PLUGIN_GUI_LAYOUT; } +char* +entropy_plugin_toolkit_get() +{ + return ENTROPY_TOOLKIT_ETK; +} + void entropy_plugin_layout_main () { + + printf("Init ETK main...\n"); etk_main (); } @@ -182,14 +185,27 @@ Etk_Widget *window; entropy_layout_gui *gui; entropy_gui_component_instance *layout; + entropy_gui_component_instance* instance; + Etk_Widget* test; + void *(*entropy_plugin_init) (entropy_core * core, entropy_gui_component_instance *); void *(*structure_plugin_init) (entropy_core * core, entropy_gui_component_instance *, + void* parent_visual, void *data); + + void *(*local_plugin_init) (entropy_core * core, + entropy_gui_component_instance *, + void *data); + entropy_plugin *plugin; entropy_plugin *structure; + entropy_plugin *local; + entropy_generic_file* file; + Etk_Tree_Col* col; + Etk_Tree_Row* row; /*Entropy related init */ @@ -198,15 +214,82 @@ layout->data = gui; layout->core = core; + /*Register this layout container with the core, so our children can get events */ + entropy_core_layout_register (core, layout); /*Etk related init */ window = etk_window_new (); - gui->tree = etk_tree_new (); - etk_container_add (ETK_CONTAINER (window), gui->tree); + gui->paned = etk_hpaned_new(); + etk_container_add(ETK_CONTAINER(window), gui->paned); + etk_signal_connect ("delete_event", ETK_OBJECT (window), ETK_CALLBACK (_etk_window_deleted_cb), core); + etk_widget_size_request_set(ETK_WIDGET(window), 800,600); + + /*Tree init*/ + gui->tree = etk_tree_new(); + etk_paned_add1(ETK_PANED(gui->paned), gui->tree, ETK_TRUE); + etk_tree_mode_set(ETK_TREE(gui->tree), ETK_TREE_MODE_TREE); + col = etk_tree_col_new(ETK_TREE(gui->tree), _("Folders"), + etk_tree_model_icon_text_new(ETK_TREE(gui->tree), ETK_TREE_FROM_EDJE), 60); + + etk_tree_col_expand_set(col, ETK_TRUE); + etk_tree_build(ETK_TREE(gui->tree)); + + /*Add test row */ + etk_tree_freeze(ETK_TREE(gui->tree)); + row = etk_tree_append(ETK_TREE(gui->tree), col, + etk_theme_icon_theme_get(), "places/start-here_16", _("Home Directory"), NULL); + etk_tree_thaw(ETK_TREE(gui->tree)); + + + 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"); + + file = entropy_generic_file_new(); + strcpy(file->path, "/home"); + strcpy(file->filename, "chaos"); + strcpy(file->uri_base, "posix"); + strcpy(file->mime_type, "file/folder"); + + + instance = (*structure_plugin_init)(core, layout, row,file); + instance->plugin = structure; + /*-----------------------*/ + + /*Add test row */ + etk_tree_freeze(ETK_TREE(gui->tree)); + row = etk_tree_append(ETK_TREE(gui->tree), col, + etk_theme_icon_theme_get(), "places/start-here_16", _("Filesystem Root"), NULL); + etk_tree_thaw(ETK_TREE(gui->tree)); + + + 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"); + + file = entropy_generic_file_new(); + strcpy(file->path, "/"); + strcpy(file->filename, "/"); + strcpy(file->uri_base, "posix"); + strcpy(file->mime_type, "file/folder"); + + instance = (*structure_plugin_init)(core, layout, row,file); + instance->plugin = structure; + /*-----------------------*/ + + local = entropy_plugins_type_get_first(ENTROPY_PLUGIN_GUI_COMPONENT,ENTROPY_PLUGIN_GUI_COMPONENT_LOCAL_VIEW); + local_plugin_init = + dlsym (local->dl_ref, "entropy_plugin_init"); + instance = (*local_plugin_init)(core, layout,file); + instance->plugin = local; + + etk_paned_add2(ETK_PANED(gui->paned), instance->gui_object, ETK_TRUE); + + etk_widget_show_all (window); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_ewl_simple.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- layout_ewl_simple.c 5 Feb 2006 11:49:50 -0000 1.42 +++ layout_ewl_simple.c 20 Feb 2006 06:48:36 -0000 1.43 @@ -101,9 +101,14 @@ char * entropy_plugin_identify () { - return (char *) "Simple EWL layout container"; + return (char *) "ewl"; } +char* +entropy_plugin_toolkit_get() +{ + return ENTROPY_TOOLKIT_EWL; +} void ewl_layout_simple_tooltip_show_cb (Ewl_Widget * item, void *ev_data, @@ -530,7 +535,8 @@ entropy_ewl_layout_header_uri *header = calloc (1, sizeof (entropy_ewl_layout_header_uri)); void *(*structure_plugin_init) (entropy_core * core, - entropy_gui_component_instance *, + entropy_gui_component_instance *, + void* parent_visual, void *data); entropy_layout_gui *gui = ((entropy_layout_gui *) instance->data); Ewl_Widget *tree = gui->tree; @@ -571,7 +577,7 @@ structure_plugin_init = dlsym (structure->dl_ref, "entropy_plugin_init"); gui->structure_viewer = - (*structure_plugin_init) (instance->core, instance, file); + (*structure_plugin_init) (instance->core, instance, tree, file); gui->structure_viewer->plugin = structure; visual = EWL_WIDGET (gui->structure_viewer->gui_object); if (!visual) @@ -749,6 +755,11 @@ void entropy_plugin_destroy (entropy_gui_component_instance * comp) { + if (!comp) { + printf("*** No plugin to destroy at layout_ewl_simple.c\n"); + return; + } + entropy_layout_gui *gui = comp->data; Ecore_List *keys; void *key; =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/structure_viewer.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- structure_viewer.c 31 Jan 2006 07:17:48 -0000 1.33 +++ structure_viewer.c 20 Feb 2006 06:48:36 -0000 1.34 @@ -57,6 +57,12 @@ return (char *) "File system tree structure viewer"; } +char* +entropy_plugin_toolkit_get() +{ + return ENTROPY_TOOLKIT_EWL; +} + /*Ewl_Widget* entropy_plugin_gui_component_visual_get() { return itree; }*/ ------------------------------------------------------- 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