From: <enl...@li...> - 2005-02-09 18:15:33
|
Enlightenment CVS committal Author : dj2 Project : misc Module : eke Dir : misc/eke/src Modified Files: Makefile.am eke_gui_edje_item.c eke_gui_ewl.c Log Message: - kill etox, update to evas_object_textblock - still has some issues, but works as it did with etox, scrolling is messed up in the text blocks - you'll need the newest evas for this to work =================================================================== RCS file: /cvsroot/enlightenment/misc/eke/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- Makefile.am 31 Dec 2004 05:17:53 -0000 1.2 +++ Makefile.am 9 Feb 2005 18:15:26 -0000 1.3 @@ -9,7 +9,6 @@ if BUILD_EDJE_GUI EDJECFLAGS = \ @EDJE_CFLAGS@ \ - @ETOX_CFLAGS@ \ @ESMART_CFLAGS@ endif @@ -47,7 +46,6 @@ EDJELDADD = \ @EDJE_LIBS@ \ - @ETOX_LIBS@ \ @ESMART_LIBS@ \ -lesmart_container =================================================================== RCS file: /cvsroot/enlightenment/misc/eke/src/eke_gui_edje_item.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- eke_gui_edje_item.c 31 Dec 2004 00:16:00 -0000 1.7 +++ eke_gui_edje_item.c 9 Feb 2005 18:15:26 -0000 1.8 @@ -107,25 +107,22 @@ { if(body) { Evas_Object *desc, *container; - Etox_Context *ctx; Evas_Coord w, h, ew, eh; + char fmt[2048]; Evas *evas; - + const char *file; + evas = evas_object_evas_get(o); if ((desc = edje_object_part_swallow_get(data->obj, "body"))) evas_object_del(desc); - desc = etox_new(evas); - ctx = etox_get_context(desc); - etox_context_set_color(ctx, 0, 0, 0, 255); - etox_context_set_font(ctx, "Vera", 10); - etox_context_set_wrap_marker(ctx, "", NULL); - etox_set_context(desc, ctx); - - etox_set_soft_wrap(desc, 1); - etox_set_word_wrap(desc, 1); - etox_set_text(desc, (char *)body); + desc = evas_object_textblock_add(evas); + edje_object_file_get(data->obj, &file, NULL); + snprintf(fmt, 2048, "font_source=%s font=fonts/Vera size=10 color=#000000ff", file); + evas_object_textblock_format_insert(desc, fmt); + + evas_object_textblock_text_insert(desc, body); evas_object_show(desc); container = esmart_container_new(evas); @@ -145,7 +142,8 @@ edje_object_part_swallow(data->obj, "body", container); /* hide the scrollbar if we have less text then visible space */ - etox_text_geometry_get(desc, &ew, &eh); + evas_object_textblock_format_size_get(desc, &ew, &eh); + if (eh <= h) edje_object_signal_emit(data->obj, "body,scroll,hide", ""); @@ -204,7 +202,7 @@ Evas_List *list; if ((container = (Evas_Object*)data)) { - Evas_Object *etox; + Evas_Object *textblock; edje_object_part_geometry_get(o, "body", NULL, NULL, &cw, &ch); @@ -212,10 +210,10 @@ * esmart_container_elements_length_get(container) so i'm doing this * the hard way... */ list = esmart_container_elements_get(container); - etox = evas_list_nth(list, 0); - etox_text_geometry_get(etox, NULL, &container_length); - edje_object_part_drag_value_get(o, src, &sx, &sy); + textblock = evas_list_nth(list, 0); + evas_object_textblock_format_size_get(textblock, NULL, &container_length); + edje_object_part_drag_value_get(o, src, &sx, &sy); switch (esmart_container_direction_get(container)) { case CONTAINER_DIRECTION_HORIZONTAL: if(container_length > cw) { @@ -394,7 +392,7 @@ if((data = evas_object_smart_data_get(o))) { Evas_List *list; - Evas_Object *etox, *container;; + Evas_Object *textblock, *container;; Evas_Coord eh, ph; evas_object_resize(data->obj, w, h); @@ -402,8 +400,8 @@ container = edje_object_part_swallow_get(data->obj, "body"); list = esmart_container_elements_get(container); - etox = evas_list_nth(list, 0); - etox_text_geometry_get(etox, NULL, &eh); + textblock = evas_list_nth(list, 0); + evas_object_textblock_format_size_get(textblock, NULL, &eh); if (eh > ph) edje_object_signal_emit(data->obj, "body,scroll,show", ""); =================================================================== RCS file: /cvsroot/enlightenment/misc/eke/src/eke_gui_ewl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- eke_gui_ewl.c 27 Dec 2004 22:45:01 -0000 1.1 +++ eke_gui_ewl.c 9 Feb 2005 18:15:26 -0000 1.2 @@ -110,6 +110,7 @@ ecore_list_goto_first(feed->items); while ((item = ecore_list_next(feed->items)) != NULL) { o = ewl_text_new(NULL); + ewl_text_wrap_set(EWL_TEXT(o), 1); ewl_text_style_set(EWL_TEXT(o), "soft_shadow"); ewl_text_text_set(EWL_TEXT(o), item->title); ewl_container_child_append(EWL_CONTAINER(disp->page), o); @@ -117,12 +118,14 @@ if (item->link) { o = ewl_text_new(item->link); + ewl_text_wrap_set(EWL_TEXT(o), 1); ewl_container_child_append(EWL_CONTAINER(disp->page), o); ewl_widget_show(o); } if (item->desc) { o = ewl_text_new(item->desc); + ewl_text_wrap_set(EWL_TEXT(o), 1); ewl_container_child_append(EWL_CONTAINER(disp->page), o); ewl_widget_show(o); } |