Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_embed.c ewl_tree2.c Log Message: More branch support code for tree2. Additional checks on focus change in the embed. Framework for button tutorial. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.105 retrieving revision 1.106 diff -u -3 -r1.105 -r1.106 --- ewl_embed.c 4 Jan 2007 05:09:47 -0000 1.105 +++ ewl_embed.c 5 Jan 2007 21:07:49 -0000 1.106 @@ -1513,7 +1513,7 @@ DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE); DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); - if (embed->last.focused) + if (embed->last.focused && embed->last.focused != w) ewl_callback_call(embed->last.focused, EWL_CALLBACK_FOCUS_OUT); embed->last.focused = w; =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- ewl_tree2.c 4 Jan 2007 05:09:48 -0000 1.42 +++ ewl_tree2.c 5 Jan 2007 21:07:49 -0000 1.43 @@ -4,6 +4,17 @@ #include "ewl_debug.h" #include "ewl_macros.h" +typedef struct Ewl_Tree2_Branch_Cache Ewl_Tree2_Branch_Cache; +struct Ewl_Tree2_Branch_Cache +{ + int relative_row; + int row_count; + int absolute_row; + void *data; + Ewl_Tree2_Branch_Cache *parent; + Ecore_DList *branches; +}; + static void ewl_tree2_cb_view_change(Ewl_MVC *mvc); static void ewl_tree2_build_tree(Ewl_Tree2 *tree); static void ewl_tree2_cb_column_free(void *data); @@ -581,8 +592,9 @@ ewl_tree2_build_tree(Ewl_Tree2 *tree) { Ewl_Tree2_Column *col; - int column = 0, rows = 0, i; + int column = 0, rows = 0, i, subi; void *mvc_data; + Ewl_Tree2_Branch_Cache *curbranch, *head; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("tree", tree); @@ -603,8 +615,12 @@ column ++; } + head = curbranch = NEW(Ewl_Tree2_Branch_Cache, 1); + head->row_count = rows; + ewl_container_reset(EWL_CONTAINER(tree->rows)); - for (i = 0; i < rows; i++) + i = subi = 0; + while (curbranch) { Ewl_Widget *row; Ewl_Widget *p; @@ -625,8 +641,12 @@ col = ecore_list_goto_first(tree->columns); if (col && col->model->expandable && - col->model->expandable(mvc_data, i)) + col->model->expandable(mvc_data, i)) { + curbranch = NEW(Ewl_Tree2_Branch_Cache, 1); + curbranch->parent = head; + printf("Expandable row %d found\n", i); + } column = 0; while((col = ecore_list_next(tree->columns))) @@ -636,6 +656,17 @@ } ewl_container_child_append(EWL_CONTAINER(p), row); + i++; + + /* + * Finished the rows at this level? Jump back up a level. + */ + if (subi > curbranch->row_count) { + curbranch = curbranch->parent; + if (curbranch) + subi = curbranch->relative_row; + } + subi++; } DLEAVE_FUNCTION(DLEVEL_STABLE); ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs