From 5fef8504278dfd0a97ee83dcaf83c661876f7446 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Tue, 11 Oct 2016 15:37:34 +0900 Subject: [PATCH] Evas textblock: add ellipsis_disabled_set/get APIs The patch is reviewing in the following link. https://phab.enlightenment.org/D3780 @tizen_feature Change-Id: I7ea53d0810185280f671ce2ef503ed0d892beddc --- src/lib/evas/Evas_Legacy.h | 16 +++++++++ src/lib/evas/canvas/evas_object_textblock.c | 50 +++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index bc9190e..269f9bb 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -3876,6 +3876,22 @@ EAPI void evas_object_textblock_clear(Evas_O EAPI Eina_Bool evas_object_textblock_ellipsis_status_get(const Evas_Object *eo_obj) EINA_ARG_NONNULL(1); /* END */ +/** + * TIZEN_ONLY(20161011): add ellipsis_disabled_set/get APIs + * @internal + */ +EAPI void +evas_object_textblock_ellipsis_disabled_set(Evas_Object *eo_obj, Eina_Bool disabled); +/* END */ + +/** + * TIZEN_ONLY(20161011): add ellipsis_disabled_set/get APIs + * @internal + */ +EAPI Eina_Bool +evas_object_textblock_ellipsis_disabled_get(Evas_Object *eo_obj); +/* END */ + #include "canvas/evas_textblock.eo.legacy.h" /** diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 82fba1b..3e1944e 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -558,6 +558,10 @@ struct _Evas_Object_Textblock /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ Eina_Bool last_computed_ellipsis : 1; /* END */ + + /* TIZEN_ONLY(20161011): add ellipsis_disabled_set/get APIs */ + Eina_Bool ellipsis_disabled : 1; + /* END */ }; struct _Evas_Textblock_Selection_Iterator @@ -5142,9 +5146,15 @@ _layout_par(Ctxt *c) { /* Skip this paragraph if width is the same, there is no ellipsis * and we aren't just calculating. */ + /* TIZEN_ONLY(20161011): add ellipsis_disabled_set/get APIs if (!c->par->text_node->is_new && !c->par->text_node->dirty && !c->width_changed && c->par->lines && !c->o->have_ellipsis && !c->o->obstacle_changed) + */ + if (!c->par->text_node->is_new && !c->par->text_node->dirty && + !c->width_changed && c->par->lines && + (!c->o->have_ellipsis || c->o->ellipsis_disabled) && !c->o->obstacle_changed) + /* END */ { Evas_Object_Textblock_Line *ln; /* Update c->line_no */ @@ -5219,7 +5229,11 @@ _layout_par(Ctxt *c) { double ellip; ellip = it->format->ellipsis; + /* TIZEN_ONLY(20161011): add ellipsis_disabled_set/get APIs if ((0 <= ellip) && (ellip < 1.0)) + */ + if (!c->o->ellipsis_disabled && (0 <= ellip) && (ellip < 1.0)) + /* END */ _layout_par_ellipsis_items(c, ellip); } @@ -5359,11 +5373,20 @@ _layout_par(Ctxt *c) ellip_h_thresh = ascent + descent + maxasc + maxdesc; } + /* TIZEN_ONLY(20161011): add ellipsis_disabled_set/get APIs if ((it->format->ellipsis == 1.0) && (c->h >= 0) && ((c->y + ellip_h_thresh > c->h - c->o->style_pad.t - c->o->style_pad.b) || (!it->format->wrap_word && !it->format->wrap_char && !it->format->wrap_mixed && !it->format->wrap_hyphenation))) + */ + if (!c->o->ellipsis_disabled && + (it->format->ellipsis == 1.0) && (c->h >= 0) && + ((c->y + ellip_h_thresh > + c->h - c->o->style_pad.t - c->o->style_pad.b) || + (!it->format->wrap_word && !it->format->wrap_char && + !it->format->wrap_mixed && !it->format->wrap_hyphenation))) + /* END */ { /* TIZEN_ONLY(20160920): Add fade_ellipsis feature to TEXTBLOCK, TEXT part. */ c->o->last_computed_ellipsis = EINA_TRUE; @@ -13651,6 +13674,33 @@ evas_object_textblock_ellipsis_status_get(const Evas_Object *eo_obj) } /* END */ +/* TIZEN_ONLY(20161011): add ellipsis_disabled_set/get APIs */ +EAPI void +evas_object_textblock_ellipsis_disabled_set(Evas_Object *eo_obj, + Eina_Bool disabled) +{ + TB_HEAD_RETURN(EINA_FALSE); + + Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); + + if (o->ellipsis_disabled == disabled) return; + + o->ellipsis_disabled = disabled; + _evas_textblock_invalidate_all(o); + _evas_textblock_changed(o, eo_obj); +} + +EAPI Eina_Bool +evas_object_textblock_ellipsis_disabled_get(Evas_Object *eo_obj) +{ + TB_HEAD_RETURN(EINA_FALSE); + + Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); + + return o->ellipsis_disabled; +} +/* END */ + /** * @} */ -- 2.7.4