From a43683f915bad09c0de3ab6c4748d91b3b491d18 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Tue, 20 Sep 2016 19:47:55 +0900 Subject: [PATCH] edje: Add fade_ellipsis feature to TEXTBLOCK, TEXT part @tizen_feature Change-Id: I6d70eece9fd4a1194d3140eb527a8811cba76a2b --- data/Makefile.am | 5 + packaging/efl.spec | 1 + src/bin/edje/edje_cc_handlers.c | 36 ++++ src/lib/edje/edje_calc.c | 279 ++++++++++++++++++++++++++++ src/lib/edje/edje_data.c | 6 + src/lib/edje/edje_private.h | 10 + src/lib/evas/Evas_Legacy.h | 14 ++ src/lib/evas/canvas/evas_object_text.c | 15 ++ src/lib/evas/canvas/evas_object_textblock.c | 26 +++ 9 files changed, 392 insertions(+) diff --git a/data/Makefile.am b/data/Makefile.am index d30fced..e3aab37 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -69,6 +69,11 @@ edjefilesdir = $(datadir)/edje/include edjefiles_DATA = edje/include/edje.inc EXTRA_DIST += $(edjefiles_DATA) +edjeimagesdir = $(datadir)/edje/images +edjeimages_DATA = edje/images/edje_default_left_fade_image.png \ + edje/images/edje_default_right_fade_image.png +EXTRA_DIST += $(edjeimages_DATA) + mimedir = $(datadir)/mime/packages mime_DATA = edje/edje.xml EXTRA_DIST += $(mime_DATA) diff --git a/packaging/efl.spec b/packaging/efl.spec index e6f0231..dbcef45 100755 --- a/packaging/efl.spec +++ b/packaging/efl.spec @@ -1073,6 +1073,7 @@ install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/efl.conf %{_libdir}/libedje.so.* %{_libdir}/edje/utils/*/* %{_datadir}/edje/include/edje.inc +%{_datadir}/edje/images/* %{_datadir}/mime/packages/edje.xml %files -n edje-tools diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 5032b60..cdc3607 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -382,6 +382,9 @@ static void st_collections_group_parts_part_description_text_align(void); static void st_collections_group_parts_part_description_text_source(void); static void st_collections_group_parts_part_description_text_text_source(void); static void st_collections_group_parts_part_description_text_ellipsis(void); +/* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ +static void st_collections_group_parts_part_description_text_fade_ellipsis(void); +/* END */ static void st_collections_group_parts_part_description_box_layout(void); static void st_collections_group_parts_part_description_box_align(void); static void st_collections_group_parts_part_description_box_padding(void); @@ -867,6 +870,9 @@ New_Statement_Handler statement_handlers[] = {"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_ellipsis}, {"collections.group.parts.part.description.text.ellipsis", st_collections_group_parts_part_description_text_ellipsis}, {"collections.group.parts.part.description.text.filter", st_collections_group_parts_part_description_filter_code}, /* dup */ + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + {"collections.group.parts.part.description.text.fade_ellipsis", st_collections_group_parts_part_description_text_fade_ellipsis}, + /* END */ {"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout}, {"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align}, {"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding}, @@ -1489,6 +1495,9 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c ed->text.align.y = FROM_DOUBLE(0.5); ed->text.id_source = -1; ed->text.id_text_source = -1; + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + ed->text.fade_ellipsis = FROM_DOUBLE(0.0); + /* END */ result = &ed->common; break; @@ -7377,6 +7386,9 @@ st_collections_group_parts_part_description_inherit(void) data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_source), &(ted->text.id_source), &ted->text.id_source_part); data_queue_copied_part_nest_lookup(pc, &(tparent->text.id_text_source), &(ted->text.id_text_source), &ted->text.id_text_source_part); + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + ted->text.fade_ellipsis = tparent->text.fade_ellipsis; + /* END */ break; } @@ -9722,6 +9734,30 @@ st_collections_group_parts_part_description_text_ellipsis(void) ed->text.ellipsis = parse_float_range(0, -1.0, 1.0); } +/* + * TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. + */ +static void +st_collections_group_parts_part_description_text_fade_ellipsis(void) +{ + Edje_Part_Description_Text *ed; + + check_arg_count(1); + + if ((current_part->type != EDJE_PART_TYPE_TEXT) && + (current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) + { + ERR("parse error %s:%i. text attributes in non-TEXT part.", + file_in, line - 1); + exit(-1); + } + + ed = (Edje_Part_Description_Text*) current_desc; + + ed->text.fade_ellipsis = parse_float_range(0, -1.0, 1.0) + 1.0; +} +/* END */ + /** @edcsubsection{collections_group_parts_description_box, * Group.Parts.Part.Description.Box} */ diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 3f60e49..2a3b824 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3738,6 +3738,279 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein return EINA_FALSE; } +/* + * TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. + */ +#define EDJE_DEFAULT_LEFT_FADE_IMAGE "edje_default_left_fade_image.png" +#define EDJE_DEFAULT_RIGHT_FADE_IMAGE "edje_default_right_fade_image.png" + +static void +_edje_real_part_text_fade_image_set(Edje *ed, Edje_Real_Part *ep, double align) +{ + Evas_Object *fade_obj = fade_obj = ep->typedata.text->fade.object; + char buf[1024]; + + if (align == 1.0) + snprintf(buf, sizeof(buf), "/usr/share/edje/images/%s", EDJE_DEFAULT_RIGHT_FADE_IMAGE); + else + snprintf(buf, sizeof(buf), "/usr/share/edje/images/%s", EDJE_DEFAULT_LEFT_FADE_IMAGE); + + evas_object_image_file_set(fade_obj, buf, NULL); + + if (evas_object_image_load_error_get(fade_obj) != EVAS_LOAD_ERROR_NONE) + { + ERR("Error loading fade image from file \"%s\".", buf); + + switch (evas_object_image_load_error_get(fade_obj)) + { + case EVAS_LOAD_ERROR_GENERIC: + ERR("Error type: EVAS_LOAD_ERROR_GENERIC"); + break; + case EVAS_LOAD_ERROR_DOES_NOT_EXIST: + ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST"); + break; + case EVAS_LOAD_ERROR_PERMISSION_DENIED: + ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED"); + break; + case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: + ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED"); + break; + case EVAS_LOAD_ERROR_CORRUPT_FILE: + ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE"); + break; + case EVAS_LOAD_ERROR_UNKNOWN_FORMAT: + ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT"); + break; + default: + ERR("Error type: ???"); + break; + } + } +} + +static void +_real_part_object_del_cb_for_fade_object(void *data, + Evas *e EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Edje_Real_Part *ep = (Edje_Real_Part *)data; + + if (ep->typedata.text->fade.object) + evas_object_del(ep->typedata.text->fade.object); + ep->typedata.text->fade.object = NULL; +} + +static void +_real_part_object_move_cb_for_fade_object(void *data, + Evas *e EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Edje_Real_Part *ep = (Edje_Real_Part *)data; + + if (ep->typedata.text->fade.object) + { + Evas_Coord x, y; + + evas_object_geometry_get(ep->object, &x, &y, NULL, NULL); + evas_object_move(ep->typedata.text->fade.object, x, y); + } +} + +static void +_edje_fade_ellipsis_apply(Edje *ed, Edje_Real_Part *ep, + Edje_Calc_Params *pf, + Edje_Part_Description_Text *chosen_desc) +{ + // DEBUGGING FLAG +#define FADE_CLIP 1 +#define FADE_IMAGE 1 +#define FADE_IMAGE_BORDER 1 + // + Evas_Coord tw, th; + Evas_Coord lx, ly, lw, lh; + Evas_Coord iw; + Evas_Coord clipper_h; + Evas_BiDi_Direction dir; + Evas_Object *clipper; + Evas_Object *fade_obj; + double align; + Eina_Bool ellipsis_status; + + if ((ep->part->type != EDJE_PART_TYPE_TEXTBLOCK) && + (ep->part->type != EDJE_PART_TYPE_TEXT)) + return; + + if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) + ellipsis_status = evas_object_textblock_ellipsis_status_get(ep->object); + else + ellipsis_status = evas_object_text_ellipsis_status_get(ep->object); + + // Hide fade image if fade_ellipsis option is off or object size is zero. + if ((chosen_desc->text.fade_ellipsis == 0.0) || + (pf->final.w == 0) || (pf->final.h == 0)) + { + if (ep->typedata.text->fade.object) + { +#if FADE_CLIP + clipper = evas_object_clip_get(ep->typedata.text->fade.object); + + if (clipper) evas_object_clip_set(ep->object, clipper); +#endif + evas_object_hide(ep->typedata.text->fade.object); + } + + return; + } + + if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) + { + Evas_Coord fw, fh; + + evas_object_textblock_size_native_get(ep->object, &tw, &th); + evas_object_textblock_size_formatted_get(ep->object, &fw, &fh); + + // FIXME: Sometimes, formatted_get returns 0 as width in single-line textblock. + if (fh > th) + { + tw = fw; + th = fh; + } + } + else + { + tw = evas_object_text_horiz_advance_get(ep->object), + th = evas_object_text_vert_advance_get(ep->object); + } + + // Hide fade image if text is not exceed the given area. + if ((tw <= pf->final.w) && (th <= pf->final.h) && !ellipsis_status) + { + if (ep->typedata.text->fade.object) + { +#if FADE_CLIP + clipper = evas_object_clip_get(ep->typedata.text->fade.object); + + if (clipper) evas_object_clip_set(ep->object, clipper); +#endif + evas_object_hide(ep->typedata.text->fade.object); + } + + return; + } + + // Make and show fade image. + if (!ep->typedata.text->fade.object) + { +#if FADE_IMAGE + ep->typedata.text->fade.object = evas_object_image_add(evas_object_evas_get(ep->object)); +#else + ep->typedata.text->fade.object = evas_object_rectangle_add(evas_object_evas_get(ep->object)); + evas_object_color_set(ep->typedata.text->fade.object, 200, 0, 0, 200); +#endif + evas_object_pass_events_set(ep->typedata.text->fade.object, 1); + evas_object_pointer_mode_set(ep->typedata.text->fade.object, EVAS_OBJECT_POINTER_MODE_NOGRAB); + evas_object_smart_member_add(ep->typedata.text->fade.object, ed->obj); + evas_object_event_callback_add(ep->object, EVAS_CALLBACK_DEL, _real_part_object_del_cb_for_fade_object, ep); + evas_object_event_callback_add(ep->object, EVAS_CALLBACK_MOVE, _real_part_object_move_cb_for_fade_object, ep); + + ep->typedata.text->fade.align = -1; + } + + fade_obj = ep->typedata.text->fade.object; + + if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK) + { + Evas_Textblock_Cursor *cur; + + cur = evas_object_textblock_cursor_new(ep->object); + evas_textblock_cursor_line_coord_set(cur, pf->final.h); + evas_textblock_cursor_line_geometry_get(cur, &lx, &ly, &lw, &lh); + evas_textblock_cursor_geometry_get(cur, + NULL, NULL, NULL, NULL, &dir, + EVAS_TEXTBLOCK_CURSOR_BEFORE); + + if (ly + lh > pf->final.h) + { + evas_textblock_cursor_line_coord_set(cur, pf->final.h - lh); + evas_textblock_cursor_line_geometry_get(cur, &lx, &ly, &lw, &lh); + evas_textblock_cursor_geometry_get(cur, + NULL, NULL, NULL, NULL, &dir, + EVAS_TEXTBLOCK_CURSOR_BEFORE); + } + + evas_textblock_cursor_free(cur); + } + else + { + // FIXME: I don't know how should I handle this in evas text. + lx = ly = 0; + dir = evas_object_text_direction_get(ep->object); + evas_object_geometry_get(ep->object, NULL, NULL, &lw, &lh); + } + + if (dir != EVAS_BIDI_DIRECTION_RTL) + align = chosen_desc->text.fade_ellipsis - 1.0; + else + align = 1.0 - (chosen_desc->text.fade_ellipsis - 1.0); + +#if FADE_IMAGE + if (ep->typedata.text->fade.align != align) + { + // Load image from edje. + _edje_real_part_text_fade_image_set(ed, ep, align); + + // Default fade image is for LTR. + // Assume 10% of fadeout image's left side is opaque. (alpha = 255) + if (align == 1.0) + { +#if FADE_IMAGE_BORDER + evas_object_image_size_get(fade_obj, &iw, NULL); + evas_object_image_border_set(fade_obj, 0, iw - (iw * 0.1), 0, 0); + evas_object_image_border_scale_set(fade_obj, 1.0); + evas_object_image_border_center_fill_set(fade_obj, EVAS_BORDER_FILL_DEFAULT); +#endif + } + else + { +#if FADE_IMAGE_BORDER + evas_object_image_size_get(fade_obj, &iw, NULL); + evas_object_image_border_set(fade_obj, iw - (iw * 0.1), 0, 0, 0); + evas_object_image_border_scale_set(fade_obj, 1.0); + evas_object_image_border_center_fill_set(fade_obj, EVAS_BORDER_FILL_DEFAULT); +#endif + } + + ep->typedata.text->fade.align = (float)align; + } +#endif + + // This will prevent to show horizontally cut off text in multiline textblock. + if (ly != 0) + clipper_h = ly + lh; + else + clipper_h = pf->final.h; + +#if FADE_IMAGE + evas_object_image_fill_set(fade_obj, 0, 0, pf->final.w, clipper_h); +#endif + evas_object_resize(fade_obj, pf->final.w, clipper_h); + evas_object_move(fade_obj, ed->x + pf->final.x, ed->y + pf->final.y); + +#if FADE_CLIP + clipper = evas_object_clip_get(ep->object); + + if (clipper != fade_obj) + { + evas_object_clip_set(fade_obj, clipper); + evas_object_clip_set(ep->object, fade_obj); + evas_object_show(fade_obj); + } +#endif +} +/* END */ + void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *state) { @@ -4937,6 +5210,12 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta } } } + + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK || + ep->part->type == EDJE_PART_TYPE_TEXT) + _edje_fade_ellipsis_apply(ed, ep, pf, (Edje_Part_Description_Text*) chosen_desc); + /* END */ } if (map_colors_free) _map_colors_free(pf); diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index b8e52df..f9ef23d 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -1115,6 +1115,9 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.id_text_source", text.id_text_source, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.id_text_source_part", text.id_text_source_part, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.ellipsis", text.ellipsis, EET_T_DOUBLE); + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.fade_ellipsis", text.fade_ellipsis, EET_T_DOUBLE); + /* END */ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter", filter.code, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter_sources", filter.sources); EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.filter.data", filter.data, _edje_edd_edje_part_description_filter_data); // @since 1.15 @@ -1151,6 +1154,9 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.id_text_source", text.id_text_source, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.id_text_source_part", text.id_text_source_part, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.ellipsis", text.ellipsis, EET_T_DOUBLE); + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_textblock, Edje_Part_Description_Text, "text.fade_ellipsis", text.fade_ellipsis, EET_T_DOUBLE); + /* END */ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Box); eddc.func.mem_free = mem_free_box; diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index df51572..22ae4d4 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -1407,6 +1407,10 @@ struct _Edje_Part_Description_Spec_Text int id_text_source; /* -1 if none */ char *id_text_source_part; + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + double fade_ellipsis; + /* END */ + unsigned char fit_x; /* resize font size down to fit in x dir */ unsigned char fit_y; /* resize font size down to fit in y dir */ unsigned char min_x; /* if text size should be part min size */ @@ -1893,6 +1897,12 @@ struct _Edje_Real_Part_Text const char *style; // 4 Edje_Position offset; // 8 short size; // 2 + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + struct { + Evas_Object *object; // 4 + float align; // 4 + } fade; + /* END */ struct { unsigned char fit_x, fit_y; // 2 short in_size; // 2 diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 9743636..731f562 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -3195,6 +3195,13 @@ EAPI void evas_object_text_filter_program_set(Eo *obj, const char *code); EAPI void evas_object_text_filter_source_set(Eo *obj, const char *name, Evas_Object *eo_source); /** + * TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. + * @internal + */ +EAPI Eina_Bool evas_object_text_ellipsis_status_get(const Evas_Object *eo_obj) EINA_ARG_NONNULL(1); +/* END */ + +/** * @} */ @@ -3249,6 +3256,13 @@ EAPI char *evas_textblock_text_utf8_to_markup */ EAPI void evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1); +/** + * TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. + * @internal + */ +EAPI Eina_Bool evas_object_textblock_ellipsis_status_get(const Evas_Object *eo_obj) EINA_ARG_NONNULL(1); +/* END */ + #include "canvas/evas_textblock.eo.legacy.h" /** diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 4342cb7..b35bacd 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -2426,4 +2426,19 @@ _evas_text_evas_object_paragraph_direction_get(Eo *eo_obj EINA_UNUSED, return o->paragraph_direction; } +/* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ +EAPI Eina_Bool +evas_object_text_ellipsis_status_get(const Evas_Object *eo_obj) +{ + Evas_Text_Data *o; + + MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); + return EINA_FALSE; + MAGIC_CHECK_END(); + + o = eo_data_scope_get(eo_obj, MY_CLASS); + return o->last_computed.ellipsis; +} +/* END */ + #include "canvas/evas_text.eo.c" diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 28c92f2..24f7980 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -554,6 +554,10 @@ struct _Evas_Object_Textblock Eina_Bool legacy_newline : 1; Eina_Bool inherit_paragraph_direction : 1; Eina_Bool changed_paragraph_direction : 1; + + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + Eina_Bool last_computed_ellipsis : 1; + /* END */ }; struct _Evas_Textblock_Selection_Iterator @@ -5027,6 +5031,10 @@ _layout_par_ellipsis_items(Ctxt *c, double ellip) if (exceed <= 0) return; + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + c->o->last_computed_ellipsis = EINA_TRUE; + /* END */ + { Evas_Object_Textblock_Item *first_it = _ITEM(eina_list_data_get(c->par->logical_items)); @@ -5357,6 +5365,9 @@ _layout_par(Ctxt *c) (!it->format->wrap_word && !it->format->wrap_char && !it->format->wrap_mixed && !it->format->wrap_hyphenation))) { + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + c->o->last_computed_ellipsis = EINA_TRUE; + /* END */ _layout_handle_ellipsis(c, it, i); ret = 1; goto end; @@ -6198,6 +6209,9 @@ _relayout(const Evas_Object *eo_obj) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); + /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ + o->last_computed_ellipsis = EINA_FALSE; + /* END */ _layout(eo_obj, obj->cur->geometry.w, obj->cur->geometry.h, &o->formatted.w, &o->formatted.h); o->formatted.valid = 1; @@ -13622,6 +13636,18 @@ _evas_textblock_evas_object_paragraph_direction_get(Eo *eo_obj EINA_UNUSED, return o->paragraph_direction; } +/* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ +EAPI Eina_Bool +evas_object_textblock_ellipsis_status_get(const Evas_Object *eo_obj) +{ + TB_HEAD_RETURN(EINA_FALSE); + + Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); + + return o->last_computed_ellipsis; +} +/* END */ + /** * @} */ -- 2.7.4