Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_tree2.c ewl_tree2.h Log Message: Add a dirty flag to the tree2 to indicate when data has changed. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_tree2.c 13 Mar 2006 22:26:08 -0000 1.11 +++ ewl_tree2.c 12 Apr 2006 06:43:33 -0000 1.12 @@ -1,7 +1,7 @@ +#include "ewl_private.h" #include <Ewl.h> #include "ewl_debug.h" #include "ewl_macros.h" -#include "ewl_private.h" static void ewl_tree2_cb_column_free(void *data); @@ -79,6 +79,8 @@ ewl_widget_focusable_set(EWL_WIDGET(tree), FALSE); + tree->dirty = TRUE; + DRETURN_INT(TRUE, DLEVEL_STABLE); } @@ -97,6 +99,8 @@ tree->data = data; + tree->dirty = TRUE; + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -145,6 +149,8 @@ ecore_list_append(tree->columns, c); + tree->dirty = TRUE; + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -178,6 +184,8 @@ ecore_list_prepend(tree->columns, c); + tree->dirty = TRUE; + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -214,6 +222,8 @@ ecore_list_goto_index(tree->columns, idx); ecore_list_insert(tree->columns, c); + tree->dirty = TRUE; + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -237,6 +247,8 @@ ewl_tree2_column_destroy(c); + tree->dirty = TRUE; + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -260,6 +272,8 @@ else ewl_widget_show(tree->header); + tree->dirty = TRUE; + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -376,6 +390,8 @@ tree->fixed = fixed; + tree->dirty = TRUE; + DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -416,7 +432,7 @@ { Ewl_Tree2 *tree; Ewl_Tree2_Column *col; - int column = 0, dirty = FALSE; + int column = 0; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -424,41 +440,45 @@ tree = EWL_TREE2(w); +#if 0 ecore_list_goto_first(tree->columns); while ((col = ecore_list_next(tree->columns))) { -#if 0 if (ewl_model_dirty_get(col->model)) { dirty = TRUE; break; } -#endif } +#endif /* place the header */ ewl_object_place(EWL_OBJECT(tree->header), CURRENT_X(tree), CURRENT_Y(tree), CURRENT_W(tree), CURRENT_H(tree)); - ewl_widget_configure(tree->header); +// ewl_widget_configure(tree->header); /* if none of the models are dirty we are done */ - if (!dirty) DRETURN(DLEVEL_STABLE); + if (!tree->dirty) DRETURN(DLEVEL_STABLE); /* setup the headers */ ewl_container_reset(EWL_CONTAINER(tree->header)); - ecore_list_goto_first(tree->columns); + printf("First column pointer: %p\n", ecore_list_goto_first(tree->columns)); while ((col = ecore_list_next(tree->columns))) { Ewl_Widget *h; h = col->view->header_fetch(tree->data, column); + printf("Column: "); + ewl_widget_print(h); ewl_container_child_append(EWL_CONTAINER(tree->header), h); /* once we are done this model won't be dirty anymore */ // col->model->dirty = FALSE; column ++; } + + tree->dirty = FALSE; DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_tree2.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ewl_tree2.h 15 Mar 2006 04:03:48 -0000 1.19 +++ ewl_tree2.h 12 Apr 2006 06:43:33 -0000 1.20 @@ -79,7 +79,7 @@ struct Ewl_Tree2_Column { Ewl_Model *model; /**< The model for the column */ - Ewl_View *view; /**< The view for the column */ + Ewl_View *view; /**< The view for the column */ }; /** @@ -108,8 +108,9 @@ Ecore_List *selected; /**< The list of selected cells */ Ewl_Tree_Mode mode; /**< The mode of the tree */ - unsigned int fixed:1; /**< Rows are fixed height */ + unsigned int fixed:1; /**< Rows are fixed height */ unsigned int headers_visible:1; /**< Are the headers visible? */ + unsigned int dirty:1; /**< Has the data changed? */ }; /* ------------------------------------------------------- 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