Enlightenment CVS committal Author : chaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: layout_ewl_simple.c structure_viewer.c Log Message: * Make ewl layout structure viewer work with LinuxTitan's design =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/layout_ewl_simple.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -3 -r1.58 -r1.59 --- layout_ewl_simple.c 13 Aug 2006 01:20:45 -0000 1.58 +++ layout_ewl_simple.c 13 Aug 2006 01:58:18 -0000 1.59 @@ -148,6 +148,13 @@ layout_ewl_simple_quit(instance->core); } +void +gui_event_callback (entropy_notify_event * eevent, void *requestor, + void *el, entropy_gui_component_instance * comp) +{ + printf("STUB: layout_ewl_simple gui_event_callback\n"); +} + entropy_gui_component_instance * entropy_plugin_layout_create (entropy_core * core) { @@ -168,8 +175,16 @@ void *parent_visual, void *data); + + entropy_gui_component_instance *(*structure_plugin_instance_new) + (entropy_core *core, + entropy_gui_component_instance *, + void *parent_visual, + void *data); + entropy_plugin *meta; entropy_plugin *trackback; + entropy_plugin *structure_p; entropy_gui_component_instance *meta_instance; Ewl_Widget *tree; @@ -285,6 +300,24 @@ gui->trackback->plugin = trackback; gui->trackback->active=1; } + + /*Add an example row to the tree*/ + structure_p = entropy_plugin_gui_get_by_name_toolkit(ENTROPY_TOOLKIT_EWL, "structureviewer"); + if (structure_p) { + Entropy_Generic_File* file = entropy_generic_file_new(); + snprintf(file->uri_base,sizeof(file->uri_base),"file"); + snprintf(file->filename,sizeof(file->filename),"/"); + file->filetype = FILE_FOLDER; + strcpy(file->mime_type, "file/folder"); + + + printf("Found structure plugin"); + structure_plugin_instance_new = dlsym(structure_p->dl_ref, "entropy_plugin_gui_instance_new"); + instance = (*structure_plugin_instance_new)(core, layout, gui->tree, file); + instance->plugin = structure_p; + + } + ewl_widget_show(win); ewl_widget_show(vbox); =================================================================== RCS file: /cvs/e/e17/proto/entropy/src/plugins/structure_viewer.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- structure_viewer.c 2 Apr 2006 12:14:42 -0000 1.38 +++ structure_viewer.c 13 Aug 2006 01:58:18 -0000 1.39 @@ -26,6 +26,7 @@ Ecore_Hash *row_folder_hash; Ewl_Widget *last_selected_label; + Ewl_Widget* parent_visual; }; typedef struct event_file_core event_file_core; @@ -36,7 +37,7 @@ void *data; }; -void structure_viewer_add_row (entropy_gui_component_instance * instance, +Ewl_Widget* structure_viewer_add_row (entropy_gui_component_instance * instance, entropy_generic_file * file, Ewl_Row * prow); int @@ -54,7 +55,7 @@ char * entropy_plugin_identify () { - return (char *) "File system tree structure viewer"; + return (char *) "structureviewer"; } char* @@ -280,7 +281,7 @@ viewer->last_selected_label = event->data; } -void +Ewl_Widget* structure_viewer_add_row (entropy_gui_component_instance * instance, entropy_generic_file * file, Ewl_Row * prow) { @@ -293,7 +294,6 @@ entropy_file_structure_viewer *viewer = (entropy_file_structure_viewer *) instance->data; - printf("Setting structure viewer with '%s'...\n", file->filename); ewl_text_text_set (EWL_TEXT (label), file->filename); image = ewl_image_new (); @@ -316,7 +316,7 @@ children[1] = NULL; /*printf("Adding row %s to existing row\n", file->filename); */ - row = ewl_tree_row_add (EWL_TREE (viewer->tree), prow, children); + row = ewl_tree_row_add (EWL_TREE (viewer->parent_visual), prow, children); ewl_object_fill_policy_set (EWL_OBJECT (row), EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL); @@ -349,6 +349,7 @@ /*printf ("Adding row to hash %p, file %p\n", row, file); */ ecore_hash_set (viewer->row_folder_hash, file, row); + return row; } @@ -383,6 +384,7 @@ entropy_gui_component_instance *instance; entropy_file_structure_viewer *viewer; Ewl_Widget *child; + Ewl_Widget* row; /*entropy_file_request* file_request = entropy_malloc(sizeof(entropy_file_request)); */ @@ -390,6 +392,7 @@ instance = entropy_gui_component_instance_new (); viewer = entropy_malloc (sizeof (entropy_file_structure_viewer)); instance->data = viewer; + viewer->parent_visual = parent_visual; instance->layout_parent = layout; @@ -411,22 +414,18 @@ viewer->ecore = core; instance->core = core; - viewer->tree = ewl_tree_new (1); - ewl_tree_headers_visible_set (EWL_TREE (viewer->tree), 0); viewer->loaded_dirs = ecore_hash_new (ecore_direct_hash, ecore_direct_compare); viewer->row_folder_hash = ecore_hash_new (ecore_direct_hash, ecore_direct_compare); - ewl_object_fill_policy_set (EWL_OBJECT - (EWL_TREE (viewer->tree)->scrollarea), - EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_VFILL); - - instance->gui_object = viewer->tree; + viewer->tree = parent_visual; + row = structure_viewer_add_row (instance, (entropy_generic_file *) data, NULL); + instance->gui_object = row; + - structure_viewer_add_row (instance, (entropy_generic_file *) data, NULL); - ewl_widget_show (viewer->tree); + ewl_widget_show (row); return instance; } ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs