Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: Ewl.h.in Makefile.am ewl_box.c ewl_container.c ewl_embed.c ewl_entry.c ewl_entry.h ewl_fileselector.c ewl_object.c ewl_theme.c ewl_widget.c Log Message: * Initial textblock port, needs additional work. * Remove Etox build dependancy. * Temporary debugging output to track sizing bug. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Ewl.h.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- Ewl.h.in 9 Feb 2005 22:15:09 -0000 1.3 +++ Ewl.h.in 11 Mar 2005 15:20:53 -0000 1.4 @@ -256,7 +256,6 @@ #include <Evas.h> #include <Edje.h> #include <Ecore.h> -#include <Etox.h> #include <Edb.h> #include <stdio.h> =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- Makefile.am 9 Feb 2005 04:31:54 -0000 1.1 +++ Makefile.am 11 Mar 2005 15:20:53 -0000 1.2 @@ -5,7 +5,7 @@ INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir) \ [EMAIL PROTECTED]@ @ecore_cflags@ @evas_cflags@ @etox_cflags@ @emotion_cflags@ [EMAIL PROTECTED]@ @ecore_cflags@ @evas_cflags@ @emotion_cflags@ lib_LTLIBRARIES = libewl.la @@ -138,5 +138,5 @@ installed_headersdir = $(prefix)/include/ewl installed_headers_DATA = $(EWLHEADERS) $(EWLEMOTIONHEADERS) -libewl_la_LIBADD = @edje_libs@ @ecore_libs@ @evas_libs@ @etox_libs@ @emotion_libs@ -lm +libewl_la_LIBADD = @edje_libs@ @ecore_libs@ @evas_libs@ @emotion_libs@ -lm libewl_la_LDFLAGS = -version-info 0:0:0 =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_box.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_box.c 9 Feb 2005 04:31:54 -0000 1.1 +++ ewl_box.c 11 Mar 2005 15:20:53 -0000 1.2 @@ -277,6 +277,17 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } +/* + * Box layout algorithm: + * 1. Setup variables orientation dependant pointers so that the algorithm is + * independant of orientation. + * 2. Attempt to handout an even amount of space to all children, + * simultaneously calculating the remaining or overflow space not accepted + * by the children. + * 3. Try to coerce the children to fill or shrink to compensate for space + * calculated to under or over run. + * 4. Layout the position of all children based on the sizes accepted. + */ void ewl_box_configure_cb(Ewl_Widget * w, void *ev_data, void *user_data) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_container.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_container.c 9 Feb 2005 04:31:54 -0000 1.1 +++ ewl_container.c 11 Mar 2005 15:20:53 -0000 1.2 @@ -685,7 +685,7 @@ ecore_list_goto_first(c->children); while ((child = ecore_list_next(c->children))) { - if (VISIBLE(child)) { + if (VISIBLE(child) && REALIZED(child)) { curr_size = get_size(child); if (curr_size > max_size) max_size = curr_size; @@ -723,7 +723,7 @@ ecore_list_goto_first(c->children); while ((child = ecore_list_next(c->children))) { - if (VISIBLE(child)) + if (VISIBLE(child) && REALIZED(child)) curr_size += get_size(child); } @@ -771,9 +771,27 @@ { DENTER_FUNCTION(DLEVEL_STABLE); - if (c->child_show && VISIBLE(w) && REALIZED(w)) + if (c->child_show && VISIBLE(w) && REALIZED(w)) { + Ewl_Object *tmp; + printf("Parent: %dx%d\n", + ewl_object_preferred_w_get(EWL_OBJECT(c)), + ewl_object_preferred_h_get(EWL_OBJECT(c))); + + ecore_list_goto_first(c->children); + while ((tmp = ecore_list_next(c->children))) { + if (VISIBLE(tmp) && REALIZED(tmp)) + printf("\tChild: %dx%d\n", + ewl_object_preferred_w_get(tmp), + ewl_object_preferred_h_get(tmp)); + } + c->child_show(c, w); + printf("Parent: %dx%d\n", + ewl_object_preferred_w_get(EWL_OBJECT(c)), + ewl_object_preferred_h_get(EWL_OBJECT(c))); + } + /* * Only show it if there are visible children. */ =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_embed.c 9 Feb 2005 04:31:55 -0000 1.1 +++ ewl_embed.c 11 Mar 2005 15:20:53 -0000 1.2 @@ -6,7 +6,7 @@ extern Ewl_Widget *dnd_widget; Ecore_List *ewl_embed_list = NULL; -Evas_Smart *embedded_smart = NULL; +Evas_Smart *embedded_smart = NULL; static void ewl_embed_smart_add_cb(Evas_Object *obj); static void ewl_embed_smart_del_cb(Evas_Object *obj); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_entry.c 9 Feb 2005 04:31:55 -0000 1.1 +++ ewl_entry.c 11 Mar 2005 15:20:53 -0000 1.2 @@ -38,6 +38,7 @@ unsigned int len); static void ewl_entry_op_text_apply(Ewl_Entry *e, Ewl_Entry_Op *op); static void ewl_entry_op_text_free(void *op); +static void ewl_entry_op_text_plaintext_parse(Evas_Object *txtobj, char *txt); static void ewl_entry_update_size(Ewl_Entry * e); @@ -245,8 +246,12 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("e", e, NULL); - if (e->etox) - txt = etox_get_text(e->etox); + if (e->textobj) { + int len; + len = evas_object_textblock_length_get(e->textobj); + evas_object_textblock_cursor_pos_set(e->textobj, 0); + txt = evas_object_textblock_text_get(e->textobj, len); + } else if (e->text) txt = strdup(e->text); @@ -485,23 +490,17 @@ { Ewl_Entry_Op *op; Ewl_Entry_Op_Font *opf; - char *font = NULL; + const char *font = NULL; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("e", e, NULL); - if (REALIZED(e)) { - int size; - font = etox_context_get_font(etox_get_context(e->etox), &size); - } - else { - op = ewl_entry_op_relevant_find(e, EWL_ENTRY_OP_TYPE_FONT_SET); - opf = (Ewl_Entry_Op_Font *)op; - if (opf && opf->font) - font = strdup(opf->font); - } + op = ewl_entry_op_relevant_find(e, EWL_ENTRY_OP_TYPE_FONT_SET); + opf = (Ewl_Entry_Op_Font *)op; + if (opf && opf->font) + font = opf->font; - DRETURN_PTR(font, DLEVEL_STABLE); + DRETURN_PTR((font ? strdup(font) : NULL), DLEVEL_STABLE); } /** @@ -518,18 +517,10 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("e", e, 1); - if (REALIZED(e)) { - char *font = NULL; - font = etox_context_get_font(etox_get_context(e->etox), &size); - if (font) - FREE(font); - } - else { - op = ewl_entry_op_relevant_find(e, EWL_ENTRY_OP_TYPE_FONT_SET); - opf = (Ewl_Entry_Op_Font *)op; - if (opf) - size = opf->size; - } + op = ewl_entry_op_relevant_find(e, EWL_ENTRY_OP_TYPE_FONT_SET); + opf = (Ewl_Entry_Op_Font *)op; + if (opf) + size = opf->size; DRETURN_INT(size, DLEVEL_STABLE); } @@ -679,10 +670,12 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("e", e, 0); - if (!e->etox) + if (!e->textobj) DRETURN_INT(0, DLEVEL_STABLE); - index = etox_coord_to_index(e->etox, (Evas_Coord)(x), (Evas_Coord)(y)); + index = evas_object_textblock_char_coords_get(e->textobj, + (Evas_Coord)(x - CURRENT_X(e)), + (Evas_Coord)(y - CURRENT_Y(e)), NULL, NULL, NULL, NULL); DRETURN_INT(index, DLEVEL_STABLE); } @@ -709,10 +702,11 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("e", e); - if (!e->etox) + if (!e->textobj) DRETURN(DLEVEL_STABLE); - etox_index_to_geometry(e->etox, index, &tx, &ty, &tw, &th); + evas_object_textblock_char_pos_get(e->textobj, index, &tx, &ty, + &tw, &th); if (x) *x = (int)(tx); if (y) @@ -749,13 +743,18 @@ hh = CURRENT_H(w); /* - * Update the etox position and size. + * Update the position and size. */ - if (e->etox) { - etox_set_word_wrap(e->etox, e->wrap); - evas_object_move(e->etox, xx, yy); - evas_object_resize(e->etox, ww, hh); - evas_object_layer_set(e->etox, ewl_widget_layer_sum_get(w)); + if (e->textobj) { + if (e->wrap) + evas_object_textblock_format_insert(e->textobj, + "wrap=word"); + else + evas_object_textblock_format_insert(e->textobj, + "wrap=off"); + evas_object_move(e->textobj, xx, yy); + evas_object_resize(e->textobj, ww, hh); + evas_object_layer_set(e->textobj, ewl_widget_layer_sum_get(w)); } if (!e->editable) { @@ -793,9 +792,11 @@ void ewl_entry_realize_cb(Ewl_Widget * w, void *ev_data, void *user_data) { char *tmp; - Ewl_Entry *e; + int size; + char format[PATH_MAX]; + Ewl_Entry *e; Ewl_Embed *emb; - int r, g, b, a; + int r, g, b, a; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("w", w); @@ -810,40 +811,43 @@ DRETURN(DLEVEL_STABLE); /* - * Create the etox and save the context for future reference. + * Create the evas textblock */ - e->etox = etox_new(emb->evas); - e->context = etox_get_context(e->etox); + e->textobj = evas_object_textblock_add(emb->evas); /* - * Apply the default theme information to the context, this + * Apply the default theme information to the text, this * information may be altered programmatically through the operation * queues. */ tmp = ewl_theme_data_str_get(w, "font"); - etox_context_set_font(e->context, tmp, - ewl_theme_data_int_get(w, "font_size")); + size = ewl_theme_data_int_get(w, "font_size"); + + snprintf(format, PATH_MAX, "source=%s font=fonts/%s size=%d", + ewl_theme_path_get(), tmp, size); + evas_object_textblock_format_insert(e->textobj, format); IF_FREE(tmp); + /* tmp = ewl_theme_data_str_get(w, "style"); etox_context_set_style(e->context, tmp); IF_FREE(tmp); + */ r = ewl_theme_data_int_get(w, "color/r"); g = ewl_theme_data_int_get(w, "color/g"); b = ewl_theme_data_int_get(w, "color/b"); a = ewl_theme_data_int_get(w, "color/a"); - etox_context_set_color(e->context, r, g, b, a); + snprintf(format, PATH_MAX, "color=#%02x%02x%02x%02x", r, g, b, a); + evas_object_textblock_format_insert(e->textobj, format); if (w->fx_clip_box) - evas_object_clip_set(e->etox, w->fx_clip_box); - - ewl_entry_ops_apply(e); + evas_object_clip_set(e->textobj, w->fx_clip_box); /* - * Update the size of the entry + * Apply previous operations and update the size of the entry */ - ewl_entry_update_size(e); + ewl_entry_ops_apply(e); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -862,10 +866,9 @@ * if it is re-realized. */ ewl_entry_ops_reset(e); - evas_object_clip_unset(e->etox); - evas_object_del(e->etox); - e->etox = NULL; - e->context = NULL; + evas_object_clip_unset(e->textobj); + evas_object_del(e->textobj); + e->textobj = NULL; DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -877,7 +880,7 @@ e = EWL_ENTRY(w); - evas_object_show(e->etox); + evas_object_show(e->textobj); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -889,7 +892,7 @@ e = EWL_ENTRY(w); - evas_object_hide(e->etox); + evas_object_hide(e->textobj); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -908,13 +911,6 @@ ecore_dlist_destroy(e->applied); e->applied = NULL; - /* - * Finished with the etox, so now would be a good time to cleanup - * extra resources hanging around. FIXME: Should be called at some - * regular interval too, in case the text changes, but is never freed. - */ - etox_gc_collect(); - DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -925,8 +921,8 @@ DENTER_FUNCTION(DLEVEL_STABLE); e = EWL_ENTRY(w); - if (e->etox) - evas_object_layer_set(e->etox, ewl_widget_layer_sum_get(w)); + if (e->textobj) + evas_object_layer_set(e->textobj, ewl_widget_layer_sum_get(w)); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -1707,13 +1703,22 @@ static void ewl_entry_op_color_apply(Ewl_Entry *e, Ewl_Entry_Op *op) { - int or, og, ob, oa; + int or = 0, og = 0, ob = 0, oa = 255; + char *format; + char nformat[16]; Ewl_Entry_Op_Color *opc = (Ewl_Entry_Op_Color *)op; DENTER_FUNCTION(DLEVEL_STABLE); - etox_context_get_color(e->context, &or, &og, &ob, &oa); - etox_context_set_color(e->context, opc->r, opc->g, opc->b, opc->a); + format = evas_object_textblock_format_current_get(e->textobj); + if (format) + sscanf(format, "color=#%02x%02x%02x%02x", &or, &og, &ob, &oa); + + snprintf(nformat, 16, "color=#%02x%02x%02x%02x", opc->r, opc->g, + opc->b, opc->a); + evas_object_textblock_format_insert(e->textobj, nformat); + + IF_FREE(format); /* * Store the previous values for undoing. @@ -1750,15 +1755,22 @@ static void ewl_entry_op_font_apply(Ewl_Entry *e, Ewl_Entry_Op *op) { - char *of; + char of[PATH_MAX]; + char nformat[PATH_MAX]; + char *format; int size; Ewl_Entry_Op_Font *opf = (Ewl_Entry_Op_Font *)op; DENTER_FUNCTION(DLEVEL_STABLE); - of = etox_context_get_font(e->context, &size); + format = evas_object_textblock_format_current_get(e->textobj); + sscanf(format, "font=%s", of); + sscanf(format, "size=%d", &size); + + snprintf(nformat, PATH_MAX, "font=%s size=%d", opf->font, opf->size); + evas_object_textblock_format_insert(e->textobj, nformat); - etox_context_set_font(e->context, opf->font, opf->size); + FREE(format); FREE(opf->font); opf->font = of; @@ -1802,13 +1814,15 @@ static void ewl_entry_op_style_apply(Ewl_Entry *e, Ewl_Entry_Op *op) { - char *style; + char *style = NULL; Ewl_Entry_Op_Style *ops = (Ewl_Entry_Op_Style *)op; DENTER_FUNCTION(DLEVEL_STABLE); + /* style = etox_context_get_style(e->context); etox_context_set_style(e->context, ops->style); + */ FREE(ops->style); ops->style = style; @@ -1852,12 +1866,60 @@ ewl_entry_op_align_apply(Ewl_Entry *e, Ewl_Entry_Op *op) { unsigned int align; + char *format; + char alignment[32]; + char nformat[64]; Ewl_Entry_Op_Align *opa = (Ewl_Entry_Op_Align *)op; DENTER_FUNCTION(DLEVEL_STABLE); - align = etox_context_get_align(e->context); - etox_context_set_align(e->context, opa->align); + format = evas_object_textblock_format_current_get(e->textobj); + + sscanf(format, "align=%s", alignment); + + /* + * Default to left aligned. This will help with handling fully + * justified text. + */ + if (!strcmp(alignment, "center")) + align = EWL_FLAG_ALIGN_CENTER; + else if (!strcmp(alignment, "right")) + align = EWL_FLAG_ALIGN_RIGHT; + else + align = EWL_FLAG_ALIGN_LEFT; + + sscanf(format, "valign=%s", alignment); + + if (!strcmp(alignment, "baseline")) + align |= EWL_FLAG_ALIGN_CENTER; + else if (!strcmp(alignment, "top")) + align |= EWL_FLAG_ALIGN_TOP; + else + align |= EWL_FLAG_ALIGN_BOTTOM; + + FREE(format); + + if (opa->align & EWL_FLAG_ALIGN_RIGHT) { + format = "right"; + } + else if (opa->align & EWL_FLAG_ALIGN_LEFT) { + format = "left"; + } + else { + format = "center"; + } + + if (opa->align & EWL_FLAG_ALIGN_TOP) { + snprintf(nformat, 64, "align=%s valign=top", format); + } + else if (opa->align & EWL_FLAG_ALIGN_BOTTOM) { + snprintf(nformat, 64, "align=%s valign=bottom", format); + } + else { + snprintf(nformat, 64, "align=%s valign=baseline", format); + } + + evas_object_textblock_format_insert(e->textobj, nformat); opa->align = align; @@ -1939,7 +2001,7 @@ op->apply = ewl_entry_op_text_apply; op->free = ewl_entry_op_text_free; ops->text = strdup(text); - ops->index = index; + op->position = index; } DRETURN_PTR(op, DLEVEL_STABLE); @@ -1961,7 +2023,7 @@ op->apply = ewl_entry_op_text_apply; op->free = ewl_entry_op_text_free; ops->text = NULL; - ops->index = start; + op->position = start; ops->len = len; } @@ -1971,20 +2033,38 @@ static void ewl_entry_op_text_apply(Ewl_Entry *e, Ewl_Entry_Op *op) { + int len; Ewl_Entry_Op_Text *opt = (Ewl_Entry_Op_Text *)op; DENTER_FUNCTION(DLEVEL_STABLE); - if (op->type == EWL_ENTRY_OP_TYPE_TEXT_SET) - etox_set_text(e->etox, opt->text); - else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_APPEND) - etox_append_text(e->etox, opt->text); - else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_PREPEND) - etox_prepend_text(e->etox, opt->text); - else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_INSERT) - etox_insert_text(e->etox, opt->text, opt->index); - else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_DELETE) - etox_delete_text(e->etox, opt->index, opt->len); + len = evas_object_textblock_length_get(e->textobj); + if (op->type == EWL_ENTRY_OP_TYPE_TEXT_SET) { + char *nf; + evas_object_textblock_cursor_pos_set(e->textobj, len); + nf = evas_object_textblock_format_current_get(e->textobj); + evas_object_textblock_cursor_pos_set(e->textobj, 0); + evas_object_textblock_text_del(e->textobj, len); + if (nf) + evas_object_textblock_format_insert(e->textobj, nf); + ewl_entry_op_text_plaintext_parse(e->textobj, opt->text); + } + else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_APPEND) { + evas_object_textblock_cursor_pos_set(e->textobj, len); + ewl_entry_op_text_plaintext_parse(e->textobj, opt->text); + } + else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_PREPEND) { + evas_object_textblock_cursor_pos_set(e->textobj, 0); + ewl_entry_op_text_plaintext_parse(e->textobj, opt->text); + } + else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_INSERT) { + evas_object_textblock_cursor_pos_set(e->textobj, op->position); + ewl_entry_op_text_plaintext_parse(e->textobj, opt->text); + } + else if (op->type == EWL_ENTRY_OP_TYPE_TEXT_DELETE) { + evas_object_textblock_cursor_pos_set(e->textobj, op->position); + evas_object_textblock_text_del(e->textobj, opt->len); + } ewl_entry_update_size(e); @@ -2004,6 +2084,47 @@ } static void +ewl_entry_op_text_plaintext_parse(Evas_Object *txtobj, char *txt) +{ + char *tmp; + + DENTER_FUNCTION(DLEVEL_STABLE); + + if (!txt) + DRETURN(DLEVEL_STABLE); + + for (tmp = txt; *tmp; tmp++) { + if (*tmp == '\n') { + *tmp = '\0'; + evas_object_textblock_text_insert(txtobj, txt); + evas_object_textblock_format_insert(txtobj, "\n"); + *tmp = '\n'; + txt = tmp + 1; + } + else if (*tmp == '\r' && *(tmp + 1) == '\n') { + *tmp = '\0'; + evas_object_textblock_text_insert(txtobj, txt); + evas_object_textblock_format_insert(txtobj, "\n"); + *tmp = '\r'; + tmp++; + txt = tmp + 2; + } + else if (*tmp == '\t') { + *tmp = '\0'; + evas_object_textblock_text_insert(txtobj, txt); + evas_object_textblock_format_insert(txtobj, "\t"); + *tmp = '\t'; + txt = tmp + 1; + } + } + + if (*txt) + evas_object_textblock_text_insert(txtobj, txt); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void ewl_entry_op_prune_list(Ewl_Entry *e, int rstart, int rend, int bstart, int bend) { Ewl_Entry_Op *op; @@ -2028,29 +2149,27 @@ } /* - * Set the size of the entry to the size of the etox. + * Set the size of the entry to the size of the text object */ static void ewl_entry_update_size(Ewl_Entry * e) { - Evas_Coord width, height; + Evas_Coord width = 0, height = 0; /* * Adjust the properties of the widget to indicate the size of the text. */ - etox_text_geometry_get(e->etox, &width, &height); + evas_object_textblock_native_size_get(e->textobj, &width, &height); - if (!width) - width = 1; + width += 2; if (!height) height = 1; - evas_object_resize(e->etox, (width), (height)); - /* * Set the preferred size to the size of the etox and request that * size for the widget. */ ewl_object_preferred_inner_size_set(EWL_OBJECT(e), (int)(width), (int)(height)); + ewl_widget_configure(EWL_WIDGET(e)); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_entry.h 17 Feb 2005 19:14:54 -0000 1.3 +++ ewl_entry.h 11 Mar 2005 15:20:53 -0000 1.4 @@ -36,8 +36,7 @@ char *text; /**< The initial text in the entry */ int length; /**< Length of the text displayed */ - Evas_Object *etox; /**< Etox does the actual layout work */ - Etox_Context *context; /**< Contains various format settings */ + Evas_Object *textobj; /**< Object does the actual layout work */ Ecore_DList *ops; /**< Series of operations to apply */ Ecore_DList *applied; /**< Applied set of operations */ @@ -133,6 +132,7 @@ Ewl_Entry_Op_Type type; void (*apply)(Ewl_Entry *e, Ewl_Entry_Op *op); void (*free)(void *); + int position; }; typedef struct Ewl_Entry_Op_Color Ewl_Entry_Op_Color; @@ -179,7 +179,6 @@ { Ewl_Entry_Op op; char *text; - int index; int len; }; @@ -215,7 +214,7 @@ struct Ewl_Entry_Selection { Ewl_Widget widget; - Etox_Selection *select; + void *select; unsigned int start; unsigned int end; }; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_fileselector.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- ewl_fileselector.c 4 Mar 2005 06:59:11 -0000 1.8 +++ ewl_fileselector.c 11 Mar 2005 15:20:53 -0000 1.9 @@ -546,8 +546,8 @@ char *title; /* FIXME: clearing the lists is maybe not sufficient/correct */ - ewl_tree_selected_clear(fs->list_dirs); - ewl_tree_selected_clear(fs->list_files); + ewl_tree_selected_clear(EWL_TREE(fs->list_dirs)); + ewl_tree_selected_clear(EWL_TREE(fs->list_files)); ewl_container_reset(EWL_CONTAINER(fs->list_dirs)); ewl_container_reset(EWL_CONTAINER(fs->list_files)); ewl_entry_text_set(EWL_ENTRY(fs->entry_file), ""); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_object.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_object.c 9 Feb 2005 04:31:55 -0000 1.1 +++ ewl_object.c 11 Mar 2005 15:20:54 -0000 1.2 @@ -1325,10 +1325,8 @@ ewl_object_flags_remove(o, EWL_FLAGS_ALIGN_MASK, EWL_FLAGS_ALIGN_MASK); ewl_object_flags_add(o, align, EWL_FLAGS_ALIGN_MASK); - /* if (EWL_WIDGET(o)->parent) ewl_widget_configure(EWL_WIDGET(o)->parent); - */ DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -1436,10 +1434,8 @@ PREFERRED_H(o), EWL_ORIENTATION_VERTICAL); */ - /* if (EWL_WIDGET(o)->parent) ewl_widget_configure(EWL_WIDGET(o)->parent); - */ DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_theme.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_theme.c 17 Feb 2005 19:14:56 -0000 1.2 +++ ewl_theme.c 11 Mar 2005 15:20:54 -0000 1.3 @@ -162,13 +162,22 @@ if (*font_path == '/') ecore_list_append(font_paths, font_path); else { - snprintf(key, PATH_MAX, "%s/%s", theme_path, - font_path); - ecore_list_append(font_paths, strdup(key)); + int len; + char *tmp; + + len = strlen(theme_path); + tmp = theme_path + len - 4; + if (strcmp(tmp, ".eet")) + snprintf(key, PATH_MAX, "%s/%s", + theme_path, font_path); + else + snprintf(key, PATH_MAX, "%s", + theme_path); + + ecore_list_append(font_paths, strdup(key)); FREE(font_path); } - } } } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_widget.c 9 Feb 2005 04:31:56 -0000 1.1 +++ ewl_widget.c 11 Mar 2005 15:20:54 -0000 1.2 @@ -499,8 +499,9 @@ if (w->bit_state && !strcmp(w->bit_state, state)) DRETURN(DLEVEL_STABLE); - IF_FREE(w->bit_state); - w->bit_state = strdup(state); + if (w->bit_state) + ecore_string_release(w->bit_state); + w->bit_state = ecore_string_instance(state); if (w->theme_object) edje_object_signal_emit(w->theme_object, state, "EWL"); @@ -777,20 +778,28 @@ */ void ewl_widget_inherit(Ewl_Widget *widget, char *inherit) { + int len; char *tmp = NULL; + char *tmp2 = NULL; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("widget", widget); DCHECK_PARAM_PTR("inherit", inherit); - if (widget->inheritance) - tmp = widget->inheritance; + len = strlen(inherit) + 3; + tmp2 = widget->inheritance; + if (tmp2) + len += strlen(tmp2); else - tmp = strdup(""); + tmp2 = ""; + + tmp = malloc(sizeof(char) * len); + sprintf(tmp, "%s:%s:", tmp2, inherit); + + if (widget->inheritance) + ecore_string_release(widget->inheritance); + widget->inheritance = ecore_string_instance(tmp); - widget->inheritance = malloc(sizeof(char) * - (strlen(inherit) + strlen(tmp) + 3)); - sprintf(widget->inheritance, "%s:%s:", tmp, inherit); FREE(tmp); DLEAVE_FUNCTION(DLEVEL_STABLE); ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs