Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_container.c ewl_grid.c ewl_grid.h ewl_misc.c ewl_notebook.c ewl_row.c ewl_seeker.c ewl_table.c ewl_table.h ewl_tree.c ewl_tree2.h ewl_widget.c Log Message: Grid and table fixes from Christopher Klug. Fix container iteration skipping of internal widgets. Use container iterator in row. Convert tree to use paned for headers. Remove theme insets and padding from widget on unrealize. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_container.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- ewl_container.c 30 Dec 2005 05:39:28 -0000 1.24 +++ ewl_container.c 30 Dec 2005 07:03:40 -0000 1.25 @@ -434,6 +434,7 @@ while (container->redirect) container = container->redirect; ecore_list_goto_first(container->children); + while ((child = ecore_list_next(container->children))) { if (ewl_widget_internal_is(child)) continue; if (count == index) break; @@ -722,7 +723,8 @@ w = c->iterator(c); } else { - w = ecore_list_next(c->children); + while ((w = ecore_list_next(c->children)) && + (ewl_widget_internal_is(w))); } DRETURN_PTR(w, DLEVEL_STABLE); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_grid.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_grid.c 2 Dec 2005 06:19:04 -0000 1.7 +++ ewl_grid.c 30 Dec 2005 07:03:40 -0000 1.8 @@ -81,6 +81,8 @@ g->rows = rows; g->rchildren = NULL; + g->homogeneous_h = FALSE; + g->homogeneous_v = FALSE; /* * Append callbacks @@ -140,12 +142,20 @@ g->grid_h = CURRENT_H(EWL_OBJECT(w)); /* initialize the column width to default values */ - for (i = 0; i < g->cols; i++) - g->col_size[i].size = CURRENT_W(g) / g->cols; + for (i = 0; i < g->cols; i++) { + if (g->homogeneous_h) + g->col_size[i].size = CURRENT_W(g) / g->cols; + else + g->col_size[i].size = 1; + } /* initialize the row height to default values */ - for (i = 0; i < g->rows; i++) - g->row_size[i].size = CURRENT_H(g) / g->rows; + for (i = 0; i < g->rows; i++) { + if (g->homogeneous_v) + g->row_size[i].size = CURRENT_H(g) / g->rows; + else + g->row_size[i].size = 1; + } ewl_widget_configure(w); @@ -153,6 +163,106 @@ } /** + * @param g: the grid to change homogeneous layout + * @param h: the boolean value to change the layout mode to + * @return Returns no value. + * @breif Change the homogeneous layout of the box + * + * Grids use non-homogeneous layout by default, this can be used + * to change that. + */ +void +ewl_grid_homogeneous_set(Ewl_Grid *g, unsigned int h) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("g", g); + DCHECK_TYPE("g", g, "grid"); + + if (g->homogeneous_h != h) + ewl_grid_hhomogeneous_set(g, h); + if (g->homogeneous_v != h) + ewl_grid_vhomogeneous_set(g, h); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param g: the grid to change horizontal homogeneous layout + * @param h: the boolean value to change the horizontal layout mode to + * @return Returns no value. + * @breif Change the horizontal homogeneous layout of the box + * + * Grids use non-homogeneous layout by default, this can be used + * to change that for horizontal orientation, i.e. all columns can + * have the same width. + */ +void +ewl_grid_hhomogeneous_set(Ewl_Grid *g, unsigned int h) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("g", g); + DCHECK_TYPE("g", g, "grid"); + + if (g->homogeneous_h != h) + g->homogeneous_h = h; + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param g: the grid to change vertical homogeneous layout + * @param h: the boolean value to change the vertical layout mode to + * @return Returns no value. + * @breif Change the vertical homogeneous layout of the box + * + * Grids use non-homogeneous layout by default, this can be used + * to change that for vertical orientation, i.e. all rows can have + * the same height. + */ +void +ewl_grid_vhomogeneous_set(Ewl_Grid *g, unsigned int h) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("g", g); + DCHECK_TYPE("g", g, "grid"); + + if (g->homogeneous_v != h) + g->homogeneous_v = h; + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param g: the grid to get the homogeneous layout + * @return The horizontal homogeneous flag + * @brief Retrieves the horizontal homogeneous flag + */ +unsigned int +ewl_grid_hhomogeneous_get(Ewl_Grid *g) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("g", g, 0); + DCHECK_TYPE_RET("g", g, "grid", 0); + + DRETURN_INT(g->homogeneous_h, DLEVEL_STABLE); +} + +/** + * @param g: the grid to get the vertical layout + * @return The vertical homogeneous flag + * @brief Retrieves the vertical homogeneous flag + */ +unsigned int +ewl_grid_vhomogeneous_get(Ewl_Grid *g) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("g", g, 0); + DCHECK_TYPE_RET("g", g, "grid", 0); + + DRETURN_INT(g->homogeneous_v, DLEVEL_STABLE); +} + +/** * ewl_grid_add - add a child widget to the grid * @param g: the grid * @param w: the child widget @@ -504,6 +614,8 @@ { int i; int temp; + int max_w = 0, max_h = 0; + int g_w = 0, g_h = 0; Ewl_Grid *g; Ewl_Grid_Child *cdata; @@ -532,64 +644,88 @@ /* * Add the widget to columns that it intersects. */ - for (i = cdata->start_col; i < cdata->end_col; i++) { - if (!g->col_size[i].cross) - g->col_size[i].cross = ecore_list_new(); + for (i = cdata->start_col; i <= cdata->end_col; i++) { + if (i < cdata->end_col) { + if (!g->col_size[i].cross) + g->col_size[i].cross = ecore_list_new(); - ecore_list_append(g->col_size[i].cross, c); + ecore_list_append(g->col_size[i].cross, c); + } /* - * Calculate the amount of space the widget would need in this - * column. - */ + * Calculate the amount of space the widget would + * need in this column. + */ temp = ewl_object_preferred_w_get(EWL_OBJECT(c)) / - (cdata->end_col - cdata->start_col + 1); + (cdata->end_col - cdata->start_col + 1); /* - * Give the column a new preferred size based on the added - * widget. + * Give the column a new preferred size based on + * the added widget. */ - if (g->col_size[i].size < temp) { - if (!g->col_size[i].override) - g->col_size[i].size = 0; + if (g->col_size[i-1].size < temp) { + if (!g->col_size[i-1].override) + g->col_size[i-1].size = temp; /* * Save a pointer to the largest child. */ - g->col_size[i].max = c; + g->col_size[i-1].max = c; } + max_w = MAX(max_w, temp) ; + max_w = MAX(max_w, g->col_size[i-1].size); } /* * Add the widget to rows that it intersects. */ - for (i = cdata->start_row; i < cdata->end_row; i++) { - if (!g->row_size[i].cross) - g->row_size[i].cross = ecore_list_new(); + for (i = cdata->start_row; i <= cdata->end_row; i++) { + if (i < cdata->end_row) { + if (!g->row_size[i].cross) + g->row_size[i].cross = ecore_list_new(); - ecore_list_append(g->row_size[i].cross, c); + ecore_list_append(g->row_size[i].cross, c); + } /* - * Calculate the amount of space the widget would need in this - * row. + * Calculate the amount of space the widget would + * need in this row. */ temp = ewl_object_preferred_h_get(EWL_OBJECT(c)) / - (cdata->end_row - cdata->start_row + 1); + (cdata->end_row - cdata->start_row + 1); /* - * Give the row a new preferred size based on the added - * widget. + * Give the row a new preferred size based on + * the added widget. */ - if (g->row_size[i].size < temp) { - if (!g->row_size[i].override) - g->row_size[i].size = 0; + if (g->row_size[i-1].size < temp) { + if (!g->row_size[i-1].override) + g->row_size[i-1].size = temp; /* * Save a pointer to the largest child. */ - g->row_size[i].max = c; + g->row_size[i-1].max = c; + } + max_h = MAX(max_h, temp) ; + max_h = MAX(max_h, g->row_size[i-1].size); + } + + for (i = 0; i < g->cols; i++) { + if (g->homogeneous_h) { + g->col_size[i].size = max_w; } + g_w += g->col_size[i].size; } + for (i = 0; i < g->rows; i++) { + if (g->homogeneous_v) { + g->row_size[i].size = max_h; + } + g_h += g->row_size[i].size; + } + g->grid_w = g_w; + g->grid_h = g_h; + ewl_object_preferred_inner_size_set(EWL_OBJECT(g), g_w, g_h); } /* @@ -699,5 +835,3 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } - - =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_grid.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_grid.h 24 Oct 2005 00:23:57 -0000 1.4 +++ ewl_grid.h 30 Dec 2005 07:03:40 -0000 1.5 @@ -40,6 +40,11 @@ int rows, cols; /* + * Flag indicating space assignment + */ + unsigned int homogeneous_h; /** Horizontal homogeneous flag */ + unsigned int homogeneous_v; /** Vertical homogeneous flag */ + /* * total size of the grid widget */ int grid_h; @@ -77,6 +82,12 @@ void ewl_grid_reset(Ewl_Grid *g, int rows, int cols); +void ewl_grid_homogeneous_set(Ewl_Grid *g, unsigned int h); +void ewl_grid_hhomogeneous_set(Ewl_Grid *g, unsigned int h); +void ewl_grid_vhomogeneous_set(Ewl_Grid *g, unsigned int h); +unsigned int ewl_grid_hhomogeneous_get(Ewl_Grid *g); +unsigned int ewl_grid_vhomogeneous_get(Ewl_Grid *g); + /* * Internally used callbacks, override at your own risk. */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_misc.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- ewl_misc.c 29 Dec 2005 17:45:01 -0000 1.36 +++ ewl_misc.c 30 Dec 2005 07:03:40 -0000 1.37 @@ -588,16 +588,17 @@ ewl_print_help(void) { printf("EWL Help\n" - "\t--ewl-backtrace Print a stack trace warnings occur.\n" - "\t--ewl-debug <level> Set the debugging printf level.\n" - "\t--ewl-fb Use framebuffer display engine.\n" - "\t--ewl-gl-x11 Use GL X11 display engine.\n" - "\t--ewl-help Print this help message.\n" - "\t--ewl-print-gc-reap Print garbage collection stats.\n" - "\t--ewl-print-theme-keys Print theme keys matched widgets.\n" - "\t--ewl-segv Trigger crash when warning printed.\n" - "\t--ewl-software-x11 Use software X11 display engine.\n" - "\t--ewl-theme <theme> Set the theme to use for widgets.\n" + "\t--ewl-backtrace Print a stack trace warnings occur.\n" + "\t--ewl-debug <level> Set the debugging printf level.\n" + "\t--ewl-fb Use framebuffer display engine.\n" + "\t--ewl-gl-x11 Use GL X11 display engine.\n" + "\t--ewl-help Print this help message.\n" + "\t--ewl-print-gc-reap Print garbage collection stats.\n" + "\t--ewl-print-theme-keys Print theme keys matched widgets.\n" + "\t--ewl-print-theme-signals Print theme keys matched widgets.\n" + "\t--ewl-segv Trigger crash when warning printed.\n" + "\t--ewl-software-x11 Use software X11 display engine.\n" + "\t--ewl-theme <theme> Set the theme to use for widgets.\n" ); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_notebook.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_notebook.c 6 Dec 2005 03:46:54 -0000 1.8 +++ ewl_notebook.c 30 Dec 2005 07:03:40 -0000 1.9 @@ -5,6 +5,8 @@ static int ewl_notebook_page_index_get(Ewl_Notebook *n, Ewl_Notebook_Page *p); +void ewl_notebook_child_show_cb(Ewl_Container *n, Ewl_Widget *c); +void ewl_notebook_child_hide_cb(Ewl_Container *n, Ewl_Widget *c); /** * @brief Create a new notebook container @@ -62,6 +64,10 @@ if (!n->tab_box) { DRETURN_INT(FALSE, DLEVEL_STABLE); } + + ewl_container_show_notify_set(EWL_CONTAINER(n->tab_box), ewl_notebook_child_show_cb); + ewl_container_hide_notify_set(EWL_CONTAINER(n->tab_box), ewl_notebook_child_hide_cb); + ewl_object_fill_policy_set(EWL_OBJECT(n->tab_box), EWL_FLAG_FILL_NONE); ewl_widget_internal_set(n->tab_box, TRUE); ewl_widget_appearance_set(n->tab_box, "tab_box"); @@ -515,6 +521,24 @@ DRETURN_INT(index, DLEVEL_STABLE); } +void ewl_notebook_child_show_cb(Ewl_Container *n, Ewl_Widget *c) +{ + printf("Tab box %p\n\t", n); + ewl_widget_print(EWL_WIDGET(n)); + printf("Tab shown %p\n\t", c); + ewl_widget_print(c); + ewl_box_child_show_cb(n, c); +} + +void ewl_notebook_child_hide_cb(Ewl_Container *n, Ewl_Widget *c) +{ + printf("Tab box %p\n\t", n); + ewl_widget_print(EWL_WIDGET(n)); + printf("Tab hidden %p\n\t", c); + ewl_widget_print(c); + ewl_box_child_hide_cb(n, c); +} + void ewl_notebook_tab_click_cb(Ewl_Widget *widget, void *ev_data __UNUSED__, void *user_data) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_row.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_row.c 2 Dec 2005 20:51:41 -0000 1.13 +++ ewl_row.c 30 Dec 2005 07:03:40 -0000 1.14 @@ -162,16 +162,24 @@ Ewl_Container *hdr; hdr = EWL_CONTAINER(row->header); - align = ecore_list_goto_first(EWL_CONTAINER(hdr)->children); + ewl_container_child_iterate_begin(EWL_CONTAINER(hdr)); + /* + * Get the first child of the header. + */ + align = EWL_OBJECT(ewl_container_child_next(EWL_CONTAINER(hdr))); if (align) { x = MAX(ewl_object_current_x_get(align), CURRENT_X(w)); } else x = CURRENT_X(w); + /* + * Iterate over the children and position the children. + */ + ewl_container_child_iterate_begin(EWL_CONTAINER(hdr)); while ((child = ecore_list_next(c->children))) { - align = ecore_list_next(EWL_CONTAINER(hdr)->children); + align = EWL_OBJECT(ewl_container_child_next(EWL_CONTAINER(hdr))); if (align) width = ewl_object_current_x_get(align) + ewl_object_current_w_get(align) - x; else if (nodes) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_seeker.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ewl_seeker.c 29 Dec 2005 17:12:09 -0000 1.10 +++ ewl_seeker.c 30 Dec 2005 07:03:40 -0000 1.11 @@ -128,7 +128,7 @@ ewl_seeker_mouse_down_cb, NULL); ewl_callback_append(w, EWL_CALLBACK_MOUSE_UP, ewl_seeker_mouse_up_cb, NULL); - ewl_callback_append(w, EWL_CALLBACK_DESTROY, + ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_seeker_mouse_up_cb, NULL); ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, ewl_seeker_mouse_move_cb, NULL); @@ -658,12 +658,19 @@ void *user_data __UNUSED__) { Ewl_Seeker *s = EWL_SEEKER(w); + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + DCHECK_TYPE("w", w, "seeker"); + if (s->timer) ecore_timer_del(s->timer); s->timer = NULL; s->start_time = 0; s->dragstart = 0; + + DLEAVE_FUNCTION(DLEVEL_STABLE); } void @@ -751,6 +758,7 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("data", data, FALSE); + DCHECK_TYPE("data", data, "seeker"); s = EWL_SEEKER(data); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_table.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_table.c 28 Oct 2005 02:11:29 -0000 1.9 +++ ewl_table.c 30 Dec 2005 07:03:40 -0000 1.10 @@ -61,6 +61,8 @@ ewl_widget_inherit(EWL_WIDGET(t), "table"); ewl_object_fill_policy_set(EWL_OBJECT(t), EWL_FLAG_FILL_FILL); + ewl_container_show_notify_set(EWL_CONTAINER(t), ewl_table_child_show_cb); + /* * Create a new grid */ @@ -98,12 +100,14 @@ t->selected.start_c = -1; t->selected.end_r = -1; t->selected.end_c = -1; + t->homogeneous_h = FALSE; + t->homogeneous_v = FALSE; /* * Append callbacks */ ewl_callback_append(EWL_WIDGET(t), EWL_CALLBACK_CONFIGURE, - ewl_table_configure_cb, NULL); + ewl_table_configure_cb, NULL); DRETURN_INT(TRUE, DLEVEL_STABLE); } @@ -352,7 +356,11 @@ DCHECK_PARAM_PTR("t", t); DCHECK_TYPE("t", t, "table"); - ewl_grid_reset(EWL_GRID(t->grid), cols, rows); + if (col_headers != NULL) + ewl_grid_reset(EWL_GRID(t->grid), cols, rows+1); + else + ewl_grid_reset(EWL_GRID(t->grid), cols, rows); + if (col_headers != NULL) { for (i = 1; i <= cols; i++) { @@ -362,6 +370,7 @@ ewl_widget_disable(button); ewl_container_child_append(EWL_CONTAINER(cell), button); ewl_grid_add(t->grid, EWL_WIDGET(cell), i, i, 1, 1); + ewl_widget_show(button); ewl_widget_show(EWL_WIDGET(cell)); } @@ -472,3 +481,119 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +void +ewl_table_child_show_cb(Ewl_Container *p, Ewl_Widget *c) +{ + Ewl_Table *table; + int width_g, height_g; + + table = EWL_TABLE (p); + ewl_object_preferred_inner_size_get (EWL_OBJECT (table->grid), &width_g, &height_g); + ewl_object_preferred_inner_size_set (EWL_OBJECT (table), width_g, height_g); +} + +/** + * @param table: the table to change homogeneous layout + * @param h: the boolean value to change the layout mode to + * @return Returns no value. + * @breif Change the homogeneous layout of the box + * + * Grids use non-homogeneous layout by default, this can be used + * to change that. + */ +void +ewl_table_homogeneous_set(Ewl_Table *table, unsigned int h) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("table", table); + DCHECK_TYPE("table", table, "table"); + + if (table->homogeneous_h != h) + ewl_table_hhomogeneous_set(table, h); + if (table->homogeneous_v != h) + ewl_table_vhomogeneous_set(table, h); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param table: the table to change horizontal homogeneous layout + * @param h: the boolean value to change the horizontal layout mode to + * @return Returns no value. + * @breif Change the horizontal homogeneous layout of the box + * + * Grids use non-homogeneous layout by default, this can be used + * to change that for horizontal orientation, i.e. all columns can + * have the same width. + */ +void +ewl_table_hhomogeneous_set(Ewl_Table *table, unsigned int h) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("table", table); + DCHECK_TYPE("table", table, "table"); + + if (table->homogeneous_h != h) + { + table->homogeneous_h = h; + ewl_grid_hhomogeneous_set (EWL_GRID (table->grid), h ); + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param table: the table to change vertical homogeneous layout + * @param h: the boolean value to change the vertical layout mode to + * @return Returns no value. + * @breif Change the vertical homogeneous layout of the box + * + * Grids use non-homogeneous layout by default, this can be used + * to change that for vertical orientation, i.e. all rows can have + * the same height. + */ +void +ewl_table_vhomogeneous_set(Ewl_Table *table, unsigned int h) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("table", table); + DCHECK_TYPE("table", table, "table"); + + if (table->homogeneous_v != h) + { + table->homogeneous_v = h; + ewl_grid_vhomogeneous_set (EWL_GRID (table->grid), h ); + } + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param table: the table to get the homogeneous layout + * @return The horizontal homogeneous flag + * @brief Retrieves the horizontal homogeneous flag + */ +unsigned int +ewl_table_hhomogeneous_get(Ewl_Table *table) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("table", table, 0); + DCHECK_TYPE_RET("table", table, "table", 0); + + DRETURN_INT(table->homogeneous_h, DLEVEL_STABLE); +} + +/** + * @param g: the table to get the vertical layout + * @return The vertical homogeneous flag + * @brief Retrieves the vertical homogeneous flag + */ +unsigned int +ewl_table_vhomogeneous_get(Ewl_Table *table) +{ + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR_RET("table", table, 0); + DCHECK_TYPE_RET("table", table, "table", 0); + + DRETURN_INT(table->homogeneous_v, DLEVEL_STABLE); +} =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_table.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_table.h 25 Oct 2005 05:34:20 -0000 1.5 +++ ewl_table.h 30 Dec 2005 07:03:40 -0000 1.6 @@ -37,6 +37,12 @@ int row_select; /* boolean: select entire rows */ + /* + * Flag indicating space assignment + */ + unsigned int homogeneous_h; /** Horizontal homogeneous flag */ + unsigned int homogeneous_v; /** Vertical homogeneous flag */ + struct { int start_r; int start_c; @@ -70,6 +76,11 @@ int end_col, int start_row, int emd_row); char *ewl_table_selected_get(Ewl_Table *table); +void ewl_table_homogeneous_set(Ewl_Table *table, unsigned int h); +void ewl_table_hhomogeneous_set(Ewl_Table *table, unsigned int h); +void ewl_table_vhomogeneous_set(Ewl_Table *table, unsigned int h); +unsigned int ewl_table_hhomogeneous_get(Ewl_Table *table); +unsigned int ewl_table_vhomogeneous_get(Ewl_Table *table); /* * Internally used callbacks, override at your own risk. @@ -78,8 +89,9 @@ void ewl_table_show_cb(Ewl_Widget *w, void *ev_data, void *user_data); void ewl_table_child_configure_cb(Ewl_Widget * w, void *ev_data, void *user_data); -void ewl_table_child_show_cb(Ewl_Widget *w, void *ev_data, void *user_data); -void ewl_table_child_select_cb(Ewl_Widget *w, void *ev_data, void *user_data); +//void ewl_table_child_show_cb(Ewl_Widget *w, void *ev_data, void *user_data); +void ewl_table_child_select_cb(Ewl_Widget *w, void *ev_data, void *user_data); +void ewl_table_child_show_cb(Ewl_Container *p, Ewl_Widget *c); /** * @} =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_tree.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- ewl_tree.c 29 Dec 2005 19:37:43 -0000 1.23 +++ ewl_tree.c 30 Dec 2005 07:03:40 -0000 1.24 @@ -47,7 +47,7 @@ ewl_tree_init(Ewl_Tree *tree, unsigned short columns) { int i; - Ewl_Widget *row; + Ewl_Widget *header; Ewl_Widget *button; DENTER_FUNCTION(DLEVEL_STABLE); @@ -78,7 +78,7 @@ tree->ncols = columns; - row = ewl_row_new(); + header = ewl_paned_new(); for (i = 0; i < tree->ncols; i++) { button = ewl_button_new(); ewl_box_orientation_set(EWL_BOX(button), @@ -86,14 +86,14 @@ ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_HSHRINK | EWL_FLAG_FILL_HFILL); - ewl_container_child_append(EWL_CONTAINER(row), button); + ewl_container_child_append(EWL_CONTAINER(header), button); ewl_widget_show(button); } - tree->header = row; - ewl_container_child_append(EWL_CONTAINER(tree), row); - ewl_widget_show(row); + ewl_container_child_append(EWL_CONTAINER(tree), header); + ewl_widget_show(header); + tree->header = header; tree->scrollarea = ewl_scrollpane_new(); ewl_container_child_append(EWL_CONTAINER(tree), tree->scrollarea); @@ -126,7 +126,7 @@ { unsigned short i; Ewl_Widget *button; - Ewl_Widget *row; + Ewl_Widget *header; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("tree", tree); @@ -135,19 +135,20 @@ if (!EWL_CONTAINER(tree)->children) DRETURN(DLEVEL_STABLE); - row = ecore_list_goto_first(EWL_CONTAINER(tree)->children); - ecore_list_goto_first(EWL_CONTAINER(row)->children); + header = tree->header; + + ewl_container_child_iterate_begin(EWL_CONTAINER(header)); + for (i = 0; i < tree->ncols; i++) { + button = ewl_container_child_next(EWL_CONTAINER(header)); + if (!button) + break; - button = ecore_list_next(EWL_CONTAINER(row)->children); - for (i = 0; i < tree->ncols && button; i++) { ewl_button_label_set(EWL_BUTTON(button), headers[i]); if (!tree->headers_visible && VISIBLE(button)) ewl_widget_hide(button); else if (tree->headers_visible && HIDDEN(button)) ewl_widget_show(button); - - button = ecore_list_next(EWL_CONTAINER(row)->children); } DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -162,26 +163,16 @@ void ewl_tree_headers_visible_set(Ewl_Tree *tree, unsigned int visible) { - unsigned short i; - Ewl_Widget *button; - Ewl_Widget *row; - DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("tree", tree); DCHECK_TYPE("tree", tree, "tree"); tree->headers_visible = visible; - row = ecore_list_goto_first(EWL_CONTAINER(tree)->children); - ecore_list_goto_first(EWL_CONTAINER(row)->children); - - button = ecore_list_next(EWL_CONTAINER(row)->children); - for (i = 0; i < tree->ncols && button; i++) { - if ((visible) && (HIDDEN(button))) ewl_widget_show(button); - else if ((!visible) && (VISIBLE(button))) ewl_widget_hide(button); - - button = ecore_list_next(EWL_CONTAINER(row)->children); - } + if (!visible) + ewl_widget_hide(tree->header); + else + ewl_widget_show(tree->header); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -271,7 +262,6 @@ break; } - ewl_widget_internal_set(cell, TRUE); ewl_container_child_append(EWL_CONTAINER(row), cell); ewl_widget_show(cell); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_tree2.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_tree2.h 2 Dec 2005 21:00:17 -0000 1.11 +++ ewl_tree2.h 30 Dec 2005 07:03:40 -0000 1.12 @@ -13,6 +13,10 @@ * data, indicate expansion points, notify views and controllers of changes, * trigger sorting on a row/column combination. * + * Data: + * Provides a wrapper to the data which allows for observer registration and a + * reference to a model for data access. + * * View: * Defines the callbacks for setting up the widgets based on the data returned * from the Model. Create widgets, set data on widgets, calculate sizing, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -3 -r1.57 -r1.58 --- ewl_widget.c 29 Dec 2005 19:37:43 -0000 1.57 +++ ewl_widget.c 30 Dec 2005 07:03:40 -0000 1.58 @@ -233,6 +233,8 @@ void ewl_widget_unrealize(Ewl_Widget * w) { + Ewl_Container *pc; + DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); DCHECK_TYPE("w", w, "widget"); @@ -243,6 +245,13 @@ if (!REALIZED(w)) DRETURN(DLEVEL_STABLE); + /* + * Notify parent of hidden state. + */ + pc = EWL_CONTAINER(w->parent); + if (pc) + ewl_container_child_hide_call(pc, w); + ewl_callback_call(w, EWL_CALLBACK_UNREALIZE); ewl_object_visible_remove(EWL_OBJECT(w), EWL_FLAG_VISIBLE_REALIZED); @@ -1970,6 +1979,7 @@ * caching. */ if (w->theme_object) { + /* edje_object_file_set(w->theme_object, "", ""); */ ewl_embed_object_cache(emb, w->theme_object); w->theme_object = NULL; } @@ -2129,20 +2139,52 @@ ewl_widget_unrealize_cb(Ewl_Widget * w, void *ev_data __UNUSED__, void *user_data __UNUSED__) { - Ewl_Container *pc; - DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); DCHECK_TYPE("w", w, "widget"); - ewl_widget_obscure(w); + if (w->theme_object) { + int i_l, i_r, i_t, i_b; + int p_l, p_r, p_t, p_b; + int l, r, t, b; - /* - * Notify parent of hidden state. - */ - pc = EWL_CONTAINER(w->parent); - if (pc) - ewl_container_child_hide_call(pc, w); + ewl_widget_theme_insets_get(w, &l, &r, &t, &b); + + ewl_object_insets_get(EWL_OBJECT(w), &i_l, &i_r, &i_t, &i_b); + ewl_object_padding_get(EWL_OBJECT(w), &p_l, &p_r, &p_t, &p_b); + + /* + * Use previously set insets and padding if available. + */ + if (l == i_l) + i_l = 0; + if (r == i_r) + i_r = 0; + if (t == i_t) + i_t = 0; + if (b == i_b) + i_b = 0; + + ewl_widget_theme_padding_get(w, &l, &r, &t, &b); + + if (l == p_l) + p_l = 0; + if (r == p_r) + p_r = 0; + if (t == p_t) + p_t = 0; + if (b == p_b) + p_b = 0; + + + /* + * Assign the relevant insets and padding. + */ + ewl_object_insets_set(EWL_OBJECT(w), i_l, i_r, i_t, i_b); + ewl_object_padding_set(EWL_OBJECT(w), p_l, p_r, p_t, p_b); + } + + ewl_widget_obscure(w); DLEAVE_FUNCTION(DLEVEL_STABLE); } ------------------------------------------------------- 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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs